How to Extract .tar.gz File in Windows

December 27, 2023

Introduction

A .tar.gz file, also known as a tarball, is a compressed archive used in UNIX and Linux systems. This format involves multiple files bundled into a single archive and compressed using gzip compression.

Although .tar.gz is commonly associated with UNIX and Linux distributions, you can also extract these files in Windows using various third-party tools.

This tutorial will show you how to extract .tar.gz files in a Windows environment.

How to Extract a .tar.gz File in Windows

Requirements

  • A Windows system (this tutorial uses Windows 11).
  • WinRAR, WinZip, and 7-Zip installed (for specific examples).
  • The tar tool (for some examples).
  • Access to Command Prompt.

How to Extract .tar.gz File in Windows

Since Windows doesn't natively support .tar.gz files, extracting involves third-party tools or non-native commands. The following text outlines the process of extracting a .tar.gz file in a Windows environment.

Extract .tar.gz File in Windows Using tar Command

The tar (tape archive) command is a command-line utility for archiving files. 

The command bundles multiple files and directories into a single file archive but doesn't compress data on its own. Therefore, it is often used with compression tools, such as gzip (tar.gz files) or bzip2 (tar.bz2 files), to reduce the overall archive size.

The tar command is not a native Windows command. It usually doesn't come preinstalled in older Windows systems. However, newer versions (starting from Windows 10) have it preinstalled.

The following example shows how to extract a .tar.gzip file called archive_1 using the tar command. The archive_1 consists of three files: sample_file1, sample_file2, and sample_file3.

To extract the files using tar:

1. Open the Command Prompt.

2. Use the cd command to navigate to the directory the archive is in. In this case:

cd C:\files
cd command terminal output

3. Use the following syntax to extract files:

tar -zxvf [archive_name.tar.gz]

This command consists of:

  • -z. Specifies the input is compressed with gzip.
  • -xStands for extract.
  • -vEnables verbose mode to provide detailed output during extraction.
  • -fSpecifies the filename to be extracted.

For instance, in our case:

tar -zxvf archive.tar.gz
tar -zxvf archive.tar.gz terminal output

The output lists extracted files.

Note: Master the Command Prompt with our cmd commands guide which features a free downloadable cheat sheet.

Extract .tar.gz File in Windows Using 7-Zip

For a more GUI-friendly approach to extracting .tar.gz files, use 7-Zip.

Follow these steps to extract files from a .tar.gz archive:

1. Right-click the archive.

2. Find and hover over 7-Zip.

Right-click archive 7 zip

3. Choose Extract Here to extract files to the archive folder.

Extract here option in 7-Zip

4. Alternatively, select Extract files to pick where to extract the files.

Extract Files option in 7-zip

 A new window opens to manage where and how to extract files.

Extract files 7-Zip window

Extract .tar.gz File in Windows Using WinRAR

Another way to access archive files is to extract them via WinRar. To accomplish this, follow these steps:

1. Right-click the archive.

2. Hover over the WinRar icon.

Access WinRAR

3. Choose Extract Here to extract the file to your current location.

choose WinRAR extract here

Alternatively, select one of the offered locations or set one up by clicking the Extract files… option.

WinRAR extract options

Extract .tar.gz File in Windows Using WinZip

Extracting .tar.gz files using WinZip is also quite straightforward.

To get the files, follow these steps:

1. Right-click the archive file and hover over WinZip.

right-click archive Winzip

2. Choose whether to unzip to one of the offered locations or define one with the Unzip to… option.

Unzip to different options window

The Unzip to…option opens up another window with extra settings.

Winzip options window

3. Select Unzip to start the process.

Conclusion

After reading this article, you know how to extract .tar.gz files in Windows using the tar command, 7-Zip, WinZip, or WinRAR.

Next, learn how to extract .tar.gz files in Linux.

Was this article helpful?
YesNo
Sara Zivanov
Sara Zivanov is a technical writer at phoenixNAP who is passionate about making high-tech concepts accessible to everyone. Her experience as a content writer and her background in Engineering and Project Management allows her to streamline complex processes and make them user-friendly through her content.
Next you should read
Gunzip Command in Linux With Examples
December 21, 2023

The gunzip command is used to decompress files. This command restores the compressed file to its original state...
Read more
How to Unzip tar.bz2 Files
July 13, 2023

Tar.bz2 files combine the archiving capabilities of tar and the BZ2 compression algorithm. Learn how to unzip tar.bz2 files and how to work with compressed archives in this guide...
Read more
How to Extract or Unzip tar.gz Files from Linux Command Line
February 12, 2024

This article shows which commands best to use when compressing and decompressing files...
Read more
How to Zip a File in Linux
October 31, 2022

Did you know you can work with ZIP files on Linux? The handy zip command lets you create ZIP archive files quickly. Learn how to use the command in this guide...
Read more