99+ Free Tools
← Back to all tools

HTML Minifier

Shrink a page's HTML without changing how it renders. Nothing is uploaded or stored.

A web page code on a monitor
Minification is syntactic — it does not change the page structure or remove unused code.

Minify

Paste HTML first.

Result

Before—
After—
Saved—

Preview — the minified page rendered

If the preview looks the same as the original page, the minification is safe.

How the minifier works

Removed. Comments, and whitespace between tags where it cannot change the text — a space between two inline elements (a and b) is kept.

Never touched. Everything inside <pre>, <textarea>, <script> and <style> is byte-identical.

Optional. Attribute quotes are stripped only when the value has no spaces or special characters and does not end in /. Optional closing tags are only removed where the HTML rules allow it.

Local only. All work happens in your browser. Nothing is uploaded, stored or shared.