Skip to content

HTML Minifier

Shrinks HTML by removing comments and extra whitespace, while leaving pre, textarea, script and style intact.

0 characters

What is HTML Minifier?

HTML written for people has indents, line breaks and comments. Browsers do not need them, so removing them makes the page smaller and faster to send.

What this tool does

Removes HTML comments, collapses runs of whitespace and removes spaces between tags. Blocks inside pre, textarea, script and style are kept exactly as written.

How to use it

  1. Paste your HTML.
  2. Read the minified HTML in the result box.
  3. Copy it into your page.

Did you know?

  • Whitespace between inline elements can matter for spacing, so check the page after you minify.
  • Conditional comments for old versions of Internet Explorer are kept.

More tools in this category