Gzip Compression and Decompression
EncodingEverything runs locally in your browser — nothing is uploaded
Compress text to gzip, or decompress gzip back to text. One thing to get straight first: gzip is not encryption. It has no key, anyone can unpack it, and the output is merely not directly readable — a number of tool sites file it under "encryption", which is a historic misnomer. Its actual job is making data smaller: a JSON payload typically compresses to about a third, and logs, API responses and backups all rely on it. This tool uses the browser-native implementation, so results are byte-for-byte identical to the `gzip` command, to zlib and to standard libraries in every language, and are interchangeable with them. The output lists original size, compressed size and the ratio — and note that if the data grew, that is normal (short text plus a full gzip header does that), and the page says so explicitly.
Features
- Both ways: text ⇄ gzip
- Output as Base64 or hex; both are accepted on input (hex tolerates spaces, colons and line breaks)
- Byte-for-byte identical to the gzip command, zlib and standard libraries — directly interchangeable
- Reports original size, compressed size and the size ratio
- Says why the data grew, so a bigger output does not look like a broken tool
- For invalid input, points at truncation, stray line breaks, or a zlib / deflate payload
How to use
- Choose the direction: compress or decompress
- Choose the data format: Base64 or hex
- Paste your content and press Ctrl/⌘ + Enter, or click Run
- Copy the result — each row has its own copy button
FAQ
- Can gzip be used for encryption?
- No. gzip is compression, not encryption: there is no key, anyone can unpack it, and the data is merely not directly readable. Compressing sensitive content before sending it is no different from sending it plainly — every bit of information is still in that byte stream. For confidentiality, use AES, or any real cipher.
- Why did the output get larger?
- Because gzip carries fixed header and trailer overhead (about 18 bytes), and when the content is already short or already compressed (zip, images, video, streams inside PDFs) DEFLATE finds no repeated patterns worth encoding and has to spend extra bytes recording that it stored the block verbatim. That is normal for every compression algorithm, not a fault here. The rule is simple: compression only helps data that is redundant and has not been compressed already.
- My data will not decompress — it says this is not valid gzip
- First check whether the copy got truncated — compressed output contains binary bytes, and pasting into chat windows or forms often clips it or inserts line breaks. Then check the format: `zlib` (starting with 0x78), `raw deflate` (no header or trailer) and `gzip` (starting with 0x1f 0x8b) are three incompatible formats that all get called "compression" casually, and feeding zlib data to a gzip decoder must fail. This tool handles gzip only.
- Is the output the same as the gzip command produces?
- Exactly the same. The Base64 from `echo -n "content" | gzip -c | base64` matches this tool byte for byte, because both use standard DEFLATE with the gzip wrapper, and both write a zero timestamp into the gzip header — which is why identical input always produces identical output, safe to compare and to cache.
Related tools
AES / DES
EncodingEncrypt and decrypt text with AES, DES or 3DES across CBC, GCM, CTR and ECB modes, with keys as text, hex or Base64. Runs in your browser.
Base64
EncodingConvert text to Base64 and back, with correct UTF-8 handling for accents, CJK and emoji. Runs entirely in your browser — nothing is uploaded.
Hash
EncodingCompute MD5, SHA-1, SHA-256, SHA-512 or MD4 digests of any text, hashed as UTF-8 bytes so they match openssl exactly. Runs in your browser.
URL Encode
EncodingEscape text into %XX form and back again, treating a whole URL and a single parameter value as different jobs. Runs entirely in your browser.
HTML Entities
EncodingTurn < > & and quotes into HTML entities and decode them back in a single pass, so &lt; becomes <, not an angle bracket. Runs in your browser.
JWT Decoder & Verifier
EncodingDecode a JWT and verify an HS256, HS384 or HS512 signature with your secret, reading exp and nbf as dates. All local to your browser.