HTML Minifier

Paste HTML to get a compact version and see how many bytes you save.

Runs in your browser — nothing is uploaded

Minified HTML

How to use HTML Minifier

  1. Paste HTML or open a file.
  2. Choose whether to minify inline CSS and JS, and keep comments.
  3. Copy the minified HTML.

Formula & assumptions

  • Runs entirely in your browser — your code is never uploaded.

Questions

Is it safe for every page?

Whitespace is collapsed, not removed between inline elements, and <pre>/<textarea> content is untouched, so rendering stays the same.

Should I minify by hand?

For a one-off page, yes. For a website, build tools or server compression (gzip/brotli) usually save more automatically.

Are comments removed?

Yes, except conditional comments and ones starting with “!”. You can keep all comments with the option.