GZ basics

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 nameWhat is insideAfter decompressing you get
report.csv.gzOne compressed filereport.csv
backup.tar.gzA TAR archive, compressed with gzipbackup.tar, which holds many files
backup.tgzExactly the same as .tar.gz, with a short nameMany 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.

  1. Open the UnpackNest TAR/GZ tool.
  2. Tap Choose a TAR or GZ file and select the .gz, .tar.gz or .tgz.
  3. For a single compressed file, the tool shows one entry with its original name and decompressed size.
  4. For a .tar.gz, it shows every file in the TAR, with sizes and folders.
  5. Press Extract next to an entry to save it.
A single gzip-compressed log file in the UnpackNest TAR/GZ tool: one entry, server.log, ready to extract.
A single gzip-compressed log file in the UnpackNest TAR/GZ tool: one entry, server.log, ready to extract.
A .tar.gz backup in the same tool. Because it contains a TAR archive, every file inside is listed separately.
A .tar.gz backup in the same tool. Because it contains a TAR archive, every file inside is listed separately.

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.

  1. Open the folder that contains the file, click the address bar, type cmd and press Enter.
  2. For a .tar.gz or .tgz: tar -xzf backup.tar.gz.
  3. 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

  1. Double-click the .gz or .tar.gz in Finder. Archive Utility decompresses it; a .tar.gz goes straight to a folder.
  2. In Terminal, gunzip -k report.csv.gz decompresses a single file and keeps the original (without -k, gunzip deletes the .gz after success).
  3. For a tarball: tar -xzf backup.tar.gz.

Linux

  1. Single file: gzip -dk report.csv.gz (or gunzip -k).
  2. Look inside without decompressing to disk: zcat report.csv.gz | head.
  3. Tarball: tar -xzf backup.tar.gz; list it first with tar -tzf backup.tar.gz.
  4. Test integrity: gzip -t file.gz prints 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.

Related guides