GZip / zlib Tool
Decompress or compress gzip, zlib and raw DEFLATE streams — pastes or files, entirely on this device.
Auto reads Base64 or hex pastes; pin one when detection guesses wrong.
Press ? for shortcuts
Do it offline:$ gzip -d file.gz
How to use it
- Pick Decompress, paste a Base64 or hex stream — or drop a .gz, .zlib or .deflate file — and read the decoded text or a byte-counted binary card.
- Leave the format on Auto: gzip and zlib announce themselves in their first two bytes; anything unsigned gets one declared raw DEFLATE attempt.
- Switch to Compress, pick a format and a level from 0 to 9, and read the honest size line.
- Copy the result as text or Base64, or download it with the matching extension.
Paste the Base64 or hex spelling of a gzip, zlib or raw DEFLATE stream and read what is inside, or drop a compressed file. The container is recognized from its first bytes, checksums are verified rather than assumed, and the same page compresses back — byte-reproducibly, at any level, entirely on this device.
How it works
All three formats share one engine: DEFLATE (RFC 1951) replaces repeated byte runs with back-references and spends fewer bits on frequent symbols — LZ77 plus Huffman coding. A raw stream is those blocks and nothing else: no header, no checksum, nothing to detect it by.
zlib (RFC 1950) adds the smallest checkable envelope: a 2-byte header — the first byte's low four bits equal 8, the pair divides by 31 — and a 4-byte Adler-32 of the original data.
gzip (RFC 1952) is the heavier coat: a 10-byte header opening 1f 8b, optional fields, and an 8-byte trailer with a CRC-32 and the decompressed length. That layering is what Auto reads — and why an unsigned paste can still be tried as DEFLATE.
Examples
H4sIAAAAAAAAE/NIzcnJ11FIr8osUAQAPj0PEAwAAAA=Hello, gzip!A 32-byte gzip stream holding 12 bytes of text — the chip reads gzip stream detected (1f 8b magic bytes). Tiny payloads never amortize the 18-byte container.
to be or not to be, that is the question. to be or not to be, that is the question. to be or not to be, that is the question. to be or not to be, that is the question. to be or not to be, that is the question. to be or not to be, that is the question. to be or not to be, that is the question. to be or not to be, that is the question. 336 B → 62 B · saved 82%Eight copies of one 42-byte sentence collapse by 82% — repetition is what back-references eat. As Base64 this output opens with H4sI.
78 9c 0b 4e 4d 55 a8 cc 2f 55 48 2c 51 30 d7 53 08 46 f0 2c 50 78 96 7a 00 0d 89 0c 80See you at 7. See you at 8. See you at 9.A zlib stream as spaced hex pairs: one chip says separators were ignored, another that the RFC 1950 header check passed — 29 bytes carrying 41 characters.
K0osV0hJTctJLElVyEgsVsjLV8hITUxJLQIAraw deflate has no headerNo gzip magic, no zlib header: Auto falls back to one raw DEFLATE attempt and says so. Pinned to zlib, the same paste is refused.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
HTTP's deflate coding is not raw DEFLATE
RFC 9110 §8.4.1.2 defines the deflate content-coding as the zlib container, yet servers have long sent headerless blocks under that name. When a body refuses one reading, try the other.
Multi-member gzip decodes in full
Concatenation is legal — RFC 1952 §2.2 makes cat a.gz b.gz valid gzip — so every member is decoded and joined, a chip counting them.
Checksums are verified here, then reported
The decoder recomputes each member's CRC-32 and a zlib stream's Adler-32 against the stored trailer. A mismatch warns with both values printed; the output stays on screen.
Compressed bytes are reproducible — per encoder
Compression writes a zero timestamp and no filename, so one input at one level gives identical bytes every run — gzip -n parity. Encoders still differ legally: 62 bytes here, 65 via Node's zlib, for the second example.
Base64 of a gzip stream always opens H4sI
Every gzip stream begins 1f 8b 08 — magic pair plus DEFLATE method byte — and those three bytes encode to exactly H4sI. A handy eyeball test for mystery blobs.
Compression is not encryption
Anyone holding a compressed stream can decompress it without any key, exactly as this page just did. When secrecy matters, encrypt; compression only saves space.
Common errors
The data does not decode as gzip: unexpected EOF- The Hello, gzip! example cut to 20 of its 32 bytes. Everything after the colon is the decoder's report, verbatim — unexpected EOF usually means a truncated copy or download.
Not a recognizable compressed stream: no gzip magic bytes (1f 8b), no zlib header (RFC 1950 check), and a raw DEFLATE attempt failed (unexpected EOF).- Auto's verdict when all three readings fail: this paste was the Base64 of the plain words Hello world — valid Base64, never compressed. Every attempt is listed.
Input does not decode as zlib, but it carries a gzip signature (1f 8b magic bytes) — switch the format to gzip.- A pinned format outranks detection, so pinning zlib against a gzip stream fails honestly instead of rereading. The error names the signature it found and the one-step fix.
Input is larger than the 16 MB limit for this tool. For bigger files use the CLI: gzip -d file.gz- Past 16 MB the page refuses whole — files before reading, pastes at the same cap. Output has its own guard: past 64 MB, decompression stops with a typed refusal — a small stream can legally expand a thousandfold.
FAQ
gzip, zlib or raw DEFLATE — which one do I have?
Read the first bytes: 1f 8b is gzip — H4sI as Base64. A first byte whose low four bits equal 8, the pair divisible by 31, is zlib — 78 opens the common case. Neither usually means raw DEFLATE or never-compressed data; Auto posts its verdict as a chip.
Why don't my bytes match the gzip command byte-for-byte?
RFC 1951 fixes what a decoder must accept, not what an encoder must emit — any block split and any legal Huffman table conforms, so correct encoders land a few bytes apart. Compare by round-trip: decompress both outputs — the payloads must match exactly.
Can this open .zip or .tar.gz archives?
Not as archives. A .zip is a multi-file container with its own directory — a different format that merely uses DEFLATE inside. A .tar.gz does decompress here: you get the inner .tar as a download; unpacking it is a separate job.
Keyboard shortcuts
- ⌘/Ctrl + Enter
- Run the current mode now.
- ⌘/Ctrl + S
- Download the output with its matching extension.
- ⌘/Ctrl + C
- Copy the decompressed output when nothing is selected.
- ⌘/Ctrl + Shift + C
- Copy the output even with a selection active.
- s
- Swap output into input and flip the mode.
- t
- Cycle the color theme.
- ? or ⌘/Ctrl + /
- Show the shortcut overlay.
- Esc
- Close the topmost overlay.