Smaller HTML, same page
Every byte of HTML has to download before the browser can start rendering, so smaller pages appear faster. The minifier removes comments, collapses whitespace between tags, drops optional quotes and redundant boolean attribute values, and minifies inline `<style>` and `<script>` blocks, including JSON-LD structured data.
Content where whitespace matters — <pre>, <textarea> and preformatted code — is preserved. The results panel compares the original size with the minified size and the size after gzip, which is closer to what visitors actually download.
How to minify HTML
- 1
Paste your HTML
A full document or a fragment.
- 2
Minify
The compressed output appears instantly.
- 3
Check the savings
Raw and gzipped sizes, before and after.
- 4
Copy or download
Use it in your build or template.
Key features
Inline code minified
CSS, JavaScript and JSON-LD are compressed too.
Whitespace-safe
<pre> and <textarea> keep their formatting.
Gzip comparison
See the real transfer-size saving.
Private
Runs entirely in your browser.
Common uses
- Email templates: Stay under Gmail's 102 KB clipping limit.
- Static pages: Ship leaner landing pages without a build step.
- Performance tuning: Improve load time and Core Web Vitals.
Tips and good to know
- Minify stylesheets and scripts separately with the CSS Minifier and JS Minifier.
- Keep an unminified copy for editing; the HTML Formatter can re-indent minified HTML later.
