Meet Our New HTML Minifier

A page template can produce plenty of indentation, comments and repeated attribute syntax. How much could you remove without changing the page? Our new HTML minifier gives you a way to explore that question with your own markup. It is free, runs locally in your browser, and is available in English and French. Your HTML is processed on your device, without uploading it to a server.

See what a smaller version changes

Paste a snippet or open a local HTML file to compare the source and minified result side by side. The size comparison shows how many UTF-8 bytes you save, which makes it useful for checking a template before adding minification to a regular build.

Start with the Gentle preset, then try other settings when you know the page can support them. You can preserve comments that matter, adjust whitespace handling, or include embedded CSS and JavaScript. A smaller result is useful only if the text, layout and interactions still work: a space between words or an empty element used by a script may be essential.

Those byte savings are measured before gzip or Brotli. They help compare source files, but the reduction in transferred data will depend on your server’s compression too.

Keep a readable original

Copy or download the result when you are ready to test it in your site. Keep your original source for editing and compare representative pages before publishing. The minifier does not execute your HTML or load its external scripts and stylesheets.

Reducing source size also leaves security questions separate: minification does not make untrusted HTML safe. Our guide to HTML escaping and sanitizing explains which operation fits that task.

Try the HTML minifier with a page or the built-in example. The guide below the tool explains the option tradeoffs and how to judge whether the savings are worthwhile for your site.

Premium is coming soon

An optional premium subscription to remove ads is planned. Subscriptions are not available yet.

You can keep using our free tools without an account.