There are three ways to open a TAR.GZ file in Windows. On Windows 11 version 23H2 or later, double-click it or right-click and choose Extract All in File Explorer. On Windows 10 (version 1803 or later) and Windows 11, you can run the built-in command tar -xzf file.tar.gz in Command Prompt or PowerShell. On any version of Windows, an archive program extracts it from the right-click menu in one step, without the intermediate .tar file some tools leave behind.
Below you will find each method step by step, what the related TGZ, TAR.BZ2 and TAR.XZ files are, and the problems that come up when Linux archives meet Windows.
What a TAR.GZ file is
A TAR.GZ file is made in two layers:
- TAR bundles many files and folders into one file, without compressing them.
- GZ (gzip) then compresses that single bundle.
The combination is the standard way to package source code, Linux software, website backups and server logs. The same idea applies to other compressors:
| Extension | What it is | Where you see it |
|---|---|---|
.tar.gz or .tgz | TAR compressed with gzip | Source code, hosting backups, most Linux downloads |
.tar.bz2 or .tbz2 | TAR compressed with bzip2 | Older Linux packages |
.tar.xz or .txz | TAR compressed with xz | Linux kernel and distribution sources |
.tar | Uncompressed bundle | Backups, intermediate files |
.gz alone | A single compressed file | Compressed logs and database dumps |
Method 1: File Explorer (Windows 11 23H2 and later)
- Check your version in Settings → System → About.
- Double-click the TAR.GZ file to browse it like a folder, or right-click it and choose Extract All.
- Choose a destination and click Extract.
This is the quickest option on an up-to-date Windows 11 PC, and it handles TGZ, TAR.BZ2 and TAR.XZ files the same way. Large source archives can take a while, because Explorer works through thousands of small files. On Windows 10 or earlier Windows 11 builds, File Explorer will not recognize the file.
Method 2: The built-in tar command (Windows 10 and 11)
Windows 10 version 1803 and later include tar.exe, the same tool Linux users rely on.
- Open the folder containing the file in File Explorer.
- Click the address bar, type
cmdand press Enter. A Command Prompt opens in that folder. - Run:
tar -xzf archive.tar.gz - To extract to a different folder that already exists, add
-C:tar -xzf archive.tar.gz -C C:\extracted
What the letters mean: x extracts, z means gzip, and f means the next word is the file name. The Windows tar can usually detect the compression on its own, so tar -xf archive.tar.xz works for XZ and BZ2 files too. To list contents without extracting, use tar -tzf archive.tar.gz.
tar extracts silently and overwrites existing files with the same names without asking. Extract into an empty folder if you are not sure what is inside.
Method 3: An archive program (any Windows version)
Archive programs are the most convenient choice if you handle these files regularly, or if you are on Windows 7 or 8. With Universal Zip:
- Right-click the
.tar.gzfile. - Choose Extract to folder or Extract Here.
- Open the resulting folder.
Universal Zip opens TAR, GZ, TGZ, BZ2 and XZ files and can also create them, which is useful when you need to send files back to a Linux server. You can also double-click a TAR.GZ to browse it and drag out a single config file or log without unpacking the whole archive.
Some older extractors handle the two layers separately: the first extraction turns file.tar.gz into file.tar, and you then extract that to get the actual files. If you see a lone .tar after extracting, just extract it once more.
Problems when extracting Linux archives on Windows
Invalid file names
Linux allows characters in file names that Windows does not, such as :, ?, *, ", <, > and |. Files with those names cannot be created on Windows, so extraction reports errors for them. Linux is also case sensitive, so an archive can contain both README and readme, which collide on Windows.
Symbolic links
Source code archives often contain symlinks. Windows restricts creating symlinks to administrators or to accounts with Developer Mode turned on, so they may fail or be skipped. For most purposes, such as reading the code or editing config files, this does not matter.
Path length
Deep source trees can exceed Windows' traditional 260-character path limit. Extract to a short folder such as C:\src. Our guide to fixing path too long errors has more options.
Checking the download first
Linux projects often publish a SHA256 checksum next to each download. If extraction fails with a "not in gzip format" or unexpected end error, check the file before blaming the tool. In PowerShell, run Get-FileHash archive.tar.gz and compare the result with the published value. If they differ, the download is incomplete or damaged and needs to be fetched again. A file of only a few kilobytes is often an error page that was saved by mistake.
Line endings and permissions
Text files from Linux use different line endings from Windows. Modern editors, including Notepad on Windows 10 and 11, display them correctly. Unix file permissions are not preserved on Windows, which matters only if you plan to re-pack the files and send them back to a server.
Opening a plain .gz file
A .gz without .tar is usually a single compressed file, such as access.log.gz or database.sql.gz. Extracting it gives you that one file. An archive program handles it with the same right-click command. Once extracted, open logs and SQL dumps in a text editor that copes with large files.
Going the other way
If you need to upload files to a Linux server or share them with a developer, creating a TAR.GZ on Windows is just as easy. Our guide to creating a TAR.GZ file on Windows covers the command and the archive program methods, plus how to avoid the file name pitfalls above. For a broader look at how these formats compare with ZIP and 7Z, see ZIP vs 7Z vs RAR.
Frequently asked questions
What is a tar.gz file?
It is a TAR archive that bundles many files into one, then compressed with gzip. It is common for Linux software, source code and server backups.
Is tgz the same as tar.gz?
Yes. TGZ is a short extension for the same thing, a gzip-compressed TAR archive, and it opens the same way.
Does Windows have a tar command?
Yes. Windows 10 (since 2018) and Windows 11 include tar.exe, so you can run tar -xzf file.tar.gz in Command Prompt or PowerShell.
