HTML Minifier

Works fully offline Developer

Paste readable, indented HTML and get back a compacted version with comments removed and whitespace collapsed, without touching the page's structure.

0 characters

    

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

Input
<div>
  <!-- comment -->
  <p>Hello</p>
</div>
Output
<div><p>Hello</p></div>

How It Works

  1. Paste your HTML into the input box.
  2. 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.