What a .gz file is and why you need to extract it
A .gz file is a compressed archive — a single file that holds one or more files squeezed down to take up less space. The .gz format uses a compression method called gzip. When you download a .gz file, you cannot open the files inside it directly. You have to extract (or decompress) it first, which recreates the original files at their full size.
Most .gz files you encounter online contain either a single large file or a folder full of files. After extraction, you will have access to whatever was compressed inside. The extraction process does not delete the .gz file — it creates new, uncompressed copies alongside it.
Key Takeaways
- Windows 10 and 11 can extract .gz files using the built-in File Explorer, but older Windows versions need third-party software like 7-Zip or WinRAR.
- Mac users can double-click a .gz file in Finder and it will extract automatically using the built-in Archive Utility.
- Linux users can extract .gz files from the terminal using the gunzip or tar command, or right-click in a file manager for a graphical option.
- After extraction, you will have a new folder or file with the original name — the .gz file remains unchanged on your computer.
Extracting .gz files on Windows
Windows 10 and 11 have built-in support for .gz files. Right-click the .gz file in File Explorer, select Extract All, and choose where you want the extracted files to go. Windows will create a new folder or file with the same name as the archive, minus the .gz extension. This takes a few seconds to a few minutes depending on the file size.
If you are using Windows 7 or earlier, or if the Extract All option does not appear, you will need a third-party tool. 7-Zip is free and widely used. Download it from 7-zip.org, install it, then right-click your .gz file and select 7-Zip > Extract Here or Extract to [folder name]. WinRAR is another option, though it is not free — a trial version is available at rarlab.com.
After extraction, open the folder that was created and you will see the original files. You can delete the .gz file if you no longer need it, or keep it as a backup.
Extracting .gz files on Mac
Mac handles .gz files automatically. Simply double-click the .gz file in Finder, and the built-in Archive Utility will extract it in seconds. A new file or folder with the original name will appear in the same location as the .gz file.
If double-clicking does not work, open Finder, right-click the .gz file, and select Open With > Archive Utility. You can also drag the .gz file onto the Archive Utility icon if you have it in your Applications folder (Applications > Utilities > Archive Utility).
Some .gz files contain a tar archive inside them (these are named .tar.gz or .tgz). Mac will extract both layers automatically, so you end up with the original files or folder without any extra steps.
Extracting .gz files on Linux
Linux users have multiple options. The simplest graphical method is to right-click the .gz file in your file manager (Files, Nautilus, Dolphin, or Thunar depending on your desktop) and select Extract Here or Extract To. The extracted files will appear in the same folder.
If you prefer the command line, open a terminal and navigate to the folder containing the .gz file. Use the command gunzip filename.gz to extract a single file, or tar -xzf filename.tar.gz if the file is a tar archive compressed with gzip (the .tar.gz format). After the command runs, the extracted files will be in that directory.
If you want to keep the original .gz file and create a copy during extraction, use gunzip -k filename.gz (the -k flag means "keep"). This is useful if you think you might need the compressed version later.
What to do if extraction fails
If you try to extract a .gz file and get an error, the file may be corrupted or incomplete. Try downloading it again from the source. If the error persists, check that you have enough free disk space — extraction requires temporary space equal to the uncompressed file size.
On Windows, if you see a message that the file is not a valid archive, try a different tool. 7-Zip often succeeds where Windows' built-in extractor fails. On Mac or Linux, a corrupted .gz file will usually produce an error message in the terminal or file manager that tells you the file is invalid.
If the .gz file came from an untrusted source, scan it with antivirus software before extraction. While .gz is just a compression format and cannot carry viruses by itself, the files inside it could be malicious.
Understanding .tar.gz files
You may encounter files named .tar.gz or .tgz. These are tar archives (a format that bundles multiple files into one) that have been compressed with gzip. They work the same way as regular .gz files — extract them using the same methods described above, and you will get the original folder or files.
On Windows with 7-Zip, right-click and select Extract Here. On Mac, double-click as usual. On Linux, use tar -xzf filename.tar.gz in the terminal. The result is the same: the original files appear, ready to use.
Frequently Asked Questions
Can I open a .gz file without extracting it?
Not in the traditional sense. You cannot read the contents of a .gz file directly. However, some text editors and archive managers let you preview files inside without full extraction. For most purposes, you need to extract it first.
Will extracting a .gz file delete the original?
No. Extraction creates new, uncompressed copies of the files. The .gz file stays on your computer unless you manually delete it. You can safely delete the .gz file after extraction if you do not need the compressed version anymore.
What if the extracted file is still compressed?
This usually means the .gz file contained another compressed file inside it, such as a .zip or .rar. Extract that file using the same method for its format. Alternatively, the file may have a double extension like .tar.gz — extract it once and you should have the original files.
Is it safe to extract .gz files from the internet?
Extraction itself is safe — .gz is just a compression format. However, the files inside could be malicious. Only extract .gz files from sources you trust, and scan them with antivirus software if you are unsure about the source.
Why is my .gz file so large after extraction?
The uncompressed files are simply larger than the compressed version. .gz compression works well for some file types (text, code, documents) and poorly for others (images, video, audio that are already compressed). The extracted size is the true size of the original files.