How to Open and Extract GZ and TAR.GZ Files on Windows 10
In this article
Windows 10 can open .gz and .tar.gz files without any extra software, but only if your copy of Windows is up to date. The built-in tar command (available since Windows 10 version 1803) extracts both formats from Command Prompt or PowerShell, and File Explorer can browse the contents of a .tar.gz after you unpack the outer gzip layer. If you prefer clicking to typing, free tools like 7-Zip or WinRAR handle both formats in one step. This guide walks through the built-in method first, then the graphical options, and covers the mistakes that trip most people up.
What You'll Need
- A Windows 10 PC running version 1803 (April 2018 Update) or later. To check, press Windows key + R, type winver, and press Enter. The window shows your version number.
- The .gz or .tar.gz file saved somewhere you can find it, such as your Downloads folder.
- Enough free disk space for the extracted files. Compressed archives can expand several times over, so check the file size before extracting a large one.
- Optional: 7-Zip (free, open source) if you want a right-click menu instead of the command line.
Step-by-Step
Method 1: Extract with the built-in tar command (no downloads)
- Put the archive in a folder you can reach easily. For this example, assume the file is C:\Users\YourName\Downloads\archive.tar.gz.
- Open Command Prompt. Press Windows key, type cmd, and press Enter. You can also right-click the Start button and choose Command Prompt or Windows PowerShell.
- Move to the folder holding the file by typing cd %USERPROFILE%\Downloads and pressing Enter. The %USERPROFILE% shortcut saves you typing your username.
- Create a destination folder so the extracted files do not scatter everywhere: mkdir extracted.
- Run the extraction command: tar -xzvf archive.tar.gz -C extracted. The flags mean extract (x), gzip (z), verbose so you see each filename (v), and file (f). The -C flag sends everything into the folder you just made.
- Wait for the list of filenames to stop scrolling. Open File Explorer, go to the extracted folder, and your files are there.
For a plain .gz file that is not a tarball (for example logfile.gz), the same command works: tar -xzvf logfile.gz -C extracted. Windows' tar handles single-file gzip streams as well as tarballs.
Method 2: Extract a .tar.gz in two stages with File Explorer
- Open File Explorer and navigate to the .tar.gz file.
- Right-click it and choose Extract All, then pick a destination and confirm. Windows strips the .gz layer and leaves a .tar file behind. If Extract All is missing or greyed out, your Windows build is too old for this method, so use Method 1 or 3 instead.
- Right-click the new .tar file and choose Extract All again.
- Open the resulting folder. You now have the original files.
This two-step dance exists because Windows treats gzip and tar as separate formats. It works, but Method 1 is faster and produces cleaner results.
Method 3: Use 7-Zip for a right-click menu
- Download 7-Zip from the official site (7-zip.org) and install it with the default options.
- Right-click your .tar.gz file. You should see a 7-Zip submenu.
- Choose Extract Here to unpack the gzip layer, which gives you a .tar file.
- Right-click that .tar file and choose 7-Zip > Extract Here again, or use Extract to "folder name\" to keep things tidy.
- For a plain .gz file, one Extract Here is enough.
7-Zip also lets you peek inside without extracting: double-click the archive and browse the tree. That is handy when you only need one file out of a large archive.
Common Mistakes
- Extracting in the wrong folder. Running tar without -C dumps files into whatever directory the command prompt is sitting in, often your user folder. Always cd somewhere sensible or use -C.
- Typing the filename wrong. Windows hides known extensions by default, so a file shown as archive.tar may really be archive.tar.gz. Turn on file extensions in File Explorer's View tab before typing commands.
- Assuming .gz means .tar.gz. A .gz file is just one compressed file. A .tar.gz is a bundle of many files that was tarred first, then gzipped. Trying to open a plain .gz as a tarball gives errors or a single strange-looking file.
- Using an old Windows build. The tar command does not exist before version 1803. If tar is not recognized, run winver and update Windows, or fall back to 7-Zip.
- Extracting into a protected location. Writing to C:\Program Files or the root of C:\ triggers permission errors. Use your Downloads or Documents folder instead.
Tips
- Add -t instead of -x to list the archive contents without extracting: tar -tzvf archive.tar.gz. Useful for checking what you are about to unpack.
- Quote paths that contain spaces: tar -xzvf "C:\My Files\archive.tar.gz" -C "C:\My Files\out".
- PowerShell users can run the same tar commands; the syntax is identical.
- If you extract the same archive repeatedly, keep a dedicated folder per archive so versions do not overwrite each other.
- Check the extracted file count against what the archive listed with -t. A short count usually means the download was truncated.
Troubleshooting
"tar is not recognized as an internal or external command." Your Windows build predates the tar tool. Run winver to confirm, install all pending Windows updates, or use 7-Zip.
"Cannot open file: No such file or directory." The command prompt is in a different folder from the archive. Run dir to list what is actually there, then cd to the right place or use the full path.
"gzip: stdin: not in gzip format." The file is not really gzipped, or the download is incomplete. Re-download it from the source and try again.
Extraction stops partway with a checksum or unexpected-end error. The archive is corrupt or truncated. Delete it and download a fresh copy; there is no reliable repair for a broken gzip stream.
Files extract but look like gibberish. You probably extracted a plain .gz that contained a single file with an unfamiliar extension. Check the name and open it with the right program.
Permission denied when writing output. Choose a folder under your user profile, such as Downloads or Desktop, and try again.
Frequently Asked Questions
Can Windows 10 open .tar.gz files without any software?
Yes, on version 1803 and later. Use the built-in tar command in Command Prompt or PowerShell, or the two-stage Extract All route in File Explorer.
What is the difference between .gz and .tar.gz?
A .gz file is a single file compressed with gzip. A .tar.gz is a collection of files packed into a tar archive first, then compressed with gzip. The second needs two layers removed.
Why does File Explorer show a .tar file after I extract?
Because Windows unpacks only the gzip layer in the first pass. Run Extract All again on the .tar file to get the actual contents.
Is 7-Zip safe to use?
Yes, when downloaded from the official 7-zip.org site. Avoid third-party download portals that bundle extra software.
Can I extract just one file from a large .tar.gz?
Yes. With 7-Zip, double-click the archive and drag out the single file you need. With tar, add the file path after the archive name, for example tar -xzvf archive.tar.gz path/to/file.txt.
Does the tar command work in PowerShell too?
Yes. Windows ships the same tar tool for both Command Prompt and PowerShell, so the commands in this guide work in either.