Developer tool

HTML Minifier

Remove safe whitespace and comments from HTML and compare byte savings.

Runs in your browser
HTML Minifierworks locally
Result — 21% smaller

How to use this HTML minifier

  1. Paste the source text or code, then choose the conversion or formatting mode.
  2. Review the minified output and file-size difference. Check syntax, escaping, and edge cases against the source before using the result in a live project.
  3. Check the output against the source, then copy or download the finished result.

About this HTML minifier

Use the HTML Minifier to remove safe whitespace and comments from HTML and compare byte savings. Change the inputs to compare another result.

You can also use it to check source text for structural or syntax problems.

Example

Paste a readable source file into the HTML Minifier, compare the before and after byte counts, then test the minified output in its normal environment.

Common uses

  • remove safe whitespace and comments from HTML and compare byte savings
  • check source text for structural or syntax problems
  • prepare a clean version for testing or reuse