Skip to content

Gzip Base64 decoder

Free, no sign-up Runs in your browser

Decode Base64 strings that hold gzip, zlib or raw DEFLATE data, as found in logs, cookies and SAML. The format is detected; you can compress text too.

Direction

gzip, zlib or raw DEFLATE. The kind is detected from the first bytes. Decoded in your browser.

Text
The result appears here.

Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.

How to use the gzip Base64 decoder

  1. Choose Base64 to text, or text to Base64.
  2. Paste the string. Standard and URL-safe Base64 are both accepted.
  3. Read the detected format and the sizes.
  4. Copy the inflated text, or the compressed Base64.

About this tool

Some Base64 strings decode to unreadable bytes because there is a second layer: the data was compressed first. It is common wherever size matters: session cookies, tokens in URLs, cached values, log shippers, SAML requests in a redirect. A string that starts with H4sI is almost always gzip, because gzip data begins with the bytes 1f 8b. One that starts with eJ is zlib, which begins with 78.

All three formats use the same DEFLATE compression and differ in the wrapper. gzip adds a header and a CRC-32 checksum, zlib a two-byte header and an Adler-32 checksum, and raw DEFLATE has no wrapper at all. This tool decodes the Base64, detects the wrapper from the first bytes, inflates with the browser’s own decompressor and shows the text, or a hex dump when the result is binary. It can also compress text the other way.

Compression is not protection. A compressed cookie looks opaque, and developers sometimes treat it as tamper-proof, but anyone can inflate it, change it and compress it again. If the server trusts what comes back, it needs a signature. Inflating untrusted data also carries a risk of its own, the decompression bomb, so this tool stops at 8 MB of output.

Sources

Questions

What does a Base64 string starting with H4sI mean?

It is gzip data. Gzip always starts with the bytes 1f 8b 08, and those three bytes are H4sI in Base64. Decode the Base64 and gunzip the result to read it.

How do I decode Base64 gzip on the command line?

Run echo "H4sI..." | base64 -d | gunzip. For zlib data, which starts with eJ, use a tool such as zlib-flate -uncompress or python3 -c with zlib.decompress.

What is the difference between gzip, zlib and deflate?

DEFLATE is the compression method. zlib wraps it in a two-byte header and an Adler-32 checksum, and gzip wraps it in a longer header and a CRC-32. The name "deflate" in HTTP actually means the zlib format.

Is compressed data encrypted?

No. Anyone can decompress it without a key. If a compressed cookie or token carries data the server relies on, it must also be signed or encrypted.

Related tools