HTML Minifier
Minify HTML by removing comments, collapsing whitespace, removing empty attributes, and optional closing tags. See size savings instantly.
What is HTML Minification?
HTML minification strips every byte from a markup document that doesn't affect how the browser renders it: comments, indentation, whitespace between tags, default attribute values, optional closing tags, and empty attributes. The output is byte-identical in behavior — the browser's parser treats minified and pretty-printed HTML the same way — but typically 10–25% smaller before gzip. Combined with brotli or gzip, you get another 5–15% reduction because compression is more efficient on already-compact text. HTML is the first byte the browser parses, so trimming it directly improves Time to First Byte and First Contentful Paint, especially on mobile networks. This minifier handles the full pass in your browser — paste markup, hit minify, copy the result. Pair it with the CSS Minifier and JavaScript Minifier for a full production build.
Input HTML
Minified Output
Original Size
0bytes
Minified Size
0bytes
Savings
0.0%
Options
Remove Comments
Collapse Whitespace
Remove Empty Attributes
Remove Optional Tags
Remove Quotes
How to use this tool
- 1Paste your HTMLDrop a full document or fragment into the input editor. The minifier handles HTML5 syntax including SVG and inline scripts.
- 2Click MinifyThe output editor shows the compressed HTML instantly, along with original size, minified size, and percentage saved.
- 3Copy or downloadUse the Copy button to grab the minified output for your build pipeline, or Download to save as a .html file.
