HTML Minifier
Paste HTML and get it back without the whitespace nobody sees. The counter under the box shows how much you saved.
The code never leaves this page: formatting happens in your browser.
- Free
- Files never leave your device
- No sign-up
- No file limit
How to use
- Paste the HTML into the first box — it is minified as you type.
- Check the size figures under the input.
- Copy the result, or press «Format» to expand it again.
Good to know
What is removed and what is not
Line breaks between tags, runs of spaces and ordinary comments go. Conditional comments stay, because they carry markup for old browsers. Everything inside pre, textarea, script and style is carried over untouched — a line break there is content, not formatting.
How much this is really worth
On a typical page minification saves ten to twenty percent before compression, and much less after it, because gzip already handles repeated whitespace well. It is worth doing at build time and worth forgetting about during development, where readable markup costs nothing and saves hours.
Frequently asked questions
Will the page still look the same?
Yes, with one caveat: a space between inline elements is visible in the rendered page. Whitespace between tags is collapsed to a single space rather than deleted, so layout does not shift.
Is my code sent anywhere?
No. The whole thing happens on the page, so unreleased templates stay with you.
Does it minify the CSS and JavaScript inside?
No. Those blocks are copied as they are. Use the CSS minifier for stylesheets — mangling script from a markup tool is how subtle bugs get introduced.
Can I undo it?
Press «Format» and the markup is laid out again with indentation. The original line breaks are gone, but the structure comes back.
Related tools
- HTML Formatter Paste HTML and read it. Each tag goes on its own line with the indentation its nesting deserves…
- CSS Minifier Paste a stylesheet and get it back compressed. The counter under the box shows the size before…
- JSON Minify Paste JSON and get it back without a single wasted byte: no indentation, no line breaks, same d…
- JSON Formatter and Validator Paste JSON and get it formatted, validated or minified. The data stays in your browser — nothin…
- Base64 Encode and Decode Paste text to get Base64, or paste Base64 to get the text back. Cyrillic, Chinese and emoji all…
- Word Counter Type or paste your text and the counters update instantly — words, characters, sentences, parag…
- Case Converter Paste text, pick a case, get the result. Nine ways of writing the same words: the four everyday…
- CSV to JSON Paste a table, get JSON. The parser follows RFC 4180, so a cell like «Doe, John» stays one fiel…