What this does
Decompresses a GZip (.gz) or raw zlib-compressed file back to its original bytes, entirely in your browser. These are the two compression formats behind an enormous amount of everyday data transfer — every web response your browser receives is very often gzip-compressed in transit without you seeing it — and occasionally you end up with a .gz file or a compressed API response that needs decompressing directly rather than being handled automatically by whatever normally does it.
GZip versus raw zlib — which one you have
- GZip wraps the compressed data in a small header and footer containing metadata like the original filename and a checksum. A file ending in
.gz, or beginning with the byte signature1f 8b, is GZip. - Raw zlib (deflate) is the compressed data alone with no wrapper — no filename, no checksum, just the compressed bytes. This shows up inside other formats and protocols that manage their own framing, most often as an HTTP response encoded with
Content-Encoding: deflate, or as a data blob extracted from inside another file format.
Picking the wrong one produces garbage output or an outright error, since the decompressor is looking for a header that is not there. If you are not sure which you have, GZip is by far the more common of the two as a standalone file — try that first.
Where these files come from
- Log files rotated and compressed by a server (
access.log.gz). - API responses saved to disk while the server's gzip compression was still applied.
- Source tarballs on Unix systems, commonly
.tar.gz— note this needs two steps: decompress the gzip layer first, then extract the resulting.tararchive separately, since tar and gzip are two independent formats stacked together. - Compressed data embedded inside another file format that a specialised tool has extracted for you.