107 · Developer Tools

HTML Minifier

Paste HTML to remove comments and unnecessary whitespace and make the page smaller.

HTML Minifier

How to use the html minifier

  1. Paste your HTML.
  2. Choose whether to minify inline CSS.
  3. Copy the minified HTML.

Safe minification

Whitespace next to block elements such as <div> or <p> never shows on screen, so it’s removed. Between inline elements like links, a single space is kept so words don’t run together. Conditional comments for old Internet Explorer are kept.

Examples

151 bytes with comments and indentation

116 bytes

<a>One</a> <a>Two</a>

<a>One</a> <a>Two</a>

Questions

Does it minify JavaScript too?

Script contents are kept as they are. Use the <a href="/tools/javascript-minifier/">JavaScript minifier</a> for scripts.

Is my data uploaded?

No. Everything runs in your browser, so what you paste never leaves your device.