How to minify HTML online

Paste HTML markup — get minified output with comments and whitespace removed.

Minified HTML ships faster and uses less bandwidth. The HTML Minifier strips comments and collapses whitespace while preserving tag structure — all in your browser.

Try it — paste HTML to minify

How it works

  1. Paste HTML — full page or fragment.
  2. Minified output — updates as you type.
  3. Copy — compressed markup ready to deploy.

What gets removed

HTML comments, inter-tag whitespace, and line breaks collapse. Content inside pre and textarea may need manual review.

Beautify instead

For readable markup, use the HTML Beautifier.