Compression size calculator
See how much smaller your text gets with gzip, deflate or brotli compression.
Compression size calculator
Paste any text and this tool compresses it with the browser's native CompressionStream to show exactly how much smaller it gets. It reports the original size in bytes and kB, the compressed size, the compression ratio and the percentage saved — useful for estimating gzip transfer sizes, comparing JSON payloads, or checking whether a blob of text is worth compressing before you store or send it.
Pick an algorithm from gzip, deflate, deflate-raw or brotli, the same formats a web server or a build pipeline uses for response compression. Turn on "Compare all algorithms" to run every one at once and see them side by side in a single table, which is the fastest way to tell whether brotli's extra ratio actually beats plain gzip for your specific text. "Show compressed data as Base64" prints the compressed bytes of the selected algorithm as a Base64 string, handy for embedding a compressed payload directly in code or a data URI.
Brotli support varies by browser — some engines don't implement it for CompressionStream yet, and the tool says so plainly instead of pretending it ran. Very short or already-compressed text (like a short random ID) can come out larger than the input once framing overhead is added; that's expected and the ratio will show it. The live tally under the output always shows the original-to-compressed byte count and the percentage saved for the algorithm you have selected.
Everything runs locally in your browser via the Web Compression Streams API — no text is uploaded anywhere, so it's safe to test API responses, config files or anything else you wouldn't want to paste into a third-party site. Copy the report, download it as a .txt file, or send the output back into another tool to keep working.