Ffile2fix
Sign in Get started

What is a .tar.gz file?

A .tar.gz file, or tarball, is a TAR archive that has been compressed with gzip. It is the standard way to ship source code, Linux software releases and server backups, and it keeps Unix permissions and symlinks intact.

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

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.

macOS

Double-click to extract it with Archive Utility, or run tar -xzf archive.tar.gz in Terminal.

Linux

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

File2fix tools for .tar.gz files

Frequently asked questions

What is the difference between .tar.gz and .tgz?

None. Both are a TAR archive compressed with gzip; .tgz is just the shorter extension. The same tar -xzf command extracts either one.

Can I extract a single file from a .tar.gz?

Yes. Run tar -xzf archive.tar.gz path/inside/archive/file.txt with the path exactly as tar -tzf lists it. Because gzip has no index, tar still has to read through the archive to find it.

Is .tar.gz better than ZIP?

For Linux servers and source code it is usually better, because it preserves permissions and symlinks and often compresses slightly better. ZIP is more convenient for Windows users and for opening single files quickly.

See all file types β†’ Β· Browse error fixes β†’