HTML Minifier
Minify HTML by removing comments and collapsing whitespace.
HTML is full of whitespace and comments that help developers read it but do nothing for the browser — they just add bytes that slow the first paint. Minifying strips that formatting out, and for large pages the saving is real, especially over slow connections where every kilobyte delays rendering.
Paste HTML and this tool removes comments and collapses the whitespace between tags, showing the before-and-after size. It's a safe, quick optimization for static pages, email templates and generated markup. As with all minification, keep the readable source and minify at build or deploy time.
How to use HTML Minifier
- 1
Paste your HTML
A page, fragment or template.
- 2
Review the minified output
Comments and formatting whitespace removed.
- 3
Copy the result
The size saving is shown alongside.
Features
- Removes HTML comments
- Collapses inter-tag whitespace
- Shows before/after byte sizes
Frequently asked questions
Common mistakes to avoid
- Minifying pages with whitespace-sensitive elements (<pre>, inline-block layouts) without checking the result.
- Storing only the minified version — keep the readable source.
Get new tools in your inbox
One email a month with new tools, guides, and updates. No spam, unsubscribe anytime.

