Formatters
HTML Minifier
Paste HTML to remove comments and collapse whitespace. Content inside pre, textarea, script and style is left exactly as written.
Paste HTML to remove comments and collapse whitespace. Content inside pre, textarea, script and style is left exactly as written.
Minifying HTML removes characters browsers do not need, such as comments and repeated whitespace, so pages download a little faster.
This minifier is conservative. It keeps the text between inline tags and leaves pre, textarea, script and style untouched.
<div><p>Hello <b>world</b></p></div>
For normal pages, yes. Pages that rely on whitespace between inline elements should be checked after minifying.
Yes. Comments starting with an if condition are preserved.
No. The contents of style and script are left alone so nothing is broken.
Already compact HTML has little to remove. Gzip or Brotli on your server gives a larger gain.