Spaces between words are kept
Runs of whitespace are reduced to a single space instead of being removed, so inline text and buttons stay spaced as before.
Minify HTML by collapsing whitespace and removing comments, with optional compression of inline CSS and JavaScript. Free and private.
Paste a full page or a fragment, up to 1,000,000 characters.
Keep or remove comments, and decide whether CSS in style tags and JavaScript in script tags is compressed too.
Select “Minify HTML”, check how much smaller it is, then copy the result or download it as an HTML file.
Runs of whitespace are reduced to a single space instead of being removed, so inline text and buttons stay spaced as before.
Content inside pre and textarea elements keeps its line breaks and indentation.
Minified HTML is hard to edit. Keep the original in your project and minify a copy when you publish.
Yes. Paste a copy of the markup, select the options and download the smaller output. Your original file is not overwritten. Test the result in your website before replacing production markup, especially when it contains templates or inline scripts.
It makes the file smaller, which helps most on large pages. Compression by your web server, such as gzip or Brotli, saves more, and both work together.
It stops when it cannot read the markup, for example an attribute with an unclosed quote. The message quotes the part of the code to check.
No. The minifier runs in your browser, so templates and unpublished pages stay on your device.