Compress HTML by stripping whitespace, comments, and redundant markup - free, no signup required.
Input HTML
Minified Output
Original: 0 BMinified: 0 BSaved: 0.0%
HTML Full Form
HTML stands for HyperText Markup Language - the standard markup language used to structure content on the web.
HTML source is written for humans to read and edit, so it's full of indentation, line breaks, and comments - all discarded by the browser at render time. Minifying HTML strips these away to produce the smallest valid document that renders identically.
What this tool does
Strip comments - Removes HTML comments (IE conditional comments are preserved).
Collapse whitespace - Removes indentation, newlines, and redundant spaces between tags.
Inline CSS & JS minify - style blocks are CSS-minified and script blocks are JS-minified automatically.
Byte savings - See original vs minified byte counts and percentage saved.
Privacy
Everything runs locally in your browser. Your HTML is never sent to our servers, not even for analytics.
Frequently Asked Questions
Will minifying break my HTML?
For 99% of documents, no. The minifier preserves pre, textarea, script, and style contents verbatim, keeps IE conditional comments, and keeps CDATA sections. Whitespace between inline tags is collapsed, so if you rely on it for spacing, use an nbsp or CSS margin.
Does it minify inline CSS and JavaScript?
Yes. Style blocks are passed through the CSS minifier and script blocks through the JS minifier before being re-embedded. Script tags with non-JS types (like application/json) are left untouched.
How much can I realistically save?
Hand-authored HTML shrinks by 20-40%; build-tool-generated HTML by 5-15%. After gzip the saving is smaller but still real - minification removes tokens the compressor still has to encode.
Is my HTML uploaded anywhere?
No. All minification runs inside your browser using client-side JavaScript. Nothing is sent to our servers, nothing is logged, and nothing is cached anywhere except your own browser tab.
Can I reverse the minification?
Click Beautify to pretty-print any HTML with indentation. Original comments are not recoverable, but document structure is fully restored and readable again.
Should I minify before or after templating?
After. Minifying template source before variable interpolation can mangle template syntax (Jinja, Liquid). Do interpolation first, then minify the rendered output as part of your build step.