Free HTML Minifier
This HTML minifier strips comments and collapses whitespace to shrink pages before publishing, useful for landing pages, email templates and embeds. Paste markup, minify, and see exactly how many bytes were saved. Nothing is uploaded.
How it works
Comments are removed first, then whitespace between tags collapses and repeated spaces shrink. Content inside pre, textarea, script and style blocks is preserved untouched, since whitespace there can change meaning.
Example
| Before | After |
|---|---|
| 1,240 bytes with comments | 986 bytes minified (20% smaller) |
Frequently asked questions
Will minifying break my page?
The transforms used here are safe for normal markup. Always test the result, especially pages with inline scripts.
Why preserve pre and textarea?
Whitespace inside them is visible content, collapsing it would change what readers see.
Does minification help SEO?
Slightly faster pages help users; treat it as one small performance step among many.
Can I minify email templates?
Yes, and email HTML benefits most, but test in major clients before sending.
Is my code uploaded?
No. Minification happens locally in your browser.
Related tools
- CSS Minifier, shrink stylesheets too.
- Text Cleaner, tidy plain text.
- Link Extractor, audit links first.
