HTML Minifier
Shrink HTML by stripping comments and collapsing whitespace. See byte savings in real time.
HTML Minifier — Minifying HTML removes the comments, indentation, and excess whitespace that make source readable but inflate file size. For production builds, a few percent off every page adds up to faster loads and lower bandwidth costs.
All processing is local. Your HTML never leaves the browser.
What is html minifier?
Minifying HTML removes the comments, indentation, and excess whitespace that make source readable but inflate file size. For production builds, a few percent off every page adds up to faster loads and lower bandwidth costs.
Paste your HTML on the left, get the minified version on the right, and see the byte savings in real time. Toggle the "remove optional tags" option for an extra pass that drops redundant </li>, </p>, and similar closures that the browser will infer anyway.
How to use it
-
Paste your HTML
Drop a snippet, a partial, or a full document.
-
Pick options
Toggle "remove optional tags" if you want an extra squeeze.
-
Copy the minified HTML
Use the Copy button to grab the result.
Examples
Comment stripping
HTML comments are removed entirely.
Result: <!-- hidden --><p>hi</p> → <p>hi</p>
Whitespace collapse
Multiple spaces and newlines between tags become a single space.
Result: <p>hello world</p> → <p>hello world</p>
Frequently asked questions
Related tools
CSS Minifier
Shrink CSS by stripping comments, collapsing whitespace, and tightening punctuation. See byte savings live.
JavaScript Minifier
Quick JS minifier that strips comments and collapses whitespace. Best for trusted, simple code snippets.
Markdown to HTML Converter
Convert Markdown to clean HTML. Headings, lists, links, images, code blocks, blockquotes, and inline formatting.