GZIP Compress / Decompress

Free online GZIP compression and decompression powered by pako in your browser. Base64 or Hex output, with original/compressed size and ratio. Computed locally, nothing uploaded.

Runs locally · data never uploaded
Advertisement

How to use

What it does

GZIP is a widely used lossless compression format (the Linux gzip command and HTTP Content-Encoding: gzip both use it). This tool runs on the pako library inside your browser, so all compression and decompression happen locally.

  • Compress: UTF-8 encodes the text and compresses it; the output can be Base64 or Hex for easy copying and transport.
  • Decompress: accepts GZIP data as Base64 or Hex and restores the UTF-8 text.
  • After compression it shows the original size, compressed size and ratio so you can see the savings at a glance.

Example

Compress "Hello, GZIP!" with Base64 output and you get a base64 string starting with H4sI (the typical GZIP stream prefix). Paste that string back into "Decompress" mode to recover the original text.

Common uses

  • Passing compressed text between frontend and backend in a compact form
  • Verifying that GZIP data returned by a server decompresses correctly
  • Quickly estimating the compression gain of a piece of text

FAQ

Q1.Should I pick Base64 or Hex?
Both just encode the binary GZIP data as text. Base64 is more compact (~4 chars for 3 bytes) and suited for APIs; Hex is more readable for debugging. When decompressing, use the same encoding chosen during compression.
Q2.Why did compression make it bigger?
GZIP has a fixed header overhead, so very short input can show "negative" compression. You usually need a few hundred bytes before meaningful savings appear.
Q3.It says "not a valid GZIP stream" — what now?
The input is corrupted, truncated, or the encoding is wrong (Base64/Hex mismatch). Make sure you copied it fully and pick the same output encoding used during compression.
Q4.Is my data uploaded?
No. Compression and decompression run entirely in your browser; the content is never sent to any server.
Advertisement

Related tools