Skip to content
My Tiny Utils

Search tools

Type to find a tool, then press Enter to open it.

HTML Minifier

Shrink HTML by collapsing whitespace and stripping comments, while leaving pre, textarea, script, and style content untouched.

Processed locally in your browser — nothing is uploaded.

0 characters

Minified HTML

Output appears here…

About HTML Minifier

A deliberately conservative minifier: whitespace runs collapse to a single space, comments disappear, and everything else stays as you wrote it. Tags, attributes, and quotes are never removed, so the result renders identically to the original.

Content inside pre, textarea, script, and style is copied verbatim, because whitespace there is meaningful. Conditional comments are kept too — they carry logic, not documentation.

Common uses

  • Trim an email template before pasting it into a sending platform
  • Shrink a static page or fragment that has no build step
  • See how much of a page's weight is indentation and comments

Example

Input

<div>
  <p>Hello   world</p>
  <!-- note -->
</div>

Output

<div> <p>Hello world</p> </div>

Limitations

  • Whitespace and comments only — attributes, quotes, and optional closing tags are left alone by design
  • A single space is kept between elements because removing it can change inline layout