Remove whitespace, comments, and blank lines from HTML to reduce file size for production.
Web developers reducing HTML payload size before deploying to production servers.
Paste your HTML
Copy your HTML markup and paste it into the editor.
Click Minify
Whitespace, blank lines, and comments are stripped instantly to produce compact markup.
Copy the minified HTML
Copy the output into your production build, template, or CDN upload.
The HTML you write is full of things that help you and mean nothing to a browser: indentation, blank lines between sections, and comments explaining the markup. The browser downloads every one of those bytes anyway. On a high-traffic page or an email template sent thousands of times, that wasted weight adds up — slowing the first byte and the render, and costing bandwidth. This minifier strips the readability overhead — collapsing whitespace and removing comments and blank lines — to produce the smallest functional HTML, typically 10–30% lighter. Paste your markup, click minify, and copy the output for your production build, template, or CDN. It runs entirely in your browser, so your markup never leaves your device. It works at the HTML level only, leaving inline scripts and styles alone, and it preserves IE conditional comments so legacy targeting still works.
Web performance
Shrink templates and static pages to cut payload size and improve load times.
Build pipelines
Pre-minify HTML partials before deploying to a server or CDN.
Email templates
Reduce HTML email size, which can help with size limits and deliverability.
Embeds & snippets
Compact a widget or ad snippet so it adds as little weight as possible to host pages.
Bandwidth savings
Lower transfer costs on pages served at high volume.
No. Minification runs entirely in your browser, so your markup never leaves your device.
Typically 10–30% for standard HTML, and more if your source has heavy commenting or lots of whitespace.
Yes. Conditional comments (<!--[if IE]>…<![endif]-->) are kept; all other HTML comments are removed.
No. Only HTML-level whitespace and comments are removed; inline scripts and styles are left untouched.
No. Rendered output is identical — be aware that whitespace between some inline elements is meaningful, so review spacing-sensitive layouts.
Yes. Edit the readable source and minify as a final step; minified HTML is hard to maintain by hand.
Use the CSS Minifier for stylesheets. This tool focuses on HTML markup.
Yes — minify as much HTML as you want for free, with no sign-up.