HTML Minifier

Paste HTML and click "Minify" to strip comments and extra whitespace before deployment.

Input code
Result

Use cases

  • Reducing page size before publishing
  • Preparing HTML templates for email newsletters
  • Compressing markup embedded in JS/PHP strings

FAQ

Is it safe to minify HTML containing script/style?

The content of script and style tags is left untouched — only the surrounding HTML markup is minified.

Can I turn it back into readable markup afterwards?

Yes, use the HTML Formatter — it will re-add indentation.

Related tools