HTML Minifier

Reduce HTML size by removing comments and unnecessary whitespace, optionally minifying inline CSS and JavaScript.

Runs in your browser. Your input is processed on your device and is not uploaded to our server.

How to use the HTML Minifier

  1. Paste your code or open a file.
  2. Choose the options and click Minify.
  3. Check the result and the size change, then copy or download it.

The minifier collapses whitespace runs, removes whitespace between block-level tags and strips comments (conditional comments are kept). <pre> and <textarea> content is never changed. Inline styles and scripts can be minified with the conservative CSS and JavaScript minifiers. Always test the minified page; whitespace between inline elements is preserved as a single space.

Frequently asked questions

How much will it save?
Typically 10–25% for hand-written HTML. Enable gzip or Brotli compression on your server for much larger savings.