GZIP Compressor

Compress text or files to GZIP (.gz) with a compression level from 0 to 9, or decompress .gz files back to the original data, right in your browser. Shows the compressed size as a percentage of the original, and keeps binary files intact for download.

About this tool

What is GZIP?

GZIP is a compression format based on the DEFLATE algorithm (LZ77 plus Huffman coding). It is the format behind .gz files and the Content-Encoding: gzip used by web servers, and it works especially well on text such as HTML, JSON, CSV and logs. A GZIP file starts with the bytes 1f 8b and ends with a CRC-32 checksum of the original data. This tool compresses data to GZIP and decompresses GZIP data, without installing anything.

How to use

Compress

  1. Type text into Raw data, or drop a file onto it.
  2. Set the Compression level (0 to 9, default 6).
  3. Click Compress. The GZIP data appears in Compressed data, with its size and the ratio to the original.
  4. Click the download button on Compressed data to save it. The file name is the original name plus .gz.

Decompress

  1. Drop a .gz file onto Compressed data.
  2. Click Decompress. The original data appears in Raw data.
  3. Click the download button on Raw data to save it. The .gz extension is removed from the file name.

Features

  • Compress text or any file, and decompress .gz files
  • Compression level 0 (no compression) to 9 (smallest output, slowest)
  • Shows the size of both sides and the compressed size as a percentage of the raw data
  • Binary data such as images or archives is kept byte-for-byte
  • Text results can be viewed and edited in the editor; copy, download and full-screen buttons on both sides
  • Checks for the GZIP signature (1f 8b) and shows a clear error for data that is not GZIP

Compression levels

LevelResult
0Stored without compression (slightly larger than the original because of the header)
1 to 3Fast, larger output
6Default; a good balance, the same default as the gzip command
9Smallest output, slowest

Text often shrinks to 20 to 40% of its size. Already-compressed files such as JPEG, PNG, MP4 or ZIP barely shrink at all.

FAQ

Are my files uploaded?

No. Compression and decompression run in your browser with the fflate library. The data is kept only in this browser so it is still there when you come back.

Can it open .tar.gz or .zip files?

Decompressing a .tar.gz (.tgz) gives you the .tar archive; the tool does not list or extract the files inside it. ZIP is a different format; use the ZIP Editor for that.

Why do I get "Not GZIP data"?

Decompress only accepts real GZIP data that starts with the bytes 1f 8b. Pasting Base64 text or raw DEFLATE / zlib data will not work; decode Base64 first with the Base64 Converter and download it as a file.

Can I compress several files at once?

No. GZIP compresses a single stream of data. To bundle multiple files, create a ZIP or tar archive first.