Skip to content

GZ File Format (.gz)

A GZ file wraps a single DEFLATE-compressed stream in a header that can carry the original filename and modification time, plus a trailing CRC-32 checksum, as defined in RFC 1952.

.gzArchives

GZ at a glance#

Full namegzip compressed archive
File extension.gz
CategoryArchives
DeveloperJean-loup Gailly and Mark Adler
First released1992
MIME typesapplication/gzipapplication/x-gzip
CompressionLossless
SpecificationRFC 1952 - GZIP file format specification version 4.3
FileFlip supportFileFlip reads and writes this format

What a .gz file can hold#

These are the things a GZ file either supports or does not, and they are what decides whether a conversion keeps everything or quietly drops something.

StreamingYes

Strengths and limitations of GZ#

What GZ does well

  • DEFLATE decompression is fast and cheap, which is why gzip is the default Content-Encoding for compressed HTTP responses
  • Small, simple format with a header carrying the original filename and an mtime, and a trailing CRC-32 for integrity checking
  • Implemented practically everywhere, from web servers to embedded systems

Where GZ falls short

  • Compresses only a single file or stream, so archiving a folder means tarring it first
  • DEFLATE's compression ratio is clearly behind bzip2 and further behind xz on the same data
  • Can't be edited or appended to in place; changing the contents means recompressing the whole stream

Use GZ to compress a single file quickly, especially one going over HTTP, where gzip decoding is effectively free.

Convert GZ to XZ when the same data needs to be as small as possible and slower compression is an acceptable cost.

How to open a .gz file#

A .gz file opens in the programs below, grouped by the platform you are on. If you would rather not install anything, FileFlip converts GZ into a format your machine already opens, and it does it in the browser tab rather than on a server.

PlatformPrograms that open it
Windows7-Zip, WinRAR
macOSArchive Utility
LinuxArchive Manager (File Roller), gzip (terminal)
WebFileFlip

GZ questions people ask#

Can a GZ file contain more than one file?

No, gzip compresses exactly one file or stream, so a .gz archive holding several files is actually a tar archive that's been compressed afterward, normally named .tar.gz or .tgz.

Why does gzip decompress so fast?

gzip uses the DEFLATE algorithm, which was designed for speed rather than maximum compression, so decoding it is cheap enough that web servers gzip-compress HTTP responses on the fly and browsers decompress them with no noticeable delay. Formats built for a tighter ratio, like bzip2 or xz, trade away some of that speed.

What does the .gz header actually store?

A gzip file's header can carry the original filename, the modification time and an operating system flag, and the file ends with a CRC-32 checksum of the uncompressed data plus its original size, all defined in RFC 1952. That checksum is what lets gzip detect a corrupted file on decompression.

Is gzip still used for anything besides old Unix files?

Yes, extensively. gzip is the default compression for HTTP responses across the web, and it's still the most common single-file compressor on Linux and macOS despite bzip2 and xz both compressing tighter.

Converting GZ files#

Every conversion runs inside your browser. The file is read from your disk, the work happens on your own machine, and nothing is uploaded. How FileFlip works names the engine behind each family and how to verify that for yourself.