Gzip Compress/Decompress
Compress text with gzip or deflate, or decompress a Base64-encoded blob. Runs entirely in your browser; nothing you type is ever sent anywhere.
Quick Learn
Gzip and deflate are the two compression formats behind nearly every "Content-Encoding: gzip" response header on the web — they find repeated patterns in text and replace them with shorter references, which is why highly repetitive data (JSON with many similar objects, verbose XML, plain-text logs) can shrink to a fraction of its original size. Gzip wraps deflate's compressed data with a small header and checksum; deflate is the raw compressed stream without that wrapper — picking the wrong one is the most common reason a decompression fails against otherwise-valid compressed bytes.
Since compressed output is arbitrary binary data, this tool Base64-encodes it for display and copy-paste — decompression expects that same Base64 text back, not raw bytes. This is genuinely useful for inspecting an API response you've captured as gzipped bytes (from browser dev tools or a proxy log) without spinning up a script, or for sanity-checking how much a payload would actually shrink before implementing compression in a real service.
Best Practices
- •Match the format exactly — data compressed as gzip won't decompress as deflate and vice versa, even though both use the same underlying algorithm, because gzip adds its own header and checksum bytes.
- •Compression has overhead — for very small inputs (a few dozen bytes), the compressed output can end up larger than the original, since the format's header outweighs any savings from finding repeated patterns.
- •This tool works on text; for inspecting a gzipped file or binary API response, first get its bytes as Base64 (e.g. from browser dev tools' response payload) before pasting into decompress mode.
- •Compression ratio scales with repetition — highly structured, repetitive data (JSON arrays of similar objects) compresses far better than already-compressed or high-entropy data like images or random tokens.
More Encoding Tools
Base64 Encode/Decode
Convert text to and from Base64, with correct UTF-8 handling.
URL Encode/Decode
Percent-encode or decode a query string, path segment, or full URL.
HTML Entity Encode/Decode
Escape or unescape HTML entities like &, <, and '.
Hex ↔ Text Converter
Convert text to hexadecimal bytes and back, for byte-level debugging.
Unicode Escape/Unescape
Convert text to \uXXXX escapes and back, including emoji and surrogate pairs.
Frequently Asked Questions
Is my text uploaded anywhere?
No. Compression and decompression both run entirely in your browser using the native CompressionStream/DecompressionStream APIs — nothing you paste is sent to a server.
Why is the compressed output shown as Base64 instead of the actual bytes?
Gzip/deflate output is raw binary data, which can't be reliably displayed, copied, or pasted as plain text. Base64-encoding it makes the result safe to copy, paste, and paste back in for decompression.
Why did decompression fail?
The two most common causes: the format dropdown doesn't match how the data was actually compressed (gzip vs deflate), or the Base64 input is incomplete/truncated from a copy-paste. Double-check both before assuming the data itself is corrupt.
What's the difference between gzip and deflate?
Deflate is the underlying compression algorithm. Gzip is deflate's compressed data wrapped with an additional header and a CRC32 checksum — that wrapper is why gzip output is a few bytes larger than the equivalent raw deflate output for the same input.
Does every browser support this?
CompressionStream and DecompressionStream are supported in all current evergreen browsers (Chrome, Edge, Firefox, Safari). An outdated browser without support will show a compression-failed error instead of a result.
Want the engineering deep-dives behind tools like this one?