How to Open .tar.gz and .tgz Files on Windows, Mac and Your Phone
A .tar.gz file is a bundle of files (the TAR part) that has been compressed as one stream (the GZ part). It is the standard way to ship source code, Linux software, server backups and data sets. This guide shows the quickest way to open one on each kind of device, and explains the messages you may see along the way.
Updated 2026-10-13 · Written and tested by the UnpackNest editorial team (TECCONET)
Step by step: open a .tar.gz in the browser
- Open the TAR/GZ tool on a computer or phone.
- Press Choose a TAR or GZ file and select the .tar.gz or .tgz.
- The tool streams and decompresses it on your device and lists every file inside the TAR.
- Press Extract next to a file. Folders, links and unsafe paths are listed but never written.

What .tar, .gz, .tar.gz and .tgz mean
TAR (tape archive) is one of the oldest archive formats still in daily use. It puts many files and folders, together with their names, dates and permissions, into a single file, but it does not compress anything.
GZ (gzip) compresses exactly one stream of data. It has no idea about folders or multiple files.
Combining the two gives the familiar pair: first TAR joins the files, then gzip compresses the result. The outcome is called .tar.gz or, in its short form, .tgz; both are the same thing. A plain .gz file without .tar is usually a single compressed file, such as a log (access.log.gz) or a database dump (backup.sql.gz).
| Extension | Contains | Typical use |
|---|---|---|
.tar | Many files, uncompressed | Intermediate bundles, some backups |
.tar.gz / .tgz | Many files, gzip-compressed | Source code, Linux releases, server backups |
.gz | One compressed file | Rotated logs, database dumps |
.tar.xz, .tar.bz2, .tar.zst | Many files, other compressors | Linux packages, kernel sources |
Because the compression covers the whole bundle, a tar.gz usually compresses better than a ZIP of the same files, especially when there are many small, similar files. The trade-off is that a tool must read through the archive from the start to reach a file near the end.
The quick way on any device: your browser
- Open the UnpackNest TAR/GZ extractor.
- Choose your
.tar,.tar.gz,.tgzor.gzfile. - The tool reads the archive on your device and lists every file and folder.
- Press Extract next to the file you want to save.
Nothing is uploaded, so this also works for private backups. The tool understands the usual TAR variants (ustar, PAX and GNU long names) and blocks entries whose paths try to escape the extraction folder.
Windows 11 and Windows 10
File Explorer (Windows 11)
Recent Windows 11 releases can open TAR and GZ archives directly in File Explorer: right-click the file and choose Extract All. A .tar.gz may first produce a .tar file, which you then extract again. If your build does not offer this, use one of the options below.
Built-in command (Windows 10 and 11)
Windows 10 version 1803 and later include the tar command. Open Command Prompt or PowerShell in the folder with the file and run:
tar -xzf archive.tar.gz
To extract into a specific folder, add -C followed by an existing folder: tar -xzf archive.tar.gz -C C:\Users\you\Desktop\out. To list the contents without extracting, use tar -tzf archive.tar.gz.
7-Zip
In 7-Zip, a tar.gz opens in two steps: the first window shows a single .tar file inside the .gz; double-click it to see the real contents. This is normal behaviour, not a damaged archive.
macOS
Double-click the file. Archive Utility extracts .tar.gz, .tgz and .gz files into the same folder. For more control, open Terminal and run tar -xzf archive.tar.gz. macOS includes the BSD version of tar, which recognises gzip, bzip2 and xz automatically, so tar -xf archive.tar.xz works as well.
Linux and Chromebook
Every Linux distribution includes GNU tar. Run tar -xzf archive.tar.gz, or simply tar -xf archive.tar.gz, because modern tar detects the compression itself. A single .gz file is decompressed with gunzip file.gz (which replaces the .gz file) or gunzip -k file.gz (which keeps it). On a Chromebook, the Files app can open some archives; for tar.gz, the browser tool or the Linux terminal is more dependable.
Android
Android has no built-in tar.gz support, and the Files app concentrates on ZIP. You have two choices:
- Use the browser extractor in Chrome: choose the file from Downloads, then extract only what you need.
- Install a dedicated archive app that lists TAR and GZ support. Check its permissions before granting access to all your files.
iPhone and iPad
The Files app extracts ZIP archives with a tap but does not open tar.gz files on most iOS versions. Open the file from Safari's downloads in the UnpackNest TAR tool instead. Saved files land in your Downloads folder in Files.
Common problems and what they mean
“Not in gzip format”
The file is not actually gzip-compressed. It may be a plain .tar with the wrong extension, or an HTML error page that was saved with a .tar.gz name. Check the file size: a 2 KB “archive” is almost certainly a web page. Try tar -xf without z, or open it in the browser tool, which detects the real format.
“Unexpected end of file” or “truncated”
The download stopped early. Because tar.gz is one continuous stream, everything after the break is lost. Download it again, preferably with a download manager or curl -C - to resume.
“Invalid header” or checksum errors
The TAR structure is damaged, or the file was transferred in text mode (an old FTP setting that changes line endings). Transfer it again in binary mode.
Links and permissions
TAR archives from Linux can contain symbolic links, device files and Unix permissions. Windows cannot represent all of these, so some tools skip them or show warnings. For ordinary documents and source code this is harmless.
“Path escapes” or absolute paths
Well-made archives use relative paths such as project/src/main.c. Entries that start with / or contain ../ could write outside the target folder. Good extractors block them; treat such an archive with suspicion.
Creating a tar.gz yourself
On macOS, Linux and Windows 10/11 the command is the same: tar -czf archive.tar.gz folder. The letters mean create, gzip and file. Use -v to see each file as it is added.
Frequently asked questions
Is .tgz different from .tar.gz?
No. .tgz is a shorter spelling of .tar.gz, originally used on systems that limited extensions to three characters.
Why did I get a .tar file after extracting?
Some tools remove the gzip layer first and leave the .tar behind. Extract that .tar file once more to get the actual files.
Can a tar.gz contain a virus?
The archive itself only stores files, but the files inside can be harmful. Scan programs and scripts before running them, and do not run installers from sources you do not trust.
Can I open just one file without extracting everything?
Yes. The browser tool lists the archive and lets you save single files, and on the command line you can name a file after the archive: tar -xzf archive.tar.gz path/in/archive.txt.
Tools for this task
- Extract TAR, TGZ and GZ files in your browserustar, PAX and GNU TAR, gzip streams.
- Open and extract ZIP files in your browserStore, Deflate and ZIP64, read on your device.