HTML Minifier
Minify HTML by stripping comments, collapsing whitespace and trimming blank lines to reduce file size. Fast and private, in your browser.
Conservative mode preserves text content and attribute values.
Styles too? CSS minifier · document in Markdown preview · escape entities: HTML entity encoder.
Smaller HTML, faster pages
Removing comments and redundant whitespace shrinks your HTML so it downloads and parses faster. Pair it with the CSS Minifier for an extra speed boost.
FAQ
What does it remove?
Conservative mode removes ordinary HTML comments and collapses whitespace-only nodes to one space. It leaves text and attribute values unchanged and protects pre, textarea, script, style, and template blocks.
Is the output safe to ship?
The default is deliberately conservative. Always test conditional comments and SVG because their whitespace behavior can depend on the target browser and document.
Does it upload my code?
No. Minification runs entirely in your browser.
Last updated: