HTML Minifier
Shrink your HTML by collapsing whitespace — a smaller page is a faster page.
About this tool
Every byte of indentation in your HTML travels to each visitor. This minifier collapses runs of whitespace into single spaces and drops whitespace-only text nodes between tags, which typically saves 10–30% of page weight without touching the rendering.
How to use it
- Paste your HTML, or click Sample.
- Click Minify HTML and copy the result into your template or page.
Good to know
- HTML comments are preserved — remove them separately if you do not need them.
- Whitespace inside
<pre>blocks is collapsed too, so skip minification for pages that depend on pre-formatted text. - In modern setups, minifying in your build pipeline (or letting your CDN do it) is even more convenient — this tool is perfect for one-off pages and emails.