HTML Minifier
Shrink HTML without breaking it.
Loading tool…
How to use HTML Minifier
Paste your HTML, or drop an .html file into the editor.
Click Minify — comments go and whitespace between tags is collapsed.
Copy the minified markup or download the smaller file.
Frequently Asked Questions
Will my inline scripts and styles survive?
Yes. The contents of script, style, pre and textarea elements are protected and copied through byte for byte, so formatting-sensitive blocks stay intact.
Are conditional comments removed?
Regular comments are stripped, but conditional comments for old Internet Explorer are preserved, because removing them would change how those browsers render the page.
Should I minify by hand?
For a build pipeline, use a bundler. This tool is for the cases in between: an email template, a landing page or a snippet you need small right now.
Related tools
Looking for something else? Browse all developer tools.