← All tools/Minifiers/Code/HTML Minifier

HTML Minifier

Smaller HTML, in your browser — paste HTML in, minified HTML out, with bytes saved.

Paste HTML here. It is minified as you type, in your browser.

Size saved

—

How it works

Minified = comments removed, whitespace collapsed,
spaces between > and < removed, spaces at the
start and end of text removed

Worked example: the sample minifies to <div class="card"><h2>Hello</h2><p>Welcome to WhiteUI.</p></div> — the comment is gone, the line breaks between tags are gone, and the spaces around “Hello” are gone, because they add nothing inside a heading.

Frequently asked questions

Is my HTML sent anywhere?

No. Everything runs in your browser. Nothing is uploaded, stored or logged.

Will minifying break my layout?

Not for ordinary HTML. Only comments and whitespace that browsers ignore are removed; the words on the page keep their single spaces, so sentences read exactly as before.

What about spaces inside
 or 

We’ll only use your name and email to reply if needed. The tool and page are filled in for you.