← All tools

DEVELOPER TOOL

HTML Minifier

Reduce HTML file size by removing comments and collapsing ordinary whitespace.

Your minified HTML will appear here.

Minification runs in your browser. Ordinary comments are removed and text whitespace is collapsed; whitespace in preformatted content and script/style blocks is preserved. This is not a full HTML parser or validator.

This lightweight minifier is not a full HTML parser. It collapses whitespace in ordinary text, which may affect content styled with white-space rules; review the output before using it. JavaScript and CSS contents are preserved, not minified.

HTML is minified locally in your browser and is not uploaded.

How to use HTML Minifier

  1. Paste HTML into the input panel.
  2. Select Minify HTML to create a compact version.
  3. Copy the result or edit the input to start again.

Does the minifier remove all comments?

Ordinary comments are removed. Conditional comments and bang comments are preserved.

Does it change script, style, or preformatted content?

No. The content of script, style, pre, textarea, and title elements is left unchanged.

Is my HTML uploaded?

No. Minification runs locally in your browser.