Gzip & Brotli Size Checker – Compression Size Analyzer

Paste code or drop a file to see its raw size, its minified size and how small it gets with gzip and brotli compression, both for the original and the minified version, shown side by side in a bar chart. Gzip uses your browser's built-in compression; brotli uses the browser's native support where available and a WebAssembly encoder otherwise. It works for JavaScript, CSS, HTML, SVG and JSON, and nothing is uploaded.

Your code

Paste code, or drop files here. Engines load only when you press the button.

Result

Files

.js .mjs .css .html .htm .svg .json — several at once for a batch
Engines and licenses

This tool uses these open-source engines, loaded only when needed:

100% in your browser: your code is processed on this device and never uploaded.

How to use the size checker

  1. Choose the language: JavaScript, CSS, HTML, SVG or JSON.
  2. Paste your code or drop a file.
  3. Press Analyze size. The tool minifies a copy with the Balanced preset and compresses both versions.
  4. Read the chart: raw, gzip and brotli sizes for the original and the minified code.
  5. Copy or download the minified version if you want to use it.

How it works

Measurement How it’s calculated
Raw size Bytes of the text in UTF-8
Minified size Raw size after the language’s minifier (Balanced preset)
gzip Browser CompressionStream(“gzip”)
brotli Native CompressionStream(“brotli”) where supported, otherwise a WebAssembly brotli encoder at quality 11
Saving 1 − result ÷ original

The gzip result matches the size Node’s zlib library produces for the same input to within about one percent, which our tests check.

Worked examples

  • A 40 KB stylesheet with comments might minify to 30 KB and compress to around 7 KB with gzip and a little less with brotli.
  • An already minified library barely changes when minified again, but still compresses to a fraction of its size.
  • A JSON response with repeated keys compresses very well, often to under a fifth of its raw size.

Tips and common mistakes

  • Compare like with like: measure the same file you deploy, ideally the production build.
  • Check your server is compressing: look for a content-encoding: br or gzip response header in your browser’s network panel.
  • Don’t compress images twice: PNG, JPEG and WebP are already compressed; this tool is for text formats.
  • Watch the raw size too: large scripts still cost parse time after download.

Why use this tool

It shows raw, minified, gzip and brotli sizes together, uses your browser’s own compression where possible, explains where numbers come from and keeps your code on your device.

Reading the chart

The bars use the same scale, so you can compare at a glance how much minification and compression each contribute. If the minified bars are almost as long as the originals, the file was already compact; if the compressed bars are much shorter, your server’s compression will do most of the work.

Frequently asked questions

What's the difference between gzip and brotli?

Both are lossless compression formats that browsers decompress automatically. Brotli usually produces smaller files than gzip for text such as HTML, CSS and JavaScript. Most servers and CDNs can serve either.

Why do my server's sizes differ slightly?

Servers choose different compression levels, and some compress on the fly with faster, lighter settings. These numbers use high levels, so treat them as estimates of what's possible.

Why does it need to download a brotli engine?

Not every browser offers brotli in the built-in CompressionStream API. When it isn't available, the tool loads a WebAssembly brotli encoder, but only when you run an analysis.

Should I minify if my server compresses?

Yes. Minification and compression stack: minified code compresses a little better and also uses less memory once decompressed.

Is my file uploaded?

No. Everything runs in a background worker in your browser.

Which number matters for page speed?

The compressed size is what travels over the network, so it affects download time. The raw size affects parse and memory cost after download.

Sources