HTML Minifier

Remove comments and collapse whitespace in HTML, safely.

Your HTML

Size: —

How to use the HTML Minifier

  1. Paste the HTML you want to shrink.
  2. Choose whether to remove comments and collapse whitespace.
  3. Click Minify, then copy the result.

Features

Advertisement

Frequently Asked Questions

Common questions about the free online html minifier.

It removes comments and collapses whitespace between tags, reducing the size of the page without changing what the browser renders.
Whitespace can be significant inside script, style, pre and textarea elements, so the minifier copies those blocks verbatim.
In rare cases where spacing between inline elements matters, yes. Uncheck the whitespace option if your layout depends on it.
Yes, when the remove comments option is enabled. Conditional comments for very old browsers would also be removed.
Savings of 10 to 30 percent are typical, depending on comments and indentation.
No. Minification runs entirely in your browser, so nothing is uploaded to a server.
Yes. The tool is fully responsive and works in any modern browser on desktop, tablet and phone.
Yes, it is completely free with no account required.

Last updated: October 10, 2026