Smaller payloads, faster first paint
Removing indentation and line breaks typically cuts a hand-written template by a third or more before compression, which matters most on large pages and slow connections.
Strip whitespace and comments from HTML to shrink the file.
Loading tool…
The tool is loading its code on your device. This happens once and is cached for later visits.
Processed entirely on your device
Overview
Minify HTML online — remove indentation, line breaks and comments to cut transfer size, and see the exact byte saving. Everything runs in your browser, nothing is uploaded.
Minification is the last step before HTML meets the network: same document, fewer bytes. It sits at the end of a build for the same reason compilation does — the human-readable source is for people, and the shippable artefact is for machines.
Whitespace between tags is the main target: the indentation, the newlines between elements and the runs of spaces that make source readable. HTML comments are dropped too, since they are never rendered. None of this changes what the browser paints, because the rendering engine already collapses inter-element whitespace to a single space.
Whitespace is content in a few places, and removing it there is a real bug:
A minifier that does not understand these contexts will quietly reflow code samples and preformatted blocks. This one leaves them intact.
If your HTML travels over HTTPS with gzip or Brotli enabled — and it almost certainly does — minification saves less than the raw byte count suggests. Indentation is repetitive, and repetition is exactly what those algorithms compress best. The two together usually beat either alone, but the marginal gain from minifying on top of compression is smaller than the character count implies.
It still matters when the markup is stored uncompressed, embedded in a length-limited field, served over a protocol that cannot compress, or delivered at a volume where a few percent of bandwidth is worth capturing.
The right place for this is a build step that reads your formatted source and writes a compressed artefact. Doing it by hand in an editor means the next person cannot read the file they have to maintain. Keep source pretty, ship it small.
Step by step
Paste the formatted HTML you want to compress.
Press Minify HTML; comments and insignificant whitespace are removed.
Compare the input and output byte counts to see the saving.
Copy the minified markup or download it as an .html file.
Why use it
What this tool is good for, and what it deliberately does not try to do.
Removing indentation and line breaks typically cuts a hand-written template by a third or more before compression, which matters most on large pages and slow connections.
Only whitespace the browser would collapse anyway is removed, and sensitive contexts such as pre and textarea are left intact so the page still looks identical.
Reports the character count before and after so you can judge whether minification is worth it for a given document.
Unpublished markup and tracking snippets never leave your machine — the minifier is pure client-side JavaScript.
Questions
Short, honest answers about quality, limits and privacy.