EN
PortuguêsEnglishEspañol
All tools
Developer tools 100% free

HTML minifier

Minify HTML by removing unnecessary comments, spaces and line breaks, keeping <pre>, <textarea>, scripts and styles intact, with the byte savings.

How to use

Thank you so much for helping!

Every donation helps pay for the servers and keeps the tools free for everyone. Pick or type an amount:

Secure payment by Stripe. Opens in a new tab.

Back to Format and convert

Paste the HTML to minify.

Available in: PortuguêsEspañolEnglish

Advertisement

HTML minifier: what it is for

Paste HTML to remove unnecessary comments and spaces and make the page lighter. The contents of pre, textarea, script and style are preserved, and the tool shows the size before and after.

The code isn't sent to any server: the conversion happens in your browser.

How to use

  1. Paste the HTML.
  2. Choose what to remove.
  3. Copy the minified HTML.

When to use it

  • Making pages and HTML emails lighter.
  • Reducing template size.
  • Preparing HTML to embed in another system.

Frequently asked questions

Can minification break the page?

The contents of <pre>, <textarea>, <script> and <style> are preserved, and one space is kept between text elements. Still, check the page afterwards, especially if the layout depends on spaces between inline elements.

How much smaller does the page get?

It depends on the code. Well-indented HTML with lots of comments usually shrinks by 10% to 30%. The tool shows the exact savings.

Similar tools

The tools are provided as is, without warranty. We are not responsible for the results or for how they are used.