How to quickly extract .tar.gz files on Windows 10

If you come across a .tar.gz, .tgz, or .gz file, you can use these steps to use the tar command-line tool to extract its content on Windows 10.

Windows 10 extract .tar.gz
Windows 10 extract .tar.gz

A file using .tar.gz format is a file that has been created using the Unix-based archival application tar and then compressed using the gzip compression. These files are often referred to as “tarballs.” While you can find them with a double extension (.tar.gz), the extension can also be shortened to .tgz or .gz.

Usually, tar files are more common with Ubuntu (other Linux distros) and macOS users for data archival and backups. However, Windows 10 users may also come across these files, which is a reason to have a way to extract their contents.

Although you can use third-party apps (such as 7-Zip and PeaZip), these apps do not always work as expected with tarballs created on another platform, and they are slow to uncompress many files. However, Windows 10 includes native support for tar files, and you can use Command Prompt to extract these files. Or you can even use the Windows Subsystem for Linux (WSL) that includes native support for Ubuntu, Fedora, SUSE, and many other distros. Therefore, you can also access many Linux tools, including tar, to quickly extract content from tarballs.

This guide will teach you the steps to use native tar commands on Windows 10 from Command Prompt and Ubuntu to extract the content of a .tar.gz file.

Extract .tar.gz, .tgz, .gz tarballs using tar on Windows 10

To extract .tar.gz, .tgz, .gz, as well as .zip files using tar on Windows 10, use these steps:

  1. Open Start on Windows 10.

  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.

  3. Type the following command to use tar to extract the files and press Enter:

    tar -xvzf C:\PATH\TO\FILE\FILE-NAME.tar.gz -C C:\PATH\TO\FOLDER\EXTRACTION

    Native tar support on Windows 10

    Quick tip: Change the syntax to include the source and destination paths. Also, because you are using tar on Windows 10, you do not need to specify the path as if you were running Linux. You can use the path format used by Windows.

Once you complete the steps, you will have all the files and folders extracted to the destination path you specified after a few moments.

It is assumed that you are extracting a tarball created on another system. We are skipping some arguments usually necessary to preserve permissions, which on Windows 10 are not required to access the files. 

Extract .tar.gz, .tgz, .gz tarballs using tar on Linux on Windows 10

On Windows 10, to use tar on Linux, you need to install the Windows Subsystem for Linux (WSL) and a distro like Ubuntu from the Microsoft Store.

To extract a .tar.gz file using Linux on Windows 10, use these steps:

  1. Open Start.

  2. Search for Ubuntu and click the top result to open the app.

  3. Type the following command to extract the content of the .tar.gz file and press Enter:

    sudo tar -xvzf /mnt/c/PATH/TO/TAR-FILE/Desktop/FILE-NAME.tar.gz -C /mnt/c/PATH/TO/DESTINATION/FOLDER

    WSL tar command on Windows 10

    Quick tip: Update the syntax to include the source and destination paths. If it’s only a .tar file, you can use the same command described above but omit the z argument.

In the above command, sudo runs the app as an administrator, tar calls the app, and then we feed it some arguments, including:

  • x — instructs tar that you want to extract content.
  • v — verbose. This is an optional argument to display the extraction process. Otherwise, you will only see a blinking cursor until the process is complete.
  • z — tells tar to uncompress the content of a .tar.gz file with gzip.
  • f — instructs tar the name of the file you’re about to extract.

Then you need to specify the path of the tarball file to extract. You’ll notice that the path starts with /mnt/c/, instead of c:\ because you are now in the Linux world.

-C — (hyphen and capital C) is used to tell tar to change folders. When executing a command, you start in the source folder, and then you need to specify the destination folder, which is the path we specified to complete the command. You can extract the files to any folder you want, but remember to start the path with /mnt/ followed by the Windows path.

You must pay attention to uppercase and lowercase while typing a Linux command, as “Desktop” is not the same as “desktop.”

This guide outlines the basic steps to perform a specific task. If you are not a Linux user, you can learn more about this tool in the Ubuntu console by typing the tar --help command.

About the author

Mauro Huculak is a Windows expert and the Editor-in-Chief who started Pureinfotech in 2010 as an independent online publication. He is also been a Windows Central contributor for nearly a decade. Mauro has over 12 years of experience writing comprehensive guides and creating professional videos about Windows, software, and related technologies, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 20 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter), YouTube, LinkedIn and About.me.