Gzip Size Estimator

· Free browser tool

A gzip size estimator shows how small a block of HTML, CSS, or JavaScript becomes after the server compresses it, which is the number that actually travels over the network and shapes how fast a page loads. Text-based assets routinely shrink by 60 to 80 percent under gzip, so the raw file size on disk tells only half the story: the transfer size is what users wait for and what page-speed tools score.

This tool is free and runs entirely in the browser. It compresses the text you paste with the same DEFLATE algorithm gzip uses, then reports the raw bytes, the compressed bytes, and the exact percentage saved, with nothing sent to a server.

Gzip Size EstimatorFree · client-side

🔒 Private: everything runs in your browser. Nothing you paste is uploaded.

How to use the gzip size estimator

Paste a snippet of HTML, CSS, or JavaScript into the box, click Estimate, and read the raw size, the compressed size, and the reduction bar. Switch to deflate if you want to compare the raw stream without the gzip header.

Why the compressed size matters more than the file size

When a browser requests a resource, an Apache or Nginx server with gzip enabled compresses text assets on the fly and sends the smaller payload, which is what counts against load time and bandwidth. A 120 KB stylesheet that gzips to 22 KB transfers as 22 KB, so optimising for the raw figure alone is misleading. This estimator reports the compressed bytes directly, letting a stylesheet, template, or script be judged on what actually crosses the wire rather than what sits on disk, which is the number page-speed audits and performance budgets are built around.

What compresses well, and what barely moves

Gzip works by finding repeated sequences, so verbose, repetitive text shrinks dramatically: HTML with repeated tag names, CSS with recurring property blocks, and unminified JavaScript all compress beautifully, often past 70 percent. Already-compressed or high-entropy content barely moves, because there is little repetition left to exploit. Images in JPEG, PNG, or WebP, fonts in WOFF2, and base64 blobs are effectively pre-compressed, so gzipping them again wastes CPU for almost no gain. Paste different asset types into the tool to see this contrast for yourself before deciding what is worth compressing.

Minify first, then gzip, for the smallest transfer

Minification and gzip solve different problems and stack together. Minifying removes whitespace, comments, and long variable names so the source is smaller before it ever reaches the compressor, while gzip then squeezes the repetition out of whatever remains. Running both is standard practice on production builds, and the combined saving is larger than either step alone. Use this estimator on the minified version of an asset to model the real production transfer size, since that is the byte count a visitor’s browser will download, not the comfortably formatted source kept in the repository.

Gzip size estimator frequently asked questions

Q1How accurate is this gzip size estimate?

It is a real measurement, not a guess. The tool runs your text through the browser’s CompressionStream API, which uses the same DEFLATE algorithm as gzip, so the byte count is genuinely compressed output. Production servers may select a slightly different compression level, which can shift the result by a few percent, but the figure shown is a faithful estimate of the transfer size.

Q2Does this tool upload the code I paste?

No. Compression happens entirely in your browser using a built-in JavaScript API, and nothing you paste is sent to a server, logged, or stored. Once the page has loaded, the estimator works offline, which makes it safe to use on private templates, unreleased scripts, or confidential markup without any exposure.

Q3What is a good gzip compression ratio for HTML and CSS?

Text assets commonly compress by 60 to 80 percent, so a ratio around 3:1 to 5:1 is typical for HTML, CSS, and unminified JavaScript. Larger and more repetitive files tend toward the higher end. If a file barely compresses, it is usually already minified, already compressed, or made of high-entropy data like an embedded image.

Q4Should I gzip images and fonts as well?

Generally no. JPEG, PNG, WebP, and WOFF2 files are already compressed internally, so passing them through gzip adds CPU work and header overhead for little or no saving. Gzip is for text-based resources: HTML, CSS, JavaScript, SVG, JSON, and XML. Paste an image’s base64 string into the tool and you will see the reduction is close to zero.

Q5What is the difference between gzip and deflate in this tool?

Both use the same underlying DEFLATE algorithm. Gzip wraps the compressed stream in a short header and a checksum footer, adding roughly 18 bytes of framing, while raw deflate omits that wrapper. The difference is negligible on real-world files. The deflate option is offered so you can compare the bare compressed stream, but gzip is what web servers send to browsers.

Hristo Bogdanov, Head of SEO at SEO Domains

Hristo Bogdanov

Head of SEO @ SEO Domains · CEO & Co-founder of SEO.bo

Hristo has spent 15+ years building aged-domain acquisition and screening workflows for SEO professionals, brand owners, and domain investors, and builds the free tooling SEO Domains publishes for practitioners.