The fastest way to unzip a tar.gz file depends on your operating system

A tar.gz file (also written as .tar.gz or .tgz) is actually two compressions stacked together: tar bundles multiple files into one archive, and gzip compresses that bundle. Most operating systems can unzip these files with a single command or click, though the method differs slightly between Windows, Mac, and Linux.

On Mac and Linux, you open the Terminal and run a one-line command. On Windows 10 and later, you can right-click and extract directly. Older Windows versions need a separate tool like 7-Zip or WinRAR. The file will unpack into a folder in the same location where the tar.gz file sits.

Key Takeaways

  • Mac and Linux users can unzip tar.gz files by opening Terminal, navigating to the file's folder, and typing tar -xzf filename.tar.gz.
  • Windows 10 and later can right-click a tar.gz file, select "Extract All", and choose where to save the unpacked folder.
  • Windows 7 and earlier versions need a third-party tool like 7-Zip, which you download and install before right-clicking to extract.
  • The unpacked files will appear in a new folder in the same location as the original tar.gz file.
  • If extraction fails, check that the file name ends in .tar.gz and that you have permission to write files to that folder.

Unzipping on Mac

The easiest method on Mac is to double-click the tar.gz file in Finder. macOS will automatically unzip it using the built-in Archive Utility, and the unpacked folder will appear in the same location within seconds. This works for most tar.gz files without any additional software.

If double-clicking does not work, or if you want to see what is happening, open Terminal (find it in Applications > Utilities > Terminal). Type cd followed by a space, then drag the folder containing your tar.gz file into the Terminal window. Press Enter. Then type tar -xzf filename.tar.gz, replacing "filename" with the actual name of your file. Press Enter and wait for the prompt to return — that means the extraction is complete.

Unzipping on Linux

Open a terminal window and navigate to the folder where your tar.gz file is located. Type cd /path/to/folder, replacing the path with the actual location. Then type tar -xzf filename.tar.gz, again replacing "filename" with your actual file name.

The flags in that command mean: -x extracts, -z handles gzip compression, and -f specifies the file name. You can combine them as shown, or type them separately as tar -x -z -f filename.tar.gz. The unpacked files will appear in a new folder (or folders) in the same directory.

Unzipping on Windows 10 and later

Windows 10 and Windows 11 have built-in support for tar.gz files. Right-click the tar.gz file, select "Extract All", and choose where you want the unpacked folder to go. Windows will create a new folder with the contents inside.

If "Extract All" does not appear in the right-click menu, your file may not be recognized as a tar.gz archive. Check that the file name actually ends in .tar.gz (not just .gz). If it does and the option still does not show, try renaming the file to add the .tar extension before the .gz — for example, change "archive.gz" to "archive.tar.gz" — then right-click again.

Unzipping on Windows 7 and earlier

Windows 7 and earlier versions do not have built-in tar.gz support. You will need to download a free tool. 7-Zip is reliable and widely used: go to 7-zip.org, download the installer for your Windows version (32-bit or 64-bit), and run it. Once installed, right-click your tar.gz file, hover over "7-Zip", and select "Extract Here" or "Extract to [folder name]".

Other options include WinRAR (paid, but has a free trial) and PeaZip (free and open-source). All three work the same way: install, right-click the tar.gz file, and choose extract. The unpacked files will appear in a new folder in the same location.

What to do if extraction fails

If you see an error message or the extraction does not complete, first check the file name. It must end in .tar.gz (or .tgz). If it ends only in .gz, it may be a gzip file that contains a single file, not a tar archive — try extracting it once to see what is inside.

Second, check that you have permission to write files to the folder where the tar.gz file is located. If the file is in a protected system folder or on a read-only drive, move it to your Downloads folder or Desktop and try again. Third, make sure the file downloaded completely — if it was interrupted, the file may be corrupted and cannot be extracted. Try downloading it again from the source.

Understanding what happens when you extract

When you unzip a tar.gz file, you are reversing the compression process. The tar.gz file itself remains unchanged — extraction creates a new folder (or set of files) alongside it. You can delete the tar.gz file after extraction if you no longer need it, but keep the unpacked folder if you want to use the files inside.

Some tar.gz files unpack into a single folder containing everything. Others unpack into multiple files and folders at the top level. Check what is inside the unpacked folder before moving or deleting anything, especially if you are extracting software or configuration files that may have specific folder structures.

Frequently Asked Questions

Can I unzip a tar.gz file without using the command line?

Yes. On Mac, double-clicking usually works. On Windows 10 and later, right-click and select "Extract All". On Windows 7 and earlier, or if the graphical method fails, you need a tool like 7-Zip. The command line is faster if you are comfortable with it, but not required.

What is the difference between tar.gz and zip?

Both compress files, but tar.gz is more common on Mac and Linux, while zip is more common on Windows. A tar.gz file is actually two compressions combined (tar bundles, gzip compresses). A zip file does both in one step. Most modern systems can open both formats.

Why does my tar.gz file have a .tgz extension instead?

.tgz and .tar.gz are the same thing — .tgz is just a shorter way to write it. Your operating system will treat them identically. Extract it the same way you would a .tar.gz file.

Can I extract a tar.gz file on my phone or tablet?

Yes, but you need an app. On iPhone or iPad, search the App Store for "tar" or "archive" to find extraction apps. On Android, try ZArchiver or RAR. These apps work similarly to desktop tools: open the app, navigate to your tar.gz file, and tap to extract.

What if the extracted folder is empty or has strange characters in the file names?

An empty folder usually means the tar.gz file was corrupted during download. Try downloading it again. Strange characters in file names often happen when the archive was created on a different operating system. The files are usually fine — the names just display oddly. Try opening them anyway, or rename them manually if needed.