TGZ File — What It Is and Where the Three-Letter Extension Came From
A tar archive compressed with gzip, shortened to fit filename rules that stopped mattering decades ago but never fully disappeared.
- Add a file Choose or drop it here
- Pick the format Change it whenever needed
- Download the result After conversion completes
A TGZ File Is a Tar Archive, Compressed With Gzip, in One Filename
A .tgz file is exactly the same thing as a .tar.gz file, with no technical difference between them whatsoever. Both are a tar archive — the Unix bundling format that dates back to Seventh Edition Unix in 1979, which packs files together using 512-byte header records with no compression logic of its own — that has then been run through the gzip compressor as a separate, second step. Tar handles grouping files and preserving their names, structure, and Unix permission bits; gzip handles shrinking the resulting stream. Neither step knows anything about the other, and TGZ is simply the combined result wearing a shorter name.
Gzip itself was released on October 31, 1992, written by Jean-loup Gailly and Mark Adler specifically as a free, patent-unencumbered replacement for the older Unix compress utility, whose underlying LZW algorithm was covered by patents that Unisys began actively enforcing around that period. Every gzip stream, including the one inside a TGZ file, begins with the two magic bytes 0x1F 0x8B, and the compression itself uses DEFLATE, later formally specified in RFC 1951 — a combination of LZ77 back-referencing within a 32 KB sliding window and a Huffman coding pass on top of that.
Because tar bundles files first and gzip compresses second, the two jobs never overlap: renaming a TGZ file or inspecting its contents with a hex editor shows the familiar gzip magic bytes at the very start, and only after decompressing that layer does tar's own header structure — 512-byte records describing each file's name, size, and permissions — become visible. A tool that understands only tar, without gzip support, cannot read a TGZ directly, and a tool that understands only gzip, without tar support, can decompress the bytes but has no way to interpret the resulting stream as separate files.
The Filename-Length Rule That Actually Created the Shortened Extension
The .tgz extension exists because of an old filesystem restriction, not because anyone designed a new format. Early MS-DOS and Windows systems enforced the "8.3" rule — a maximum of eight characters before the dot and three after it — and "archive.tar.gz" simply doesn't fit inside that limit, since the portion before the final extension already runs longer than eight characters once ".tar" is included. Shortening the whole thing to "archive.tgz" solved the problem directly: a three-character name plus a three-character extension fits the 8.3 rule with room to spare.
A related but separate constraint pushed early Unix systems in the same direction even before DOS entered the picture. Unix System V and other early Unix variants historically limited filenames to just 14 characters total, which made the full "archive.tar.gz" awkward there too, encouraging short, combined extensions on Unix systems independently of whatever Windows was doing with its own 8.3 rule.
Both of those filesystem limits have been gone for decades — modern NTFS, ext4, and APFS all support far longer filenames — but by the time they lifted, .tgz was already deeply embedded in package managers, build scripts, and file-naming habits across Unix-like systems, so it never actually went away. Slackware Linux still uses .tgz as its default binary package extension today, and BSD-derived pkgsrc, the package system shared by NetBSD and several other systems since 1997, uses it as one of its standard package formats as well — living examples of a naming convention that outlasted the technical reason it was created for.
GNU tar's own manual reflects the same history directly: its -a / --auto-compress option maps the .tgz suffix to gzip automatically, treating it as fully interchangeable with .tar.gz rather than as some separate or lesser format. That mapping exists specifically because so many real archives in the wild use the shortened spelling, and a modern tool that only recognized the long form would fail against a substantial slice of files it would otherwise need to handle correctly.
What Bundling Files Into a TGZ Gains and What It Doesn't Offer
- Gain — Unix permission bits and ownership carried inside the archive: tar headers record file mode, owner, and group directly, which matters for backups and system migrations where those details need to survive intact.
- Gain — solid compression across the whole bundle: because gzip compresses the entire concatenated tar stream as one pass rather than file by file, similar content across multiple bundled files can compress better than compressing each file separately would.
- Lose — the ability to pull out a single file without decompressing from the start: gzip's stream has no per-file index the way ZIP's central directory does, so extracting one file still means processing the archive from the beginning.
- Lose — the best compression ratio available among tar-based options: bzip2 and xz both typically compress source-code-style content tighter than gzip's fixed 32 KB DEFLATE window can.
- Gain — very fast compression and decompression: gzip is markedly faster in both directions than bzip2 or xz, which is a large part of why it remains the default for so many build tools.
Which Systems Open a TGZ File Without Any Extra Software
Apple's own documented list of file types that Archive Utility opens natively on macOS names .tgz directly, so double-clicking one on a Mac decompresses and unpacks it in a single step with nothing extra installed. Windows File Explorer has no equivalent built-in support at all for TGZ in its graphical interface, though Windows 10 version 1803 and later ships a command-line tar.exe, built on the libarchive project, that reads and writes gzip-compressed tar archives from a terminal without installing anything.
For a graphical option on Windows, 7-Zip and WinRAR both recognize the .tgz extension directly and handle the gzip decompression and tar unpacking together as one action, rather than requiring two separate steps. GNU tar's -a / --auto-compress option performs the same automatic detection based on filename suffix when creating or reading an archive from the command line on Linux or macOS.
Why a TGZ File Won't Open on Some Systems, and the Actual Cause
A common, well-documented complaint involves someone on Windows double-clicking a .tgz file and having nothing happen, or having it open as an unfamiliar binary blob in a text editor — this isn't file corruption; it's simply the absence of any built-in File Explorer handler for the format, resolved by installing 7-Zip or WinRAR rather than by anything related to the file itself.
A second recurring issue involves confusion over whether ".tgz" and ".tar.gz" need to be treated differently by an upload form or automated script — they don't, since the bytes are identical either way, and any script checking file extensions should simply accept both spellings as equivalent rather than requiring one specific form. A third pattern shows up when a very old or minimal Unix-like system's gzip build predates certain compression options a newer tool used to create the file, occasionally causing an older decompressor to reject a TGZ it can't fully parse — recompressing with a more basic gzip compression level resolves the overwhelming majority of these specific rejection cases.
TGZ Set Beside the Other Common Ways to Compress a Tar Archive
| Feature | TGZ (tar + gzip) | TBZ2 (tar + bzip2) |
|---|---|---|
| Compression algorithm | DEFLATE (LZ77 + Huffman) | Burrows-Wheeler transform + Huffman |
| Compression speed | Fast | 4-12x slower than gzip |
| Typical ratio | Lower | 20-30% smaller than gzip on similar data |
| Magic bytes | 0x1F 0x8B | "BZh" |
| Reason extension was shortened | 8.3 DOS limit and old Unix 14-char limit | Same historical filename-length pressure |
Common Questions About What a TGZ File Actually Is
Is a .tgz file different from a .tar.gz file?
No. They are byte-for-byte identical formats; .tgz is simply a shortened spelling created to fit old 8.3 DOS filename rules and 14-character Unix limits that no longer apply to any current filesystem.
Why can't I just rename a .tgz file to .zip to open it?
Renaming doesn't change the actual bytes inside the file. A ZIP reader expects PKWARE's local-header-and-central-directory structure, not a gzip-compressed tar stream, so it will fail to open a renamed TGZ regardless of the new extension.
Do I need special software to open a TGZ file?
Not on macOS, where Archive Utility opens it natively. On Windows, File Explorer has no built-in support, so 7-Zip, WinRAR, or the command-line tar.exe included since Windows 10 version 1803 is needed.
Why do Slackware and some other Linux distributions still use .tgz for packages?
Slackware's package format has used .tgz since its early versions, and switching a well-established package naming convention carries real compatibility costs, so the historical extension simply stuck even after the filename-length restrictions that originally motivated it stopped applying.
Is TGZ the same thing as a ZIP file with a different name?
No. They're structurally different formats entirely — TGZ layers gzip compression over a tar bundle in one continuous stream, while ZIP compresses and indexes each file independently inside its own container. The two aren't interchangeable just by renaming the extension.