A TGZ file is a compressed folder that combines two tools into one

A TGZ file (also written as .tar.gz) is a single file that holds multiple files and folders squeezed down to take up less space. It does this by using two separate compression methods stacked together: TAR bundles everything into one container, then GZIP squeezes that container smaller. The result is a file that's easier to read, email, or store than the original collection would be.

You'll see TGZ files most often when downloading software for Mac or Linux computers, or when someone sends you a collection of documents they want to keep organized together. Windows doesn't recognize TGZ files by default, but free tools can open them on any operating system.

Key Takeaways

  • A TGZ file combines TAR (which bundles files) and GZIP (which compresses them) into a single compressed container.
  • On Mac, double-clicking a TGZ file automatically extracts it; on Windows and Linux, you need a tool like 7-Zip or the built-in tar command.
  • TGZ files preserve folder structure and file permissions, which makes them common for sharing software and source code.
  • The file size of a TGZ is usually much smaller than the original files, but you cannot use the files inside until you extract them first.

How TAR and GZIP work together

TAR is a tool that takes a pile of separate files and folders and wraps them all into a single container file. Think of it like putting documents into a filing cabinet — everything stays organized, but it's now one object instead of many. TAR doesn't make the files smaller; it just groups them.

GZIP then takes that TAR container and compresses it, removing redundant data the way a vacuum-seal bag removes air. The result is a TGZ file that's typically 50 to 80 percent smaller than the original files. Because both steps happen together, you get one file that's both organized and compact.

Opening a TGZ file on different operating systems

On Mac: Double-click the TGZ file and macOS automatically extracts it. The original files appear in the same folder as the TGZ file. You can then delete the TGZ file if you no longer need it.

On Windows: Windows does not recognize TGZ files natively. read and install 7-Zip (free, from 7-zip.org), then right-click the TGZ file, select "7-Zip," and choose "Extract Here." The files will appear in a new folder. Alternatively, some Windows versions include tar support in PowerShell — you can type tar -xzf filename.tar.gz in PowerShell to extract it.

On Linux: Open a terminal, navigate to the folder containing the TGZ file, and type tar -xzf filename.tar.gz. The files extract into the current directory. This is the fastest method on Linux and requires no additional software.

Why TGZ files preserve folder structure and permissions

When you extract a TGZ file, all the folders inside stay organized exactly as they were. If the original had a folder called "Documents" with subfolders inside it, that structure comes back intact. This matters for software installation, because many programs depend on files being in the right places relative to each other.

TGZ files also preserve file permissions — settings that control whether a file can be run as a program or only read. This is especially important on Mac and Linux, where executable files need specific permission flags to work. A ZIP file, by contrast, sometimes loses these permissions during compression, which can break software when you extract it.

TGZ vs. ZIP and other compressed formats

ZIP files are more common on Windows and are easier to open without extra software. However, ZIP does not preserve file permissions reliably, which is why software developers on Mac and Linux prefer TGZ. ZIP also compresses less efficiently, so a TGZ file is usually smaller than the equivalent ZIP.

RAR files offer slightly better compression than TGZ but require paid software to create. TAR files without GZIP compression are larger but faster to extract. For most purposes, TGZ strikes a balance: it compresses well, works across operating systems, and preserves the details that matter for software.

When you'll encounter TGZ files

TGZ files are standard for distributing open-source software, especially on GitHub and similar code repositories. If you read the source code for a program like Python libraries or web frameworks, you'll often get a TGZ file. They're also common in professional environments where Unix-based systems (Mac and Linux) are the standard.

You may also receive TGZ files when someone wants to send you a folder full of documents while keeping everything organized and reducing file size. Backup services sometimes use TGZ format as well, since it compresses efficiently and preserves all file details.

What happens if you open a TGZ file with the wrong tool

If you try to open a TGZ file with a text editor, you'll see gibberish — the compressed data is not human-readable. Some archive tools will show you the contents without extracting them, which is useful if you want to peek inside before committing to extraction. However, you cannot use the files inside until you extract them to your hard drive.

Accidentally opening a TGZ file the wrong way won't damage it. straightforward close whatever opened it and use the correct extraction method for your operating system. The TGZ file itself remains unchanged.

Frequently Asked Questions

Can I open a TGZ file on my phone?

Most phones do not have built-in TGZ support. On iPhone, you would need a third-party app from the App Store. On Android, apps like ZArchiver or RAR can extract TGZ files. However, most people extract TGZ files on a computer first, then transfer the extracted files to their phone.

What's the difference between .tar.gz and .tgz?

They are the same thing. .tar.gz is the full name (showing both TAR and GZIP), while .tgz is a shorter version. Your computer treats them identically, and the extraction process is the same for both.

Do I need to keep the TGZ file after extracting it?

No. Once you extract the files, you can delete the TGZ file if you want to save space. Keep it only if you think you might need to extract it again later or want a backup of the compressed version.

Why is my extracted file still showing as compressed?

Make sure the extraction completed fully. On Windows with 7-Zip, you may need to extract twice — once to get a .tar file, then again to get the final files. On Mac and Linux, a single extraction should give you the final files when ready.