HTML Minifier

Safely remove comments and extra whitespace between tags to shrink your HTML.

Runs in your browser Free
Processed locally in your browser.

Lighter HTML, faster pages

Comments, indentation and line breaks added during development increase the size of HTML files. The HTML Minifier removes them to reduce the data sent to the browser and help pages load faster.

Safe minification

  • HTML comments are removed
  • Extra whitespace between tags is collapsed
  • The contents of script, style, pre and textarea blocks are left untouched

Your code, code samples and form content stay intact. Use the CSS and JavaScript minifiers for inline styles and scripts. Processing happens in your browser.

How to use HTML Minifier

  1. Paste your HTML code.
  2. The minified output appears instantly.
  3. Check how much size was saved.
  4. Copy the result.

Why use this tool?

Minify static pages, email templates and HTML snippets without a build tool.

FAQ

Does it break inline scripts?

No. Script and style contents are kept as they are; use the CSS and JavaScript minifiers for those.

Are IE conditional comments kept?

All HTML comments are removed; add old IE conditional comments back by hand if you need them.

Does minifying affect SEO?

Visible content doesn't change; a smaller page contributes positively to speed metrics.

Related tools