HTML Minifier
Minify HTML to shrink page weight.
Runs entirely in your browser — your input never leaves your deviceAbout this tool
This minifier removes HTML comments and collapses redundant whitespace to shrink page weight, while carefully preserving the contents ofpre,textarea,script andstyle blocks where whitespace is significant.
The size report shows your saving. Everything runs locally in your browser.
Why use it
Whitespace-safe
Preserves pre, textarea, script and style where spacing matters.
Size report
Shows exactly how many bytes you saved.
Local
Minification runs in your browser.
Common use cases
- Shrink a page's HTML
- Minify an email template
- Reduce a static fragment's size
- Strip comments before publishing
Frequently asked questions
Will it break my page?
It preserves the contents of pre, textarea, script and style, where whitespace matters, and removes only comments and collapsible whitespace elsewhere — safe for typical markup.
Does it keep conditional comments?
Yes. Internet Explorer conditional comments (<!--[if ...]>) are preserved; ordinary comments are removed.
Is my HTML uploaded?
No. Minification runs entirely in your browser.
Why minify HTML?
Smaller HTML downloads faster and improves time-to-first-byte and overall page weight, especially on large pages.