What is a GZ file?
A .gz holds one file made smaller. It carries no folder structure and no second file, which is why a whole directory arrives as a .tar.gz instead. Mac and Linux open one with no extra software. You can convert GZ files here, both into the format and out of it.
Specification
| Full name | Gzip Compressed File |
|---|---|
| Extensions | .gz, .gzip |
| Media type | application/gzip |
| Compression | Lossless |
| Transparency | — |
| Animation | — |
| Multiple pages | — |
| Colour depth | DEFLATE (LZ77 plus Huffman), CRC32 integrity trailer |
| Size limits | — |
| Introduced | 1992 |
| Developed by | Jean-loup Gailly and Mark Adler |
| Standard | Open |
| Browser support | Every browser, including older ones |
What GZ is used for
- HTTP Content-Encoding for text, HTML, CSS and JavaScript
- Compressing individual log files during rotation
- The compression half of a tar.gz source or backup archive
- Database dumps and other large single-file exports
Strengths and limitations
What GZ does well
- Very fast to compress and decompress, with modest memory use
- Decoded natively by every browser as part of HTTP transfer encoding
- Available everywhere, and it notices when a file has been damaged
Where GZ falls short
- Holds one file only, with no idea of folders
- Newer compressors make clearly smaller files
- Decompression is strictly sequential, so seeking into it is expensive
Convert GZ to
Every target this format can be written out as, each on its own page.
Convert to GZ
Everything that can be turned into a GZ file.
Tools that accept GZ
Questions about GZ
What is a .gz file?
A .gz holds one file made smaller. The extension .gz or .gzip identifies it, and its media type is application/gzip.
How do I open a GZ file?
Any current browser will open it directly, so dragging the file into a tab is usually enough. Most operating systems also preview it without extra software.
Is GZ lossy or lossless?
Lossless. Nothing is discarded, so repeated saves never degrade the contents.
What is GZ good for?
Very fast to compress and decompress, with modest memory use. Decoded natively by every browser as part of HTTP transfer encoding. Available everywhere, and it notices when a file has been damaged. In practice that makes it a good fit for HTTP Content-Encoding for text, HTML, CSS and JavaScript, and Compressing individual log files during rotation.
What are the drawbacks of GZ?
Holds one file only, with no idea of folders. Newer compressors make clearly smaller files. Decompression is strictly sequential, so seeking into it is expensive.