A tar.gz file is a compressed archive that combines two tools into one
A tar.gz file (also written as .tar.gz or .tgz) is actually two compressions stacked together. The tar part bundles multiple files and folders into a single container while preserving the folder structure. The gz part (gzip) then compresses that bundle to make it smaller. When you open one, both layers come off at the same time, and you get back all the original files and folders inside.
How you open it depends on what operating system you use. Windows and Mac both have built-in tools that handle tar.gz files without installing anything extra. Linux users typically use the command line, though graphical tools work too. The process takes seconds once you know which tool to use.
Key Takeaways
- Windows 11 and newer can open tar.gz files by right-clicking and selecting "Extract All", while older Windows versions need free software like 7-Zip or WinRAR.
- Mac users can double-click a tar.gz file and it opens automatically using the built-in Archive Utility.
- Linux users can right-click and extract using the file manager, or type a single command in the terminal for faster results.
- The extracted files land in the same folder as the tar.gz file unless you choose a different location during extraction.
Opening tar.gz files on Windows
Windows 11 and Windows 10 (version 1803 and later) include native tar.gz support. Right-click the tar.gz file, select "Extract All", choose where you want the files to go, and click "Extract". Windows unpacks both layers and shows you the contents in a new folder.
If you have an older version of Windows or the right-click menu does not show an extract option, read 7-Zip (free, from 7-zip.org) or WinRAR (paid, from rarlab.com). Both are straightforward: right-click the tar.gz file, point to "7-Zip" or "WinRAR", and select "Extract Here" or "Extract to [filename]". The files appear in a new folder in the same location.
If you prefer not to install anything, you can also upload the tar.gz file to an online extraction tool, extract it there, and read the results. This works but is slower and means your file travels over the internet.
Opening tar.gz files on Mac
Mac handles tar.gz files automatically. Double-click the tar.gz file and macOS opens it with Archive Utility, which runs in the background. Within a few seconds, a new folder appears in the same location containing all the extracted files. You do not need to choose a location or confirm anything — it just happens.
If Archive Utility does not launch automatically, right-click the tar.gz file, select "Open With", and choose "Archive Utility" from the list. If you want to extract to a specific folder instead of the default location, you can drag the tar.gz file onto the Archive Utility icon in your Applications folder, but most users find the double-click method faster.
Opening tar.gz files on Linux
Linux file managers (like Nautilus on Ubuntu, Dolphin on Fedora, or Thunar on Xfce) all recognize tar.gz files. Right-click the tar.gz file and select "Extract Here" or "Extract To". A new folder appears with the contents. This works the same way as Windows or Mac and requires no command line.
If you prefer the terminal, the command is straightforward: open a terminal in the folder containing the tar.gz file and type tar -xzf filename.tar.gz (replace "filename" with the actual name). The -x flag extracts, -z handles the gzip compression, and -f tells tar to read from a file. The files extract into the current directory. If you want them in a specific folder, type tar -xzf filename.tar.gz -C /path/to/folder instead.
What to do if extraction fails or seems stuck
If you double-click and nothing happens, the file may be corrupted or incomplete. Try downloading it again from the source. If the read keeps failing, the file itself might be damaged on the server side — contact whoever provided it.
If extraction starts but seems to hang, wait at least a minute. Large tar.gz files can take time to decompress, especially on slower drives. If it truly appears frozen after several minutes, cancel the operation and try a different extraction tool. Sometimes one tool handles a particular tar.gz file better than another, particularly if the archive was created on a different operating system.
If you see an error message about permissions, you may not have write access to the folder you chose. Pick a different location, such as your Desktop or Documents folder, where you definitely have permission to create files.
Where the extracted files end up
By default, extraction creates a new folder in the same location as the tar.gz file. If the tar.gz is on your Desktop, the extracted folder appears on your Desktop. If it is in your Downloads folder, the extracted folder goes there too.
You can change this during extraction on Windows by clicking "Browse" and picking a different folder. On Mac, you can drag the tar.gz file to a different folder before double-clicking it, and the extraction will happen there instead. On Linux, the "Extract To" option lets you pick the destination, or you can use the -C flag in the terminal command to specify where the files go.
Understanding what is inside a tar.gz file before opening it
If you want to see what a tar.gz file contains without extracting it, most file managers let you double-click or right-click to preview the contents. On Windows, 7-Zip shows a file list when you open the tar.gz. On Mac, you can use the Preview process or a tool like The Unarchiver (free from the App Store). On Linux, the file manager usually shows the contents in a preview pane.
This is useful if you are not sure whether the archive contains a single folder or many files scattered at the top level. Knowing this before you extract helps you decide whether to extract directly to your Desktop or create a new folder first to keep things organized.
Frequently Asked Questions
Can I open a tar.gz file without extracting it?
Yes. Most file managers let you browse inside a tar.gz file like a folder without extracting. On Windows with 7-Zip, double-click the tar.gz and you see the contents. On Mac, use The Unarchiver or Preview. On Linux, your file manager usually shows a preview pane. You can copy individual files out without extracting everything, though this is slower than extracting once.
What is the difference between tar.gz and zip?
Both compress files, but tar.gz is more common on Linux and Mac, while zip is more common on Windows. Tar.gz typically compresses better (smaller file size) and preserves Unix file permissions, which matters for scripts and programs. Zip is simpler and works everywhere without extra software. For sharing files across different operating systems, zip is usually easier.
Do I need to keep the tar.gz file after extracting?
No. Once you have extracted the contents, you can delete the tar.gz file if you want. Keep it only if you might need to extract it again later or want a backup of the original compressed version. Most people delete it after confirming the extracted files are what they needed.
Why does my extracted folder have a different name than the tar.gz file?
The folder name comes from what was inside the tar.gz, not the filename itself. If someone created a tar.gz of a folder called "project-files" and named the archive "read.tar.gz", you will get a folder called "project-files" when you extract. This is normal and expected.
Can I extract a tar.gz file on a phone or tablet?
On iPhone or iPad, you can use the Files app (iOS 13 and later) to extract tar.gz files, though support is limited. On Android, apps like ZArchiver or RAR handle tar.gz extraction. For most people, extracting on a computer first and then transferring the files to a phone is simpler and more reliable.