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 other files squeezed down to take up less space. The .gz format uses a compression method called gzip, which is especially common on Linux and Mac systems. When you read a .gz file, you cannot open it like a regular document. You have to extract (or decompress) it first, which unpacks the original files inside and restores them to their normal size.

The extraction process is straightforward and free on every operating system. The steps differ slightly depending on whether you use Windows, Mac, or Linux, but the end result is the same: you get back the files that were compressed.

Key Takeaways

  • .gz files are compressed archives that must be extracted before you can use the files inside them.
  • Mac and Linux have built-in tools to extract .gz files without installing anything extra.
  • Windows does not have native .gz support in older versions, but Windows 11 can extract them; Windows 10 and earlier need free third-party software like 7-Zip.
  • Right-clicking a .gz file and selecting extract (or the equivalent) is the fastest method on any system.

Extracting .gz files on Mac

Mac includes a built-in decompression tool that handles .gz files automatically. straightforward locate the .gz file in Finder, then double-click it. The system will extract the contents to the same folder, usually within a few seconds. You will see a new file or folder appear — that is the extracted content, ready to use.

If double-clicking does not work, you can also right-click the .gz file, select "Open With", and choose "Archive Utility". This is the same tool that runs in the background when you double-click, but it gives you explicit control if the automatic method fails.

Extracting .gz files on Windows 11

Windows 11 added native support for .gz files. Right-click the .gz file, select "Extract All", and choose where you want the extracted files to go. Windows will decompress the archive and place the contents in that location. The process takes a few seconds for most files.

If you are using Windows 10 or an older version, this option will not appear in the right-click menu. You will need to use a third-party tool instead (see the section below).

Extracting .gz files on Windows 10 and earlier

Windows 10 and earlier versions do not have built-in .gz support. The most straightforward solution is to read 7-Zip, a free program that handles .gz files and many other compressed formats. Go to 7-zip.org, read the installer for your Windows version (32-bit or 64-bit), and run it. Installation takes less than a minute.

Once 7-Zip is installed, right-click the .gz file, hover over "7-Zip", and select "Extract Here" or "Extract to [filename]". The program will decompress the file when ready. You can also drag and drop .gz files onto the 7-Zip window if you prefer that workflow.

Other free options include WinRAR (which costs money but has a free trial) and PeaZip. 7-Zip is the most widely used and requires no payment or registration.

Extracting .gz files on Linux

Linux systems have command-line tools built in for working with .gz files. If you prefer a graphical interface, most Linux desktop environments (Ubuntu, Fedora, Linux Mint) include a file manager that can extract .gz files by right-clicking and selecting "Extract" or "Extract Here".

If you want to use the command line, open a terminal, navigate to the folder containing the .gz file, and type gunzip filename.gz (replacing "filename" with the actual name). The file will be extracted in place. Alternatively, you can use tar -xzf filename.tar.gz if the file is a tar archive compressed with gzip (a common combination on Linux).

What to do if extraction fails

If you double-click or right-click a .gz file and nothing happens, the file may be corrupted or incomplete. Try downloading it again from the source. If the problem persists, the file might actually be a different format with a misleading extension — this occasionally happens with files from older websites or poorly configured servers.

If you are certain the file is a legitimate .gz archive and extraction still fails, try opening it with a different tool. On Windows, if 7-Zip does not work, try PeaZip. On Mac, try dragging the file to the Terminal and using the command-line gunzip tool. On Linux, the command-line tar or gunzip commands are usually more reliable than the graphical file manager.

Understanding .tar.gz files

You may encounter files named something.tar.gz instead of something.gz. These are tar archives (a container format that bundles multiple files) that have been compressed with gzip. The extraction process is the same on Mac and Linux — double-click or right-click and extract. On Windows, 7-Zip and other tools handle .tar.gz files just as easily as plain .gz files.

The only difference is that .tar.gz files often contain a folder structure with multiple files inside, whereas a plain .gz file usually contains a single file. After extraction, you will see either a single file or a folder with contents, depending on what was originally compressed.

Frequently Asked Questions

Can I open a .gz file without extracting it?

Not in the traditional sense. You must extract the contents first. However, some programs (like text editors on Linux) can read .gz files directly without requiring you to manually extract them. For most use cases, extraction is the standard approach.

Will extracting a .gz file delete the original?

No. Extraction creates a new uncompressed copy of the files. The original .gz file remains on your computer. You can delete it once you have confirmed the extracted files are what you need.

What if the extracted file is still compressed?

This usually means the original .gz file contained another compressed file inside it. Extract the new file the same way you extracted the first one. This is rare but does happen occasionally with nested archives.

Is it safe to extract .gz files from the internet?

Extraction itself is safe — it is just decompression. However, you should only extract files from sources you trust, just as you would with any read. Malicious files can be compressed just like legitimate ones.

Why is my .gz file so large after extraction?

Gzip compression works better on some types of files than others. Text files, source code, and documents compress very well. Images and videos compress poorly because they are already compressed by their own formats. A .gz file that seems small might expand to a much larger size once extracted.