Skip to content

GZIP Compressor and Decompressor

Compress or decompress a file with gzip or deflate, using the browser's own compression.

Runs in your browserNo account neededFree
Loading tool…

Processing: This tool runs entirely in your browser. Your input and any file you open stay on your device — nothing is uploaded to a server.

How to use the gzip compressor and decompressor

  1. Choose a file — the format is detected if it is already compressed.
  2. Pick compress or decompress and the format.
  3. Download the result.

About this tool

Compresses and decompresses using the browser's own CompressionStream — the same zlib implementation behind virtually every other gzip tool. That means no library is downloaded, and output produced here is byte-compatible with `gzip` on the command line in both directions.

Three formats, and the difference matters when decompressing something someone else produced. gzip adds a header with a checksum and is what a `.gz` file contains. zlib-wrapped deflate has a smaller two-byte header and is what HTTP `Content-Encoding: deflate` usually means in practice. Raw deflate has no header at all, which is what makes it undetectable — it can only be tried.

The format of an opened file is detected where possible, and decompression is selected for you when it looks compressed. gzip is unambiguous, since it always begins with the bytes 1f 8b. zlib deflate is identified by its header passing a checksum, which is a weaker signal but better than requiring you to know.

One expectation to set: already-compressed files do not compress again. A JPEG, MP4, MP3 or ZIP has had its redundancy removed already, and gzipping one typically produces a file very slightly *larger* than the original. That is the compression working correctly rather than failing — text, logs, JSON, CSV and source code are where the substantial savings are.

Common uses

  • Compressing a large log or CSV before sending it.
  • Opening a .gz file without a command line.
  • Checking how well a file compresses before serving it.

Frequently asked questions

Why did my file get bigger?
It was already compressed. JPEG, MP4, MP3 and ZIP have had their redundancy removed, so gzip can only add its own header. That is correct behaviour, not a fault.
Which format should I choose?
gzip for a file — it is what .gz means and carries a checksum. zlib deflate is what HTTP usually means by 'deflate'. Raw deflate has no header and can only be tried, not detected.
Is this compatible with command-line gzip?
Yes, in both directions. It uses the browser's native zlib, which is the same implementation.

Related tools