DevKits

Gzip Size Calculator — Check Compressed Size & Ratio Online

Paste text or code to see its gzip (and raw) size instantly, plus the compression ratio and bytes saved. Uses the browser's native CompressionStream — great for estimating how small a JS/CSS/JSON asset will ship over the wire. 100% local.

Last updated:

Comments

Paste text, code, or JSON to see its raw and gzipped byte size instantly, plus the compression ratio and bytes saved. Uses the browser's native gzip — nothing is uploaded.

What is Gzip Size?

When a server sends a text asset — JavaScript, CSS, HTML, JSON, or SVG — it's almost always gzip- or Brotli-compressed first, so the number your users actually download is the compressed size, not the raw file size. This calculator compresses your input with the browser's native CompressionStream('gzip') API and reports raw bytes, gzipped bytes, the ratio, and how many bytes you saved. That makes it a quick way to set a performance budget, compare two implementations of the same component, or sanity-check why a 'small' JSON payload is still slow (highly repetitive text compresses far better than dense, high-entropy data). The result is a faithful gzip estimate at the default level; a CDN using Brotli will usually shave off another 10–20%.

How to check gzip size

  1. 1Paste the text, code, or JSON you want to measure.
  2. 2Read the raw size, gzipped size, ratio, and bytes saved.
  3. 3Compare alternatives by editing the input and watching the compressed number change.

Tips & Best Practices

  • ▸Repetitive text (lots of repeated keys/whitespace) compresses dramatically better than random or already-compressed data.
  • ▸Minify first, then gzip — minification and compression stack.
  • ▸Brotli is typically 10–20% smaller than gzip; treat this as a reliable gzip ballpark, not a byte-exact Brotli figure.

Frequently Asked Questions

Why is gzip size what matters for web performance?

Servers and CDNs almost always serve text assets (JS, CSS, HTML, JSON, SVG) compressed with gzip or Brotli. The transfer size users actually download is the compressed size — not the raw file size — so gzip size is the number to optimize and budget against.

How is the gzip size computed in the browser?

It uses the native CompressionStream('gzip') API available in modern browsers, so the result matches what a gzip-enabled server would produce. No upload, no external service — everything runs locally.

Does this match Brotli / my CDN exactly?

It's a close, representative gzip estimate at the default compression level. CDNs may use a different gzip level or Brotli (which is usually 10–20% smaller), so treat this as a reliable ballpark for budgeting, not a byte-exact CDN replica.

Try Next

Meta Tag Preview

Preview how your page will appear in Google search results and social share cards on Facebook, Twitter/X, and LinkedIn. Parses <title>, meta description, canonical, and full Open Graph / Twitter Card tags with diagnostics. 100% local.

Related Tools

Reference & Guides