Guide

THE TOOLBOX / WEB PERFORMANCE & DATA UTILITIES

Measure Gzip & Brotli size,
without an upload.

Calculate Gzip, Deflate, and Brotli compressed sizes locally in your browser. Measure byte savings and network latency for JavaScript, CSS, and JSON payloads with zero server uploads.

Presets:
INPUT TEXT / ASSET CODE
Max 1 MiB · CompressionStream API
COMPRESSION TELEMETRY & BENCHMARKS100% In-Memory

Measure compressed size across Gzip, Deflate, and Brotli.

THE DETAILS

Understanding RFC 1952 Gzip compression, LZ77 sliding windows, and HTTP payload budgeting.

1. Step-by-Step Workflow

Paste your source code or select a preset (React Component, Tailwind CSS, GeoJSON), choose your compression format (Gzip or Deflate), and instantly inspect the byte breakdown and network transfer latencies.

2. RFC 1952 & W3C CompressionStream

Powered by native window.CompressionStream, providing zero-overhead, multi-chunk stream compression that precisely matches Nginx, Cloudflare, and Node.js production Gzip output.

3. Brotli vs. Gzip Optimization

Brotli achieves superior compression on repetitive web text by leveraging a pre-shared static dictionary containing HTML tags, common JavaScript keywords, and HTTP header strings.

4. Mobile Transfer Latency Budgeting

Knowing raw byte size is only half the battle; real-world mobile users on 3G and congested 4G connections experience latency proportional to transfer sizes. Benchmarking Gzip savings ensures Core Web Vitals (LCP and INP) compliance.

5. Bidirectional Base64 Decompression

Need to debug compressed API responses or binary logs? Toggle to Decompress Base64 to unpack Deflate or Gzip byte arrays into readable UTF-8 text with strict error bounds.

6. 100% Client-Side Privacy

Proprietary source code, sensitive database dumps, and API keys are processed entirely in browser memory. Zero network requests are made.

Frequently Asked Questions

Does this Gzip size calculator upload my source code or payload to a server?

No. Compression and decompression run 100% locally in your browser memory using the standard W3C CompressionStream and DecompressionStream web APIs. Zero bytes ever leave your device.

How does Gzip compare to Deflate and Brotli for web performance?

Deflate (RFC 1951) uses LZ77 and Huffman coding. Gzip (RFC 1952) wraps Deflate with a 10-byte header, filename/timestamp metadata, and a CRC-32 checksum. Brotli (RFC 7932) introduces a 120 KB static dictionary of common web substrings, typically delivering 15-20% higher compression ratios for JavaScript, CSS, and HTML assets.

Why can very short strings produce compressed outputs larger than the original text?

The Gzip container format adds a mandatory 10-byte header, CRC-32 checksum, and block headers. For payloads smaller than ~100 bytes, container overhead exceeds the redundancy savings of the LZ77 sliding window.

What is the maximum file and text limit supported by this tool?

Input text and decompressed UTF-8 output streams are capped at 1 MiB (1,048,576 bytes) to maintain responsive 60 FPS performance and prevent browser memory exhaustion.

How are the mobile network transfer latency estimates calculated?

Transfer latency estimates are derived by dividing the Gzip byte count by standard telecommunication bandwidth profiles: Slow 3G (400 kbps / 50 KB/s), Fast 3G (1.6 Mbps / 200 KB/s), and 4G LTE (10 Mbps / 1.25 MB/s).