Developer Tools
HTML Minifier
Minify HTML in your browser. Collapse whitespace, strip comments, drop attribute quotes, and shrink boolean attributes. Safe for inline script and style.
HTML minifier
Optimization options
Your HTML is minified entirely on your device. Nothing is uploaded.
How to use
- Paste your HTML into the input area, or click Load sample to try the minifier on a realistic page.
- Toggle the options on the right to enable or disable each transform. The output and the byte savings update in real time as you change settings.
- Watch the live stats: Original, Minified, Saved, and Reduction percentage. They reflect the exact bytes that will be in the copied output.
- Click Copy HTML to copy the minified result to your clipboard, or use Replace with minified to fold the output back into the input for follow-up edits.
About this tool
HTML Minifier compresses HTML source by collapsing runs of whitespace, removing comments, dropping safe attribute quotes, collapsing boolean attributes like disabled="disabled" to disabled, and stripping redundant default type values such as type="text/javascript" on script tags and type="text/css" on style and link tags. The tokenizer treats the bodies of script, style, pre, textarea, code, and noscript as opaque, so embedded JavaScript, CSS, preformatted output, and user-typed form values are never reformatted. Conditional comments like <!--[if lt IE 9]>...<![endif]--> and important comments that start with <!--! are kept by default, so legacy IE fallbacks and license headers survive. Every option is an independent toggle so you can run only the transforms you want, and a live byte counter shows the original size, minified size, bytes saved, and percentage reduction in real time. Useful for trimming production HTML, shrinking server-rendered pages, compressing transactional email templates, preparing snippets for inline injection, and tightening static-site exports before deployment. All work happens locally on your device. Pasted templates, marketing pages, and email content never leave your tab.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
HTML Formatter
Pretty-print and minify HTML with indent, wrap, and quote controls.
Open tool
DeveloperCSS Minifier
Compress CSS with comment, whitespace, hex, and zero-unit optimizations and a live byte-savings readout.
Open tool
DeveloperJSON Minifier
Compact JSON with live byte savings and a JS literal copy.
Open tool
DeveloperSVG Optimizer
Clean and minify SVG markup with editor-metadata removal, number rounding, and default-attribute stripping.
Open tool
DeveloperHTML Entity Encoder Decoder
Two-way HTML entity encoder and decoder with named, decimal, and hex modes.
Open tool