HTML Minifier

Remove comments and extra whitespace from HTML to reduce file size.

Paste HTML to strip comments and collapse unnecessary whitespace between tags, while leaving the content inside script, style, and pre blocks untouched.

Your files and text are processed locally in your browser — nothing is uploaded to a server.

HTML Minifier tool

How to Use HTML Minifier

  1. Paste your HTML.
  2. Click Minify.
  3. Copy the compacted markup.

Features

  • Strips HTML comments
  • Collapses whitespace between tags
  • Protects script, style, and pre content
  • Shows size reduction

Frequently Asked Questions

Will this break my inline JavaScript or CSS?

No, content inside <script>, <style>, and <pre> tags is left untouched.