Key facts
- Two layers: tar joins the files into one stream, then gzip compresses the whole stream, so a single damaged byte can break everything after it.
- MIME type is application/gzip (application/x-gzip on older servers); .tgz is the same format with a shorter extension.
- TAR keeps file permissions, owners, timestamps and symbolic links, which ZIP does not reliably preserve.
- There is no central index, so listing the contents means decompressing the entire file.
- Created with tar -czf by Linux and macOS tools, CI pipelines, hosting control panels and GitHub release downloads.
How to open a .tar.gz file
Windows 10 and 11 include tar.exe, so run tar -xzf archive.tar.gz in Command Prompt or PowerShell. Recent Windows 11 builds also open it in File Explorer, and 7-Zip works on any version.
Double-click to extract it with Archive Utility, or run tar -xzf archive.tar.gz in Terminal.
Run tar -tzf archive.tar.gz to list the contents and tar -xzf archive.tar.gz -C target/ to extract into a folder.
Common problems and fixes
- "gzip: stdin: unexpected end of file" / "Unexpected EOF in archive"
- The file is truncated, usually from an interrupted download or upload. Compare its size or checksum with the source and download it again.
- "gzip: stdin: not in gzip format"
- The file is not actually gzip: it may be a plain .tar, a ZIP, or an HTML error page saved with the wrong name. Run file archive.tar.gz to see the real type and use the matching command, such as tar -xf for a plain tar.
- "Cannot change ownership" or permission errors while extracting
- The archive stores owners that do not exist on your machine. Extract as a normal user, or add --no-same-owner to tar.
- Windows tools show a single .tar inside the .gz
- Some tools remove only the gzip layer. Open the resulting .tar file as a second step, or use tar -xzf, which handles both layers at once.
Often converted to or from: ZIP, TAR, TAR.XZ, TAR.BZ2, 7Z