How to use the size checker
- Choose the language: JavaScript, CSS, HTML, SVG or JSON.
- Paste your code or drop a file.
- Press Analyze size. The tool minifies a copy with the Balanced preset and compresses both versions.
- Read the chart: raw, gzip and brotli sizes for the original and the minified code.
- 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: brorgzipresponse 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.