HTML Minifier

Reduce HTML size by removing comments and unneeded whitespace between tags.

How to use HTML Minifier

  1. Paste your HTML.
  2. Copy or download the minified HTML.

Supported features and limitations

Conservative: whitespace inside <pre>, <textarea>, <script> and <style> is untouched, and conditional comments are kept. Collapsing whitespace can slightly change how inline elements are spaced.

Privacy

Everything you type is processed locally in your browser and is not sent to our servers. No account is needed and there is no watermark.

Frequently asked questions

Is the minified HTML identical in the browser?

Usually, but check pages that depend on whitespace between inline elements.

Does it minify inline JavaScript?

No, scripts and styles are left as they are.

Related tools

More Developer & Webmaster Tools · All free tools