One File, Made Smaller
Gzip compresses a single file and does nothing else. It does not bundle, it does not store folder structure, and it does not hold more than one thing, which sounds like a limitation until you notice it is why gzip is everywhere in web serving, log rotation and Unix pipelines, where the input is already one stream.
This tool compresses a file to .gz and decompresses .gz files back, entirely in your browser.
How to Compress or Decompress
The tool works in both directions and picks up which one you need from the file you provide.
- Drop the file onto the box above. A regular file will be compressed; a .gz file will be decompressed.
- Choose a compression level if you want to trade time against size. The default is a reasonable middle.
- Read the resulting size and the ratio against the original. Text-heavy files often drop by 70 per cent or more.
- Download the result. Your original file is untouched.
- For multiple files, use the ZIP creator instead, gzip handles exactly one file at a time by design.
Gzip, Zip and Tar Are Not Alternatives
These three tools are routinely confused because they overlap in the popular idea of "zipping something", but each does a different job. Gzip compresses one stream. Tar bundles many files into one without compressing. Zip does both at once, which is why it became the general-purpose default on desktops.
That explains the .tar.gz convention on Unix systems: tar collects the files into a single stream, gzip compresses that stream, and the two-step approach compresses across the whole set rather than each file separately. For many small similar files that produces a noticeably smaller result than zipping them individually, which is why source distributions still ship that way.
Compression Levels
The trade-off between speed and size, using a typical text file as the reference.
| Level | Speed | Size vs level 6 | When to use it |
|---|---|---|---|
| 1 | Fastest | +10β15% | Real-time streams, very large files |
| 6 (default) | Balanced | baseline | Almost everything |
| 9 | Slowest | β1β3% | Files stored once and served often |
The gap between level 6 and level 9 is small, often a couple of per cent, while the time can double or worse. Level 9 earns its cost only for something compressed once and downloaded many times.
Where Gzip Shows Up
Almost every web page you load arrives gzipped or in the newer Brotli format, negotiated between browser and server through the Accept-Encoding header. Server logs are typically rotated and gzipped nightly, since log text compresses extremely well. Backups, database dumps and data exports use it for the same reason.
It is worth knowing what gzip does not do: it does not encrypt, it does not verify who made the file, and a .gz carries no password. It stores the original filename and modification time in its header, which is convenient but also means those details travel with the file.
Decompressing is far quicker than compressing, which surprises people who expect the two to be symmetrical. Compression has to search for repeated sequences and decide how to encode them; decompression just follows the instructions it is given. That asymmetry is exactly what you want for something compressed once on a server and decompressed on every visitorβs device.