HTML Minifier
Shrink HTML markup.
Loading tool…
About HTML Minifier
Paste your HTML and this tool shrinks it by stripping comments and collapsing the insignificant whitespace between tags. It safely preserves the exact contents of your pre, textarea, script, and style blocks, and keeps IE conditional comments intact so nothing breaks. You instantly see the original size, minified size, bytes saved, and percentage reduced.
It is completely free with no sign-up, no limits, and no watermarks. Everything runs entirely in your browser using plain JavaScript, so your markup is never uploaded to a server. Just paste, review the savings, and copy the minified HTML with one click.
Frequently asked questions
- Is the HTML minifier free to use?
- Yes. It is completely free with no account, no sign-up, and no usage limits. You can minify as much HTML as you want, as often as you like.
- Is my HTML uploaded to a server?
- No. All minification happens locally in your browser using JavaScript. Your HTML never leaves your device and is never sent, stored, or logged anywhere.
- What does this minifier actually do?
- It removes HTML comments and collapses insignificant whitespace between tags to reduce file size. It reports your original size, minified size, bytes saved, and the percentage reduction.
- Will it break my page's formatting or scripts?
- It is a safe basic minifier. It preserves the exact contents of pre, textarea, script, and style elements, and it keeps IE conditional comments, so whitespace-sensitive and executable content stays intact.
- Why is there still some whitespace in the output?
- To stay safe, the tool keeps a single space where whitespace could be significant (such as between inline elements and around preserved blocks) rather than deleting it. This is a conservative minifier, not an aggressive one.
- How is the size saving calculated?
- Sizes are measured in real UTF-8 bytes, not just character counts. Bytes saved is original minus minified, and the percentage is that saving divided by the original size.