neatly done

HTML Minifier

Minify HTML online without breaking it. Comments and extra spaces go, but pre, textarea, script and style contents are copied exactly.

  • Free
  • No sign-up
  • Works on phone and computer

How to minify HTML

  1. Paste your HTML.
  2. Choose whether to remove comments.
  3. Copy the minified HTML and check the size saved.

About this tool

Make an HTML page smaller without changing how it looks. Comments and extra whitespace are removed. The text inside pre, textarea, script and style is copied exactly, and a single space between two inline tags such as bold and italic is kept, because it shows on the page. You see the size saved.

Common questions

Is it safe for code blocks?

Yes. Everything inside pre and textarea is left as written, so spacing and line breaks stay.

Does it touch my JavaScript and CSS?

No. The contents of script and style tags are copied exactly. Use the JavaScript or CSS minifier for those.

Are Internet Explorer comments kept?

Yes. Conditional comments are always kept, because they are instructions rather than notes.

Is it free to use?

Yes. There's no sign-up, and you can use it as often as you like.

Is my text uploaded anywhere?

No. This tool runs inside your browser, so what you enter stays on your device.

Do I need to install anything?

No. It works in your browser on a computer or a phone.

You've reached today's free limit