Minifies HTML by removing comments and collapsing whitespace.
HTML Minify strips out comments and collapses extra whitespace to shrink your HTML markup. It removes every <!-- ... --> comment, eliminates spaces between adjacent tags, and reduces runs of whitespace to a single space, which is handy when you want to compress HTML by hand or quickly clean up generated output. Paste your markup and get a minified version back instantly.
No. The minifier runs entirely in your browser using plain JavaScript, so your HTML never leaves your device and nothing is uploaded.
It deletes all HTML comments (<!-- ... -->), removes whitespace between adjacent tags, collapses any run of whitespace into a single space, and trims leading and trailing whitespace.
No. Whitespace is collapsed everywhere, so significant spacing or newlines inside <pre>, <textarea>, <script>, or <style> will be altered. Avoid minifying markup that depends on whitespace in those elements.
No. It only handles comments and whitespace. Attributes, quotes, and tags are left intact aside from the spacing changes.
It matches anything between <!-- and -->, so a literal comment marker appearing inside text or an attribute value would also be removed. This is rare but worth checking on unusual input.