HTML Minifier
Paste readable, indented HTML and get back a compacted version with comments removed and whitespace collapsed, without touching the page's structure.
Overview
Hand-written or templated HTML usually carries indentation and comments that are useful during development but add nothing once the page ships. This tool strips both, shrinking the file for a quick check or a one-off page, without a build tool or bundler in the loop.
Examples & Sample Data
Collapsing whitespace and removing comments
<div> <!-- comment --> <p>Hello</p> </div>
<div><p>Hello</p></div>
How It Works
- Paste your HTML into the input box.
- Click Minify to get a compacted version, ready to copy.
Frequently Asked Questions
No. Minification runs entirely in your browser.
No — minification only removes whitespace and comments that don't affect rendering. It doesn't change the page's structure or content.
No. This tool only compacts the HTML markup itself — style and script blocks are left as-is. Use the CSS Minifier or a dedicated JS minifier for those separately.
Related Tools
Explore more high-performance utilities.