HandyBench

HTML Minifier

Strip whitespace and comments from HTML.

How to use the HTML Minifier

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

Frequently asked questions

Will minifying break my HTML?

Safe minification only removes redundant whitespace and comments. It preserves content inside <pre>, <textarea> and <script> blocks.

How much smaller will my HTML get?

It depends on how much whitespace and commenting your markup has — typically a 10–30% reduction. Combined with gzip or Brotli compression on the server, the savings add up to faster page loads.

Should I keep an unminified copy?

Yes. Minified HTML is hard to edit, so keep your readable source and minify as a build step or before deploying.