HTML Minifier
Minify HTML: remove comments and collapse whitespace while keeping pre, textarea and script blocks intact. Free and private: runs in your browser.
Paste HTML to shrink it and see how many characters you saved.
Runs entirely in your browser. Nothing you paste is uploaded or stored.
Use cases
- Clean up code or data before sharing it in a ticket or pull request.
- Make minified output readable while debugging.
- Shrink files before deploying.
Frequently asked questions
How much does minifying HTML help?
Typically 10–20% before compression. Gzip or Brotli on the server saves far more, so enable both.
Is the HTML Minifier free?
Yes. It is free with no sign-up, and it runs entirely in your browser, so your input is never uploaded or stored.
Will formatting change how my code behaves?
Formatting only changes whitespace and layout. Minifying removes comments and whitespace and may shorten names, so keep the original source in version control.
Related tools
Checking one snippet is a start. Scan your whole repository for free with CodeInspector.