A .gz file is a compressed archive that your computer can open with built-in tools or free software
A .gz file (also called a gzip file) is a single compressed file, not a folder of multiple files like a .zip. When you read a .gz file, your operating system can usually open it without installing anything extra. On Mac and Linux, the tools are already there. On Windows, you have a few straightforward options depending on which version you're running and what you prefer to use.
The steps differ slightly by operating system, but the goal is the same: decompress the file so you can use what's inside. A .gz file typically contains one file (often a document, installer, or data file), though it can occasionally hold a .tar archive, which itself contains multiple files bundled together.
Key Takeaways
- Mac and Linux users can open .gz files by right-clicking and selecting decompress or extract, or by typing a command in the terminal.
- Windows 10 and later can open .gz files natively through File Explorer, but Windows 7 and earlier need third-party software like 7-Zip or WinRAR.
- If you see a .tar.gz file, you have a compressed archive containing multiple files — the same tools that open .gz will handle it.
- After decompression, delete the .gz file if you no longer need it, since the decompressed version takes up the space you actually need.
Opening a .gz file on Mac
On Mac, the simplest method is to use the Finder. Locate the .gz file, right-click it, and select "Open With" and then "Archive Utility." The file will decompress automatically, and a new file (without the .gz extension) will appear in the same folder. This usually takes a few seconds.
If you prefer the terminal, open Terminal (found in Applications > Utilities) and type gunzip filename.gz, replacing "filename" with the actual name of your file. Press Enter, and the file decompresses in place. The terminal method is faster if you're opening many files at once.
Opening a .gz file on Linux
Linux users have the terminal as the primary tool. Open your terminal and navigate to the folder containing the .gz file using cd /path/to/folder. Then type gunzip filename.gz and press Enter. The file decompresses when ready.
If you prefer a graphical interface, most Linux desktop environments (Ubuntu, Fedora, Mint) include a file manager that recognizes .gz files. Right-click the file and select "Extract Here" or "Open With Archive Manager." The decompressed file appears in the same location.
Opening a .gz file on Windows 10 and later
Windows 10 and Windows 11 can open .gz files without extra software. Right-click the .gz file in File Explorer, select "Extract All," and choose where you want the decompressed file to go. Click "Extract" and wait for the process to finish. The decompressed file will be in the location you selected.
If the "Extract All" option doesn't appear, or if you want more control over the process, read 7-Zip (free, from 7-zip.org). Install it, right-click your .gz file, select "7-Zip," and then "Extract Here" or "Extract To." The file decompresses into the same folder or a subfolder, depending on which option you choose.
Opening a .gz file on Windows 7 and earlier
Windows 7 and earlier versions do not have built-in .gz support. You need third-party software. 7-Zip and WinRAR are the most common choices. Both are free to read (7-Zip is completely free; WinRAR has a free trial that continues to work after expiration). Install either one, then right-click your .gz file and select the extract option from the context menu.
After installation, the software integrates into File Explorer's right-click menu, so opening .gz files becomes a one-click process. If you plan to work with compressed files regularly, this is worth the few minutes of setup.
What to do with .tar.gz files
A .tar.gz file (sometimes written as .tgz) is a compressed archive that contains multiple files or folders. The .tar part bundles everything together; the .gz part compresses it. The same tools that open .gz files will handle .tar.gz files automatically.
On Mac or Linux, gunzip filename.tar.gz decompresses it. On Windows 10 and later, right-click and select "Extract All." On Windows 7 and earlier, use 7-Zip or WinRAR. After decompression, you'll see a .tar file, which you can open again with the same tool, or the software may decompress both layers at once and show you the folder inside.
Cleaning up after decompression
Once you've decompressed a .gz file and confirmed that the new file works correctly, you can delete the .gz file. It's now redundant — the decompressed version is what you need. Deleting it frees up disk space, since the .gz file was taking up room even though it was compressed.
If you downloaded the .gz file from the internet and plan to use it again later, consider keeping it in a backup location (like an external drive or cloud storage) instead of on your main computer. This way you have the original if something goes wrong with the decompressed version.
Frequently Asked Questions
What's the difference between .gz and .zip?
.gz typically compresses a single file, while .zip can compress multiple files and folders into one archive. Both reduce file size, but .zip is more common for sharing multiple items. .gz is often used for software installers and data files on Linux and Mac.
Can I open a .gz file without decompressing it?
Not directly — you need to decompress it first to use what's inside. However, some archive managers let you preview the contents before extracting. If you want to keep the original .gz file, decompress it to a new location instead of replacing it.
Why is my .gz file still showing after I extracted it?
The decompression process creates a new file but doesn't automatically delete the .gz original. You can delete the .gz file manually once you've confirmed the decompressed version is correct. Both files will exist in the same folder until you remove one.
What if the decompressed file won't open?
The file inside the .gz may be corrupted, or you may need specific software to open it. Check the filename and extension — if it's a .txt or .pdf, use a text editor or PDF reader. If it's a .tar, decompress it again. If it's an installer (.exe, .dmg, .sh), run it directly.
Can I compress a file back into .gz format?
Yes. On Mac or Linux, type gzip filename in the terminal. On Windows, right-click in 7-Zip or WinRAR and select "Add to Archive," then choose .gz as the format. The original file remains; the .gz version is created alongside it.