Free HTML Minifier

This HTML minifier strips comments and collapses whitespace to shrink pages before publishing, useful for landing pages, email templates and embeds. Paste markup, minify, and see exactly how many bytes were saved. Nothing is uploaded.

How it works

Comments are removed first, then whitespace between tags collapses and repeated spaces shrink. Content inside pre, textarea, script and style blocks is preserved untouched, since whitespace there can change meaning.

Example

BeforeAfter
1,240 bytes with comments986 bytes minified (20% smaller)

Frequently asked questions

Will minifying break my page?

The transforms used here are safe for normal markup. Always test the result, especially pages with inline scripts.

Why preserve pre and textarea?

Whitespace inside them is visible content, collapsing it would change what readers see.

Does minification help SEO?

Slightly faster pages help users; treat it as one small performance step among many.

Can I minify email templates?

Yes, and email HTML benefits most, but test in major clients before sending.

Is my code uploaded?

No. Minification happens locally in your browser.

Disclaimer: The information provided on SEO Solve is for educational and informational purposes only. Results are calculated from the values entered and should be verified before use in published material.

Related tools