HTML Minifier

Minify or beautify HTML code by removing comments, whitespace, and formatting. Free online tool, no upload needed.

Preparing private browser tool…

Your file will stay on this device.

Frequently asked questions

How much size reduction can I expect?
Typical HTML minification saves 10 to 30 percent of file size, depending on how much whitespace and commenting the source contains. Well-formatted pretty-printed HTML usually compresses the most.
Will minification break pre or code blocks?
No. This tool preserves the contents of pre, code, textarea, script, and style tags exactly as written, so code samples and formatted text remain intact.
Should I minify HTML if my server uses gzip?
Gzip already reduces transfer size significantly, but minification still helps parse time and initial render. For production sites combining both is the best practice.