Skip to content
MixTool

HTML minifier

Strip comments and whitespace from HTML and shrink inline CSS and JavaScript — and see exactly how much you saved.

  • Runs entirely in your browser
  • Free · no sign-up
  • Works on phone and desktop
Loading tool…

Smaller HTML, same page

Every byte of HTML has to download before the browser can start rendering, so smaller pages appear faster. The minifier removes comments, collapses whitespace between tags, drops optional quotes and redundant boolean attribute values, and minifies inline `<style>` and `<script>` blocks, including JSON-LD structured data.

Content where whitespace matters — <pre>, <textarea> and preformatted code — is preserved. The results panel compares the original size with the minified size and the size after gzip, which is closer to what visitors actually download.

How to minify HTML

  1. 1

    Paste your HTML

    A full document or a fragment.

  2. 2

    Minify

    The compressed output appears instantly.

  3. 3

    Check the savings

    Raw and gzipped sizes, before and after.

  4. 4

    Copy or download

    Use it in your build or template.

Key features

  • Inline code minified

    CSS, JavaScript and JSON-LD are compressed too.

  • Whitespace-safe

    <pre> and <textarea> keep their formatting.

  • Gzip comparison

    See the real transfer-size saving.

  • Private

    Runs entirely in your browser.

Common uses

  • Email templates: Stay under Gmail's 102 KB clipping limit.
  • Static pages: Ship leaner landing pages without a build step.
  • Performance tuning: Improve load time and Core Web Vitals.

Tips and good to know

Frequently asked questions

Will minifying break my page?

It shouldn't. Only whitespace, comments and redundant syntax are removed, and whitespace-sensitive elements are preserved. Test important pages after minifying, as with any build step.

How much smaller will my HTML be?

Typically 10–30%, more for heavily commented or indented templates. Gzip shrinks both versions, so the transfer saving is smaller but still real.

Are conditional comments kept?

Regular comments are removed. If you rely on special comments, keep them in the original and minify only the rest.