TGZ (Gzipped Tar Archive)
The go-to bundle format that Unix developers have trusted for over three decades to ship source code and software packages.
| Full name | Gzipped Tar Archive |
| Extension | .tgz |
| MIME type | application/x-compressed-tar |
| Developer | Jean-loup Gailly and Mark Adler (gzip); originally AT&T Bell Labs (tar) |
| Released | 1992 (gzip compression layer); tar dates to 1979 |
| Type | Archive / compressed bundle |
| Compression | DEFLATE (via gzip) |
| Also known as | .tar.gz |
What is a TGZ file?
A TGZ file is a tar archive that has been compressed with gzip. It bundles many files and directories into one container, then squeezes that container down to save space. The .tgz extension is just a shorter alias for the more explicit .tar.gz form.
Tar (short for tape archive) collects files into a single stream, preserving names, permissions, timestamps, and directory structure. Gzip then applies DEFLATE compression to shrink the result. The combination gives you one compact file that can be unpacked exactly as it was packed. TGZ files carry no internal index, so extraction reads the data from start to finish.
History
The tar program was introduced with Version 7 Unix at Bell Labs in January 1979, designed for writing data to magnetic tape. Jean-loup Gailly and Mark Adler released gzip in October 1992 as a patent-free replacement for the compress utility, whose LZW algorithm was covered by Unisys and IBM patents. Pairing tar with gzip became standard practice on Unix and Linux systems through the 1990s, and the .tgz shorthand emerged to fit the eight-character filename limits of older file systems.
How it works
The file is a raw gzip stream wrapping a POSIX tar archive. The gzip envelope holds a header (magic bytes 1f 8b), compression method, flags, and a CRC32 checksum at the end. Inside sits the tar archive: a sequence of 512-byte header blocks followed by file data blocks, each padded to a 512-byte boundary. There is no central directory, so tools must read the whole stream to list or extract contents.
What it is used for
- Distributing Linux and Unix software source code packages
- Backing up directory trees while keeping file permissions and symlinks intact
- Shipping container images and build artifacts in CI/CD pipelines
- Archiving log directories or configuration snapshots for long-term storage
How to open it
On Linux and macOS, run tar -xzf file.tgz in a terminal to extract the contents. On Windows, tools such as 7-Zip, WinRAR, and the built-in Windows 11 tar command can open TGZ files without extra software.
Pros and cons
Strengths
- Excellent compression ratio for text-heavy source trees
- Preserves Unix file permissions, ownership, and symbolic links
- Supported natively on every major Linux and macOS installation
- Single-file format is easy to move, copy, or attach
Trade-offs
- No built-in encryption — sensitive data needs a separate encryption layer
- No random access — you must decompress from the start to reach a file in the middle
- Corruption anywhere in the stream can make the rest of the archive unreadable
- Less common than ZIP on Windows, requiring third-party tools for casual users
Convert TGZ files
Free, in your browser, no signup. Start at the TGZ converter, or jump straight to a popular conversion below.
Curious how fast and how small? See our measured conversion benchmarks.
TGZ FAQ
Is .tgz the same as .tar.gz?
Yes, they are identical formats. The .tgz extension is a shorthand that fits in older eight-character filename limits, while .tar.gz makes the two-step process more explicit.
Can I open a TGZ file on Windows?
Yes. Windows 11 includes a built-in tar command that handles TGZ files. On older Windows versions, free tools like 7-Zip or WinRAR work fine.
Why do Linux packages use TGZ instead of ZIP?
Tar preserves Unix-specific metadata such as file permissions and symbolic links that ZIP does not handle well. That metadata matters when installing software on Unix-like systems.
How do I create a TGZ file?
On Linux or macOS, use tar -czf output.tgz folder/ in a terminal. The -c flag creates an archive, -z compresses it with gzip, and -f names the output file.