HTML Minifier
Developer Tools
100% in-browser
Remove comments and collapse whitespace to compress your HTML.
How to use the HTML Minifier
- 1 Paste your HTML.
- 2 Comments and whitespace between tags are removed.
- 3 Copy the minified HTML.
About the HTML Minifier
Minifying HTML trims comments and the whitespace between elements to reduce page weight. This tool compresses your markup while preserving the content of pre, textarea, script and style blocks.
It runs entirely in your browser.
Frequently asked questions
Does it break pre or textarea content?
No — whitespace inside pre, textarea, script and style is preserved.
Can I un-minify it?
Yes, use the HTML Beautifier.