Minify HTML

Paste your HTML and get a minified version with whitespace and comments removed to reduce file size and speed up page loads. HTML is collapsed conservatively so rendering is unchanged.

The whole process is client-side — nothing is uploaded and there's no account — so you can minify assets privately and instantly.

Need another language or mode? See all formatters and minifiers.

Related tools

HTML Minifier — frequently asked questions

How do I minify HTML?
Paste your HTML into the left panel and the minified result appears on the right instantly. Copy it or download it as a file.
How is the HTML minified?
Comments are stripped and formatting whitespace is collapsed, while the contents of pre, textarea, script, and style are preserved exactly — a conservative minify that won't change how the page renders.
Is my code uploaded anywhere?
No. Formatting and minifying run entirely in your browser with JavaScript — your code never leaves your device. It's free with no sign-up; a single unobtrusive ad slot covers hosting.

Spotted a bug or have a suggestion?

Found something broken, have an idea, or just want to say thanks about any of our tools? Every message reaches a real person.