Skip to content

HTML Minifier

Shrink HTML by collapsing whitespace and comments.

Options

Private by design. This tool runs entirely in your browser. Your input is processed on your own device and is not uploaded by DO101.

About the HTML Minifier

Removes comments and collapses whitespace between tags, while protecting the contents of pre, textarea, script and style blocks where whitespace is significant.

How to use it

  1. 1Paste your HTML.
  2. 2Choose whether to strip comments.
  3. 3Copy the minified output.

What you get

  • Protects pre, textarea, script and style content
  • Optional comment removal
  • Keeps conditional comments intact
  • Before and after sizes
  • Runs in your browser

Frequently asked questions

Will minifying break my layout?

Whitespace between inline elements can be meaningful, so check the result if your layout depends on it. Block-level markup is safe.

Are conditional comments preserved?

Yes. Comments beginning with <!--[if are left alone.

People who use this tool usually reach for these next.