Format Code Now
/

Gzip Decompress Online

ED-67

Paste gzip data as Base64 or hex and read the text inside it. The data is decompressed in your browser, and you can also compress text to gzip.

Runs in your browser. Nothing is uploaded.

Gzip data as Base64 or hex (or text to compress)

Result

How to use it

  1. Paste the gzip data. Base64 gzip usually starts with H4sI, and hex starts with 1F8B.
  2. Leave Input on Detect, or force Base64 or hex if the guess is wrong.
  3. Click Decompress gzip. Set Output to Hex if the content is binary rather than text.
  4. To go the other way, type text and click Compress to gzip.

What it reads

Gzip (RFC 1952) is a deflate stream wrapped in a header that begins with the bytes 1F 8B. This tool takes those bytes written as Base64 or hex, checks the header, decompresses them with the DecompressionStream built into your browser, and shows the result as UTF-8 text. If the bytes inside are not text, such as an image, you get a message and can set Output to Hex to see them instead.

Limits and what is not handled

Output is capped at 50 MB so a small input cannot freeze the page. You cannot load a file or a URL; paste the data. Compression uses the browser default level, so the Base64 it makes may differ from the output of gzip on the command line even though both decompress to the same text. A data stream that is cut short or damaged gives an error rather than partial text.

Error messages and what to do

MessageWhat it meansFix
This is not gzip data: gzip starts with the bytes 1F 8B. For Base64 that is H4sI at the start. If the data starts with 78, try the zlib tool.The bytes do not begin with the gzip header.Check that you pasted all of the data and that it is gzip, not zlib.

Questions people ask

How do I decode a gzip Base64 string?

Paste the Base64 into the input box and click Decompress gzip. It decodes the Base64 to bytes, checks for the gzip header and unpacks it. A valid gzip string in Base64 starts with H4sI.

What is the difference between gzip and zlib?

Both use deflate. Gzip adds a larger header starting with 1F 8B and a CRC-32 checksum; zlib uses a two byte header such as 78 9C and an Adler-32 checksum. If your data starts with 78, use the zlib page.

Why does it say the data is not gzip?

The first two bytes must be 1F 8B. Common causes are that the data is zlib, that it was Base64 encoded twice, or that part of the string was lost when it was copied.

Can I decompress gzip data given as hex?

Yes. Paste the hex bytes with or without spaces or a 0x prefix. Detect mode treats input made only of hex digits and with an even length as hex, and anything else as Base64.

Can it open a .gz file?

Not directly, because it reads pasted text only. Convert the file to Base64 or hex first, for example with base64 file.gz on the command line, and paste the result.

Is there a size limit?

The decompressed result may be up to 50 MB. Beyond that it stops and shows an error to keep the page responsive. The input is Base64 or hex text, so a large file pasted as text may also make the page slow.

About this tool

Decompress reads gzip (RFC 1952) bytes given as Base64 or hex and shows them as UTF-8 text; set Output to Hex for binary data. It uses the DecompressionStream built into your browser, so it needs a current Chrome, Edge, Firefox or Safari. Output stops at 50 MB. It checks for the gzip header (1F 8B) first, so zlib data gets a clear message instead of a vague failure. Only the first gzip member is expected; a file that holds several members is not handled specially. Compress writes gzip at the browser default level and returns Base64 or hex, which can differ byte for byte from what gzip on the command line produces. Files and URLs are not loaded: paste the data.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.