HTML Minifier
Minify HTML by stripping comments and the whitespace between tags. Smaller pages, faster loads. Free online HTML compressor, nothing uploaded.
Runs in your browser. Nothing is uploaded.
About HTML Minifier
HTML Minifier removes comments and the whitespace between tags, shrinking your markup without changing what the page shows. It's useful for email templates, embedded widgets and static pages you deploy by hand.
Whitespace inside text is collapsed to a single space rather than removed, so words never run together.
How to use HTML Minifier
- Type or paste your text into the input box. Press Sample to see an example.
- The result appears instantly as you type.
- Copy the result, or press Use as input to chain another transformation.
Frequently asked questions
Is it safe for <pre> blocks?
No. Whitespace inside <pre> and <textarea> matters, so keep those parts unminified.
Will it remove conditional comments?
Yes. All comments are removed, including old IE conditional comments.
Is HTML Minifier free and private?
Yes. HTML Minifier is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.