Did you just download a GZ file, and now you're unsure how to open it? Is a GZ file even safe to open? Worry not, as we'll cover what a GZ file is and how to open it on Windows, macOS, and Linux.

You can easily open a GZ file on any of the popular operating systems, and there are even multiple ways to do this. So, let's check them all out.

What Is a .GZ File?

A GZ file is an archive compressed using the gzip compression technology. Like other compressed files, this archive type helps you combine your files and reduce the size of your files by compressing them.

And, like RAR and ZIP, you can open and extract files from a GZ archive using both built-in as well as third-party tools on your computers.

How to Open a GZ File on Windows

There are various ways to open and create compressed files on Windows, and that applies to .GZ files as well. If you prefer commands, you can use the Command Prompt method. In case you’re a graphical user interface person, you can use a free third-party app to access your GZ archives.

Unzip a GZ File on Windows Using the Terminal or Command Prompt

There’s a command called tar that you can use within the Windows Terminal or Command Prompt to extract your GZ archive contents. This command is built into your operating system, so you don’t need to install anything to use it.

Once you have your GZ file handy with you, use these steps to extract your file’s contents:

  1. Open the Start menu, search for Command Prompt (or Terminal), and click Run as administrator.
  2. Click Yes in the prompt.
  3. Type the following command replacing SOURCE with the source GZ file and DESTINATION with the target folder and hit Enter.
            tar -xvzf PATH\TO\SOURCE -C PATH\TO\DESTINATION
        
    Unzip GZ using the Command Prompt
  4. If all goes well, your extracted files should be available in your destination folder.

If your target folder looks empty even after successfully running the command, that’s probably because you ran the it without admin privileges. Open the Command Prompt with administrative rights, and you should be fine.

How to Open GZ Files Using Apps on Windows

If you'd rather unzip a GZ file on your Windows using apps, there are lots of free alternatives. 7-Zip is a pretty good choice for this task, as it’s easy, free, and open-source.

Here’s how you use this app to decompress GZ archives on your PC:

  1. Download and install the free 7-Zip tool on your PC.
  2. Open the tool and navigate to your GZ file using the built-in file manager.
    Unzip GZ using 7-zip
  3. Select your GZ file in the list, and click Extract in the top toolbar.
  4. Choose the target folder in the Extract to section.
  5. Tweak other options if you want, and then click OK.
  6. Open the target folder, and you should have all your GZ file’s contents there.

Alternatively, you can use 7zip's context menu tools on Windows to unzip a .GZ files. Be sure to select this option during installation, and then you'll be a right-click away from opening GZ files with 7zip.

Extracting GZ Files on macOS

Archive types like RAR require an app to decompress on macOS, but you don’t need to do that for GZ.

You can open GZ files without using any third-party tools on your Mac. Again, you can either use the Terminal to extract files from a GZ archive or the built-in macOS tool to decompress your files.

How to Unzip a GZ File on macOS Using the Built-In Tool

Like ZIP, you can simply double-click on your GZ archive, and it should start extracting its content. You can do this from any Finder window on your Mac, and your extracted files will be available in a new folder in the same directory as the original GZ archive.

If that doesn’t work for you, ensure you’re opening your GZ file with the built-in extracting tool—the same one used to compress files on macOS. If you aren’t sure what’s the default archive handler on your Mac, simply right-click on your GZ archive and select Open With > Archive Utility to open the archive with the built-in tool.

macOS context menu gz file open unzip extract

Another way to open a GZ archive in macOS is to use free apps. There are popular options, like The Unarchiver or Keka (paid on the macOS App Store but free on the developer's site). Both apps support several other formats as well, including ZIP and RAR.

Using the Terminal to Unzip a GZ File on macOS

Using the Terminal, you can extract all the files inside your GZ archive using a single command. Your files will be placed in a new folder in the same directory as the original GZ file.

Here’s how you utilize this method:

  1. Click the Launchpad in the Dock, search for Terminal, and click the utility.
  2. Enter the following command, replace source.gz with the path to your GZ file, and hit Enter.
            gunzip -k source.gz
        
    Unzip GZ using the macOS Terminal
  3. The Terminal will start extracting files from your specified GZ archive.

How to Unzip a GZ File on Linux

If you’re a Linux user who wants to open a GZ file, you can use a command in the Terminal to extract all the files from your GZ archive. Some distros also have built-in options in the context menu to unzip .GZ files.

Opening .GZ Files in the Command Line on Linux

Gzip is the command that lets you decompress the contents of a GZ archive on your Linux machine.

Here’s how you use this command and start extracting your compressed files:

  1. Open the Terminal app—any distros have the Ctrl + Alt + T shortcut for this.
  2. Type the following command, replace SOURCE.GZ with the path to your actual GZ file, and hit Enter.
            gzip -dk SOURCE.GZ
        
  3. Your GZ archive should now be extracted.
  4. If yours is a .TAR.GZ file, you need to use a different command to extract your archive. Run the following command in the Terminal to unzip TAR.GZ files.
            tar -xf SOURCE.tar.gz
        

How to Open a GZ File on Linux Using the Built-In Tool

There are ways to unzip compressed files on Linux using a built-in graphical tool. Like its macOS and Windows counterparts, it's just a right-click away. Here's how to extract GZ files on Linux using a graphical interface:

  1. Using your preferred file manager, navigate to the folder where the .GZ file is
  2. Select the .GZ file and right-click it
  3. Choose Extract here.
  4. That's it. The file(s) or folder(s) inside the GZ file will be unzipped to the same folder you're in.
ubuntu context menu gz file open unzip extract

Extracting GZ Files on Windows, Mac, and Linux

GZ files have been around for quite a long time. If you’re coming across one for the first time, use one of the methods above to extract the contents from your GZ archive. The above methods work on all the popular platforms, including Windows, macOS, and Linux.

Other not-so-common formats that you may come across on your computer are tarballs, or .TAR, and .XZ. Luckily, there are simple ways to extract files from these formats as well.