HTML Minifier

Minify HTML online — remove comments, collapse whitespace, and shrink your markup for faster page loads. See exactly how many bytes you save.

100% in your browser — your code never leaves this tab. No sign-up, no limits.

HTML Minifier

HTML Input

Paste HTML, drop a file, or

Minified Output
Output updates live as you type

HTML Minifier — Frequently Asked Questions

Minifying targets the bytes a browser does not need: the newlines and indentation between tags, runs of spaces that collapse to one anyway, and — when you enable it — comments, including conditional comments left behind by old editors.

The two tools undo each other. Beautify adds whitespace so people can read the markup; minify removes it so browsers download less. A normal workflow keeps a readable source file in version control and minifies on the way out to production.

It depends entirely on how much whitespace and commentary the original contains. Hand-written, deeply indented markup often drops 20 to 50 percent. Already-compact output from a build tool may barely change. The status bar shows the exact figure for your document.

Yes. Minifying only removes whitespace that carries no meaning between tags, plus comments if you ask for it. Browsers parse the result identically — the page renders exactly the same.

Whitespace-sensitive elements are left alone, so the contents of <pre> and <textarea> survive untouched. Single spaces between inline elements are also preserved, because removing them would visibly join words together.

For anything you deploy repeatedly, minify in your build pipeline so it happens automatically. This tool is for one-off jobs: checking what a page would compress to, shrinking a snippet for an email template, or compressing markup you were handed as a file.

It reduces the bytes on the wire, though gzip and Brotli already compress repeated whitespace efficiently, so the gain after transport compression is smaller than the raw number suggests. It is still worth doing, and it costs nothing.

Customer Reviews

0 out of 5 stars

Based on 0 reviews

Review data

5 star reviews

0%

4 star reviews

0%

3 star reviews

0%

2 star reviews

0%

1 star reviews

0%

Share your thoughts

If you've used this tool, share your thoughts with other users

Recent reviews

Latest Articles

Tips, guides, and insights from our blog