Bug Days

GZip Base64 Encoder & Decoder

Decode a Base64 GZip payload into readable text, or compress text with GZip and encode it as Base64. Works with UTF-8 text, including JSON and XML.

Browser-based processing · No account required · Share a reproducible example

Try a working Base64 GZip example

How to decode Base64 GZip to text

  1. Paste the encoded payload into Input. Copy the string value itself, without surrounding JSON quotes.
  2. Select Decode & Decompress. The tool decodes Base64 into bytes, then decompresses the GZip data.
  3. Read the UTF-8 text in Output and use Copy Output. For JSON, continue in the JSON formatter; for XML, use the XML formatter.

To go the other way, paste ordinary text and select Compress (GZip + Base64). The output is a Base64 string containing compressed bytes, ready for a text field that expects this format.

GZip vs Base64: compression and encoding are different

GZip compresses bytes. Base64 represents bytes as printable characters; it does not compress or encrypt them. For the format handled here, the order is text → UTF-8 → GZip → Base64. Decoding reverses those steps. See the GZip format and Base64 specification.

Base64 adds roughly one third to the compressed byte count. Small inputs may therefore produce a longer result than the original text. Check the final Base64 length when a destination has a size limit.

Share the input and the operation

After a conversion, use Share to let someone open the same input and operation. The embedded-data option keeps the sample in the link without uploading it to the sharing service. The optional short-link service stores it for 30 days. Anyone with either link can read the included data, so choose a small example you are happy to share.

The guide examples below use synthetic data and self-contained links. When posting a question or writing documentation, include the important input and expected output in the text, with the runnable link alongside them.

GZip and Base64 guides with runnable examples

Common Base64 GZip questions

Why does my encoded string start with H4sI?

The usual GZip header starts with bytes 1f 8b 08, which encode as H4sI in Base64. It is a useful clue, not a guarantee that the entire payload is intact. Try the worked decoding example.

Why does Base64 decoding alone produce unreadable text?

You may be looking at compressed bytes rather than text. If the producer used GZip, those bytes must be decompressed before being decoded as UTF-8. Ordinary uncompressed Base64 belongs in the Base64 decoder.

Can this open ZIP files or raw .gz uploads?

This page accepts text and Base64-encoded GZip, not file uploads. ZIP archives, zlib-wrapped data, and raw DEFLATE are different formats. Check the producer's format before choosing a decoder.

What should I check when decompression fails?

Check that you copied the whole payload, selected only the Base64 string, and are using GZip rather than another compression format. Follow the padding, header, and truncation troubleshooting guide to isolate the failing step.