# Gzip / Zlib / Deflate Decompressor

> Inflate gzip, zlib and raw deflate streams directly in the browser.

- Page: https://decoder.tools/gzip-decompressor
- Category: File Format & Archives
- Status: live, runs in the browser
- Last reviewed: 2026-10-23

A gzip decompressor reverses DEFLATE compression, reconstructing the original bytes from a gzip, zlib or raw deflate stream — the three container formats that all wrap the same underlying algorithm.

## Example

```text Input
H4sIAK9x3GoC//NIzcnJ11FISU3OT0kt0ivJz88pVgQAeikxLRUAAAA=
```

```text Output
Hello, decoder.tools!
```

That Base64 is a gzip stream. Paste it with **Input is: Base64** and **Format: gzip**, and it inflates to the original text. The decoder also reports the compressed and decompressed sizes and the ratio.

## What is the Gzip / Zlib / Deflate Decompressor?

DEFLATE combines LZ77 back-references with Huffman coding and is, by volume, the most widely deployed compression algorithm in existence: it powers gzip, zlib, PNG, zip archives and HTTP Content-Encoding. The confusion is never the algorithm but the wrapper. Gzip adds a 10-byte header starting 1f 8b and a CRC-32 trailer; zlib adds a 2-byte header (usually 78 9c) and an Adler-32 checksum; raw deflate has no wrapper at all.

That is why 'incorrect header check' is the error everyone hits. The data decompresses perfectly — you simply told the library to expect the wrong container. Choosing the right format in this tool is usually the entire fix.

This decompressor handles all three, so you can inflate an HTTP response body, a zlib-wrapped SAML redirect payload, a PNG chunk or a raw stream lifted out of a binary without installing anything.

## How to use the Gzip / Zlib / Deflate Decompressor

1. Choose the format: gzip, zlib/deflate or raw deflate.
2. Paste the compressed data as base64 or hex.
3. Read the inflated output — if it fails, try the other two wrappers before assuming corruption.

## When to use it

- Inflating a gzip-encoded HTTP response body captured from a proxy.
- Unwrapping the DEFLATE layer of a SAML redirect-binding request.
- Decompressing an embedded stream found inside a PDF or a binary blob.

## Gzip / Zlib / Deflate Decompressor at a glance

| | |
|---|---|
| Algorithm | DEFLATE — LZ77 plus Huffman coding (RFC 1951) |
| Gzip magic | 1f 8b · 10-byte header, CRC-32 trailer (RFC 1952) |
| Zlib magic | Usually 78 9c · 2-byte header, Adler-32 (RFC 1950) |
| Raw deflate | No header or trailer at all |

## FAQ

### What is the difference between gzip, zlib and deflate?

The compression is identical; only the wrapper differs. Gzip has a 10-byte header and a CRC-32 trailer, zlib a 2-byte header and an Adler-32 checksum, and raw deflate has neither.

### Why do I get 'incorrect header check'?

You picked the wrong wrapper. Data starting 1f 8b is gzip; data starting 78 is zlib; anything else is probably raw deflate. Switch the format and it will inflate.

### How do I identify a compressed stream?

Look at the first two bytes. 1f 8b means gzip, 78 01/9c/da means zlib, 50 4b means a zip archive, and 42 5a 68 means bzip2.
