gz
Gzip ⇄ TextCompress · Decompress · gzip / zlib / deflate · Base64 or Hex
All tools run in your browser · Free to use

Gzip ⇄ Text — Compress and Decompress Online

Gzip is the most widely used compression format on the web. HTTP responses, log archives, message queues and many APIs store or send data gzip-compressed. Because compressed data is binary, it is usually shown as Base64 or Hex when it appears in JSON, databases or logs — and you cannot read it until it is decompressed.

This tool decompresses Base64 or Hex gzip data back to readable text, and compresses text to gzip so you can produce test payloads. It uses the browser’s built-in compression engine, so files and data never leave your device.

How to use

  1. Choose Gzip → Text to decompress, or Text → Gzip to compress.
  2. Select the format (gzip, zlib or raw deflate) and the encoding of the binary data (Base64 or Hex).
  3. Paste your data into the input panel, or click Open File to load a .gz file.
  4. Read the result on the right. When compressing, click the download button to save a real .gz file.
  5. The status bar shows the raw and compressed sizes and how much space was saved.

gzip vs zlib vs raw deflate

  • gzip — DEFLATE data with a gzip header and CRC32 checksum. Used by .gz files and HTTP Content-Encoding: gzip. Base64 gzip data usually starts with H4sI, and Hex with 1f8b.
  • zlib — DEFLATE data with a small zlib header and Adler-32 checksum. Used by HTTP Content-Encoding: deflate, PNG images and many libraries. Base64 often starts with eJ.
  • raw deflate — DEFLATE data with no header at all, used inside ZIP files and some custom protocols.

Example

The text "Hello, World!" compressed with gzip and encoded as Base64 looks like:

H4sIAAAAAAAACvNIzcnJ11EIzy/KSVEEANDDSuwNAAAA

Frequently asked questions

Why does decompression fail?
Usually because the format or encoding does not match the data. Data starting with H4sI (Base64) or 1f8b (Hex) is gzip; data starting with eJ is usually zlib. Also check that no characters were lost when copying.
Why is my compressed output larger than the input?
Compression adds a small header and needs repetition to work. Very short or already-compressed text may grow slightly. Gzip shines on larger text such as JSON, HTML and logs.
Can I decompress binary files?
The output is shown as UTF-8 text, so this tool is designed for compressed text. Binary content such as images will not display meaningfully.

Privacy

This tool runs entirely in your browser. The data you paste or open is processed locally and is never uploaded to or stored on our servers.

Related tools