What .gz files are and why you need a decompression tool

A .gz file is a compressed archive — think of it as a digital shrink-wrap that makes files smaller for storage or email. The .gz format uses a compression method called gzip, which is especially common on Linux and Mac systems. To read what's inside, you need to decompress it first, which means expanding it back to its original size and format.

Your operating system doesn't automatically open .gz files the way it opens a PDF or image. You'll need either a dedicated decompression program or a command-line tool. The method you use depends on what operating system you're running and whether you're comfortable using text commands.

Key Takeaways

  • Windows users can decompress .gz files with free tools like 7-Zip or WinRAR, or use Windows built-in tar command in PowerShell on Windows 10 and later.
  • Mac users can double-click a .gz file in Finder and it will decompress automatically, or use the Terminal command gunzip filename.gz.
  • Linux users typically use the Terminal command gunzip filename.gz or tar -xzf filename.tar.gz depending on the file type.
  • Some .gz files contain a single file, while others are tar archives (.tar.gz) that hold multiple files and folders — the decompression method is the same, but the result differs.

Opening .gz files on Windows

Windows doesn't have built-in support for .gz files, so you have three practical routes: use a third-party program, use the command line, or convert the file online first.

The easiest graphical method is to download 7-Zip, which is free and open-source. Install it, then right-click the .gz file, select "7-Zip," and choose "Extract Here" or "Extract to [folder name]." The decompressed file will appear in the same folder. WinRAR is another option if you already have it installed — it works the same way.

If you're on Windows 10 or later and prefer not to install anything, you can use PowerShell. Open PowerShell as administrator, navigate to the folder containing your .gz file using cd C:\path\to\folder, then run tar -xzf filename.gz. Replace "filename.gz" with your actual file name. This works for both single .gz files and .tar.gz archives.

Opening .gz files on Mac

Mac handles .gz files more gracefully than Windows. The simplest method is to locate the .gz file in Finder and double-click it. macOS will automatically decompress it using the built-in Archive Utility, and the decompressed file will appear in the same folder.

If double-clicking doesn't work or you prefer the command line, open Terminal (find it in Applications > Utilities), navigate to the folder with your file using cd /path/to/folder, then type gunzip filename.gz. The original .gz file will be removed and replaced with the decompressed version.

Opening .gz files on Linux

Linux users typically work with .gz files from the Terminal. The standard command is gunzip filename.gz, which decompresses the file in place. The original .gz file is deleted once decompression finishes.

If your file is a .tar.gz archive (which contains multiple files or folders), use tar -xzf filename.tar.gz instead. This extracts all contents into a folder. The -x flag means extract, -z means decompress gzip, and -f means read from a file.

Understanding .tar.gz vs. single .gz files

A .gz file by itself contains one compressed file. A .tar.gz file is different — it's a tar archive (a container that holds multiple files and folders) that has then been compressed with gzip. Both use the same decompression tools, but the result is different.

When you decompress a .gz file, you get one file back. When you decompress a .tar.gz file, you get a folder containing multiple files and subfolders. The decompression process is identical; the difference is in what was packaged before compression. You can tell which you have by looking at the full filename — if it ends in .tar.gz, it's a tar archive. If it ends in just .gz, it's a single file.

What to do if decompression fails

If you try to decompress a .gz file and get an error, the file may be corrupted or incomplete. Try downloading it again from the source. If the file came as an email attachment, ask the sender to resend it.

Another common issue is file permissions on Linux or Mac. If you get a "permission denied" error, the file may not have read permissions. Run chmod +r filename.gz to make it readable, then try decompressing again. On Windows, this is rarely an issue unless the file is locked by another program — close any programs that might be using it and try again.

Frequently Asked Questions

Can I open a .gz file without decompressing it?

Some archive programs like 7-Zip and WinRAR let you browse inside a .gz file without fully decompressing it to disk. Right-click the file, open it with your archive manager, and you can view the contents. However, to actually use the file inside, you'll need to extract it.

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

.zip and .gz are both compression formats, but .zip is more common on Windows and can hold multiple files in one archive. .gz typically compresses a single file and is more common on Linux and Mac. Both use the same decompression principle — you need a tool to expand them.

Will decompressing a .gz file delete the original?

On Mac and Linux using the gunzip command, yes — the original .gz file is removed after decompression. On Windows using 7-Zip or WinRAR, the original stays. If you want to keep the .gz file, use your archive manager's "Extract" option instead of the command line.

Can I decompress a .gz file online instead of installing software?

Yes. Websites like CloudConvert and Online-Convert let you upload a .gz file and download the decompressed version. This works if you don't want to install software, but be aware you're uploading your file to a third-party server. Only use this method for files that aren't sensitive or private.