What a .gz file is and why you need to unzip it

A .gz file is a compressed archive — a single file that contains one or more other files squeezed down to take up less space. The .gz format uses an algorithm called gzip, which is especially common on Linux and Mac systems. When you download a .gz file, you need to decompress it to access what's inside.

Most operating systems can handle .gz files without installing anything extra. Windows, Mac, and Linux all have built-in tools that can unzip them, though the method differs slightly on each one. If the built-in approach doesn't work for you, third-party programs are available and free to download.

Understanding how to unzip these files matters because many software projects, documentation files, and system tools are distributed in .gz format. You'll run into them regularly if you work with open-source software, download tools from Linux repositories, or receive compressed files from developers.

Key Takeaways

  • Windows 10 and 11 can unzip .gz files by right-clicking and selecting "Extract All", though older Windows versions need third-party software like 7-Zip.
  • Mac users can double-click a .gz file and it will automatically decompress using the built-in Archive Utility.
  • Linux users can unzip .gz files from the terminal using the command gunzip filename.gz or tar -xzf filename.tar.gz for bundled archives.
  • If your operating system doesn't recognize .gz files, free programs like 7-Zip for Windows or The Unarchiver for Mac can open them.
  • The original .gz file remains on your computer after extraction unless you manually delete it to save disk space.

Unzipping .gz files on Windows

Windows 10 and 11 have built-in support for .gz files. Locate the .gz file on your computer, right-click it, and look for an "Extract All" option in the context menu. Click it, choose where you want the uncompressed file to go, and Windows will decompress it automatically within a few seconds.

If you don't see "Extract All" when you right-click, your version of Windows may not support .gz natively. Windows 7 and earlier versions typically don't recognize .gz files without additional software. In that case, download 7-Zip (free, from 7-zip.org) or WinRAR (paid, but includes a trial period). Install the program, right-click the .gz file, and select "7-Zip > Extract Here" or the equivalent option in your chosen program.

After extraction, you'll have a new file or folder in the same location as the original .gz file. The original .gz file remains on your computer unless you delete it manually. You can safely delete the .gz file once you've confirmed the uncompressed version works correctly.

Unzipping .gz files on Mac

Mac handles .gz files automatically through a built-in tool called Archive Utility. Simply double-click the .gz file and macOS will decompress it in the background. Within a few seconds, you'll see a new uncompressed file appear in the same folder as the original.

If double-clicking doesn't work, or if you prefer a visual interface with more control, download The Unarchiver from the Mac App Store (free). Open The Unarchiver, drag your .gz file into it, and it will decompress the file for you. The Unarchiver also handles many other archive formats if you encounter them later.

On newer Macs with Apple Silicon chips, both Archive Utility and The Unarchiver work without any issues. The process is the same regardless of which Mac model you own.

Unzipping .gz files on Linux

Linux users typically work with .gz files from the terminal. Open a terminal window and navigate to the folder containing your .gz file using the cd command. Then run one of these commands depending on what you're decompressing:

  • For a simple .gz file: gunzip filename.gz
  • For a .tar.gz file (a compressed archive containing multiple files): tar -xzf filename.tar.gz

The decompressed file or folder will appear in the same directory. The original .gz file will be removed after using gunzip, but will remain after using tar. If you want to keep the original .gz file when using gunzip, add the -c flag: gunzip -c filename.gz > filename.

Understanding .tar.gz files

You may encounter files ending in .tar.gz instead of just .gz. These are archives that have been compressed twice: first bundled together with tar (a tool that groups multiple files into one), then compressed with gzip. They're common in Linux and open-source software because they preserve file permissions and directory structures.

On Windows and Mac, your extraction tool should handle .tar.gz files the same way it handles .gz files — just right-click and extract, or double-click. On Linux, use the tar -xzf command shown above rather than gunzip, because gunzip will only remove the .gz layer and leave you with a .tar file that still needs unpacking.

What to do if extraction fails

If you try to unzip a .gz file and nothing happens, the file may be corrupted or incomplete. Try downloading it again from the original source. If the problem persists after a fresh download, the file itself may be damaged and unrecoverable.

If your operating system doesn't recognize the .gz format at all, install one of the third-party tools mentioned above. These programs are designed to handle many archive formats and are more likely to work with unusual or older .gz files. On Windows, 7-Zip is lightweight and handles nearly every compression format in use.

Frequently Asked Questions

Can I unzip a .gz file without installing anything?

Yes, on Windows 10 and 11, Mac, and Linux, you can unzip .gz files using built-in tools. Windows 10 and 11 have native support, Mac has Archive Utility, and Linux has gunzip and tar. Older Windows versions require third-party software.

What's the difference between .gz and .zip?

.zip and .gz are both compression formats, but .zip is more common on Windows and can compress multiple files at once. .gz typically compresses a single file and is more common on Linux and Mac. Most modern operating systems can open both formats.

Do I need to delete the original .gz file after unzipping?

No, but you can if you want to save disk space. The unzipped file is a separate copy, so the original .gz file will remain on your computer until you manually delete it. Deleting the .gz file won't affect the uncompressed version.

Why won't my .gz file unzip?

The file may be corrupted, incomplete, or your operating system may not recognize the format. Try downloading it again from the source. If that doesn't work, install 7-Zip on Windows, The Unarchiver on Mac, or use the terminal on Linux to attempt extraction.

Can I unzip a .gz file on my phone?

Most phones don't have built-in .gz support, but apps exist for both iPhone and Android that can decompress these files. Search your device's app store for "unzip" or "archive" to find options. Many of these apps are free.