HTML Minifier Online — Compress HTML Markup
Minify HTML online by removing ordinary comments and whitespace between tags locally in your browser.
About this tool
This lightweight HTML minifier removes non-conditional comments, collapses whitespace between tags and reduces repeated spaces. It does not parse or execute markup.
How to use
- Paste HTML markup.
- Run the minifier.
- Test the compact output in its destination.
Features
- Removes ordinary HTML comments.
- Collapses inter-tag whitespace.
- Preserves conditional-comment patterns.
Common use cases
- Compact a static snippet.
- Reduce embedded template markup.
- Inspect size changes during development.
Common issues and tips
- Whitespace can be meaningful in preformatted or inline content.
- This text-based tool is not a full production minifier.
Privacy
HTML minification runs locally. Markup is not uploaded.
Frequently asked questions
Are comments removed?
Ordinary comments are removed, while conditional-comment patterns are retained.
Can whitespace changes affect layout?
Yes. Test content where spaces are visually meaningful.
Does it execute scripts?
No. Input is treated as text.