How to Open GZ Files: .gz, .tar.gz and .tgz Explained
A .gz file is not really an archive. It is one file compressed with gzip. That small difference explains why some .gz files open into a single document while others turn into a .tar file that you then need to open again. This guide explains the difference and gives exact steps for each platform.
Updated 2026-10-13 · Written and tested by the UnpackNest editorial team (TECCONET)
.gz, .tar.gz and .tgz: what you actually have
gzip compresses exactly one stream of data. It has no idea of folders or multiple files. Unix systems solve that with a second tool, tar, which glues many files into one "tarball", which is then compressed. You will meet three shapes:
| File name | What is inside | After decompressing you get |
|---|---|---|
| report.csv.gz | One compressed file | report.csv |
| backup.tar.gz | A TAR archive, compressed with gzip | backup.tar, which holds many files |
| backup.tgz | Exactly the same as .tar.gz, with a short name | Many files |
The name before .gz is a hint, not a guarantee. A gzip header can also store the original file name, which good tools use.
Open a .gz in your browser with UnpackNest
The UnpackNest TAR/GZ tool handles all three shapes. It streams the file through the browser's built-in gzip decoder, so even large files are not loaded into memory at once, and nothing is uploaded.
- Open the UnpackNest TAR/GZ tool.
- Tap Choose a TAR or GZ file and select the .gz, .tar.gz or .tgz.
- For a single compressed file, the tool shows one entry with its original name and decompressed size.
- For a .tar.gz, it shows every file in the TAR, with sizes and folders.
- Press Extract next to an entry to save it.


The tool also tells you when something is not gzip at all. It recognises .tar.xz and .tar.bz2, which it does not extract (use desktop 7-Zip or tar -xf for those), and it detects files encrypted with OpenSSL or GPG, which must be decrypted before anything can read them.
Windows
Windows 10 (version 1803 and later) and Windows 11 include the tar command, which also handles gzip.
- Open the folder that contains the file, click the address bar, type
cmdand press Enter. - For a .tar.gz or .tgz:
tar -xzf backup.tar.gz. - For a single .gz there is no built-in one-liner; recent Windows 11 builds can extract it with Extract All…, otherwise use 7-Zip or the browser tool.
With 7-Zip, a .tar.gz needs two steps: extracting the .gz produces a .tar, which you then extract again. That is normal.
macOS
- Double-click the .gz or .tar.gz in Finder. Archive Utility decompresses it; a .tar.gz goes straight to a folder.
- In Terminal,
gunzip -k report.csv.gzdecompresses a single file and keeps the original (without-k, gunzip deletes the .gz after success). - For a tarball:
tar -xzf backup.tar.gz.
Linux
- Single file:
gzip -dk report.csv.gz(orgunzip -k). - Look inside without decompressing to disk:
zcat report.csv.gz | head. - Tarball:
tar -xzf backup.tar.gz; list it first withtar -tzf backup.tar.gz. - Test integrity:
gzip -t file.gzprints nothing when the file is fine.
Android and iPhone
Files by Google and the iPhone Files app handle ZIP better than gzip. The simplest route on a phone is the browser tool above. On iPhone, the Files app can expand many .gz and .tar.gz files with a tap; if it does nothing, use the browser.
Common problems
"Not in gzip format"
The file is not gzip, despite its name. Sometimes a server already decompressed it during download and kept the .gz name; try opening it as the inner type (for example, rename data.csv.gz to data.csv). The UnpackNest tool checks the signature and tells you what it found.
"Unexpected end of file" or a CRC error
The download is incomplete or damaged. gzip stores a CRC-32 and the original length at the end of the stream, so truncation is always detected. Download again; there is no reliable repair for a cut-off gzip stream.
I got a .tar, not my files
That is expected for .tar.gz in tools that decompress one layer at a time. Open the .tar the same way.
The extracted file is huge
Logs and CSV files can compress by 90 % or more. A 100 MB .gz may expand to more than 1 GB, so check free space first. The UnpackNest tool stops streams whose expansion ratio looks like a decompression bomb.
Why servers and developers love gzip
gzip is fast, streams well and is supported everywhere. It is used for web traffic, log rotation and software source releases (.tar.gz). When a project offers both .zip and .tar.gz, the contents are normally identical; pick whichever your system opens more easily.
Frequently asked questions
Can a .gz file contain several files?
Only if it is a .tar.gz (or .tgz). A plain .gz holds one file. Technically, several gzip streams can be joined, but tools treat them as one file.
Does gzip support passwords?
No. gzip and tar have no encryption. Files that need protection are usually encrypted separately with GPG or OpenSSL, or packed into a 7z or ZIP with AES.
Is .gz the same as .zip?
Both normally use the Deflate algorithm, but ZIP is a multi-file archive with a central directory. A .gz is one compressed stream.
What about .tar.xz or .tar.bz2?
Same idea with different compressors (xz and bzip2). UnpackNest does not extract them yet; use desktop 7-Zip, or tar -xf on macOS and Linux.
Tools for this task
- Extract TAR, TGZ and GZ files in your browserustar, PAX and GNU TAR, gzip streams.