132

I need to open a file that sadly is only available in the .tar.gz file format and I am using Windows 7. I can unzip the file using 7-zip but after that I still have a .tar file that I can't open in Windows.

Is there a way to open .tar.gz files on Windows?

6
  • 6
    @Sparr: .tar.gz is not supported by the most widely spread client operating system without third party software. And on added to that, when I use it in Linux is has a very bad usability with command flags that is very hard to remeber. See Untar, ungz, gz, tar - how do you remember all the useful options?
    – Jonas
    Nov 27, 2010 at 20:19
  • 2
    yes, but it is supported by software on more platforms than any other archive format. I cannot name an OS or distribution thereof for which you cannot download untar and gunzip binaries. I can name plenty of platforms for which there are no binaries or even sources for unzip.
    – Sparr
    Nov 28, 2010 at 0:17
  • 1
    @Sparr: As I wrote in my question, .tar.gz is not supported in Windows without third party software. But .zip is supported and I guess that .zip is supported by Linux too. If the file had been available in the .zip format, I hadn't asked this question.
    – Jonas
    Nov 28, 2010 at 13:08
  • 3
    Perhaps I should rephrase. I believe you put "sadly" in the wrong place. It belongs before "using".
    – Sparr
    Nov 29, 2010 at 4:33
  • 2
    Bad usability? There's a phrase for that: RTFM. man tar. All you need to remember is that at the end of the flags, you need f for file. Here's the basics: tar cf arch.tar folder/ is c reating a f ile called arch.tar from the folder folder/. tar xf arch.tar will e x tract from the f ile arch.tar. This also works on tar.gz files. No need for the z flag there. Feb 9, 2014 at 22:58

10 Answers 10

95

You can use 7-zip to untar the .tar file as well.

  1. Right-click the file
  2. Select 7-zip -> Extract Here / Extract To
6
  • 1
    It doesn't work for me, but I will try to upgrade 7-zip to the latest version.
    – Jonas
    Nov 27, 2010 at 15:01
  • 12
    After upgrading 7-Zip from 9.16 to 9.20 it works fine. Thanks.
    – Jonas
    Nov 27, 2010 at 15:12
  • 3
    @Paul, How to do it in 1 step?
    – Pacerier
    May 16, 2015 at 3:35
  • 1
    @Pacerier - you can't do it in one step using 7-zip, since you're unpacking two filetypes: gzip and tarball. If you can use Linux, command line allows one step: tar xvfz somefilename.tar.gz. Otherwise check out these answers
    – Paul
    May 16, 2015 at 3:40
  • 1
    @KolobCanyon - right-click the file and select 7-zip->Extract Here/Extract To...
    – Paul
    Oct 5, 2016 at 19:08
60

If you can, you can always use bash for windows and just do the regular

 tar -xvzf <filename.tar.gz>
5
  • Ask yourself, do you have Git Bash already installed... 3:) Mar 21, 2019 at 20:57
  • 14
    @LoremIpsum yes, linux subsystem is a part of windows 10 now and tar command is available from windows cmd.exe.
    – Reishin
    May 1, 2019 at 14:48
  • Awesome, thank you.
    – Beko
    Nov 15, 2020 at 22:36
  • 4
    I was able to do this simply using windows command prompt
    – Zach
    Mar 29, 2021 at 23:35
  • @LoremIpsum no need anymore: Tar and Curl Come to Windows!
    – phuclv
    Jul 11, 2021 at 12:53
34

With a recent Windows 10 (1803+, or 10.0.17063+ for insiders) you can unpack a tar archive just like you do it in Linux:

cmd.exe -> tar -xzf archive.tar.gz
2
  • As simple as snaping finger. Open terminal and run command in target directory
    – Agent
    Nov 11, 2022 at 11:11
  • 2
    this needs the option "z" to complete the work Apr 25, 2023 at 12:54
21

7-zip should work for you. I believe you have to untar the .tar part of the file as a second step after unzipping the .gz part.

You also may need to check your 7-zip settings...

  • Click Tools → Options
  • Go to the “System” tab.
  • Make sure “tar” and “gz” are checked off.
3
  • 1
    Thanks, it worked after upgrading my 7-Zip from 9.16 to 9.20.
    – Jonas
    Nov 27, 2010 at 15:13
  • +1 your solution was teh only one that worked for me. Jan 13, 2017 at 10:23
  • in 17.01 you can view files inside the tar.gz archive with 2 steps in the gui - just associate the files with your user. You can also associate rpm & deb files now. Jan 31, 2018 at 12:04
9

The 7-zip package comes with a command-line tool called 7z.exe that can pipe to and from stdin (-si) & stdout (-so). So the following line will do the extractraction in one step with no intermediary file (-ttar tells 7-zip that we're piping in a tar stream).

PATH_TO_7ZIP\7z.exe x netlib-0.13.1.tar.gz -so | PATH_TO_7ZIP\7z.exe x -si -ttar
1
  • Nice one! Simple and no temp files!
    – Sun Junwen
    Sep 13, 2016 at 5:10
8

I use simple WinRAR extractor to extract .tar.gz file; simply do these steps,

  1. Start extracting the .tar.gz file with WinRAR, it will generate an Intermediate file.
  2. Rename that intermediate file as ".tar" and extract it again with WinRAR.

Now second time it will extract your all files/folders.

1
  • 1
    This should be the accepted answer IMHO. Windows users who are likely accustomed to WinZip are likely to find WinRAR very intuitive to use. Jun 25, 2014 at 18:20
2

The problem is that when 7-zip uncompresses the tar file into a subdirectory, you have to go into the subdirectory in order to uncompress the tar file.

If you've tried to uncompress the subdirectory, it won't work of course.

There are two solutions here:

  1. Use 'extract here', not 'Extract files...'.
  2. Go into the subdirectory and extract from there.
1

Install total commander, it will deal with tar.gz files. You can just go inside such kind of file and copy it to the place you need. Extraction is done by TC in the background.

1
0

I find Senthil Rajasekharan's TarTool.exe to be the simplest (includes the single dll from SharpZipLib).

0

Paul has it correct, but in this case it's a 2-step process. First to remove the .gz(decompress the files) and second to remove the .tar(unpack the files).

2
  • 1
    Could you tell us how to do those steps?
    – Ben N
    Aug 21, 2015 at 19:11
  • first you'll need 7-zip... 7-zip.org I like to create a folder to place the .tar.gz file into prior to unzipping. Right-click on the file and hover over 7-zip, select "Extract Here" to remove the .gz. - now do the same for the newly created .tar file. Aug 24, 2015 at 13:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .