ZipToolView zip files online — 100% private

What is a tar.gz file?

A tar.gz file (.tar.gz, also written .tgz) is a compressed archive made of two separate formats layered together: a tar archive that bundles many files into one, wrapped in gzip compression that shrinks the result. Opening it is the reverse — gunzip the outer layer, then untar the inner one to recover the original files.

The split exists for historical reasons. tar (Tape ARchive) was invented to stream a directory tree onto magnetic tape; it only packages, it does not compress. gzip (GNU zip) is a pure compressor that works on a single byte stream. Unix tooling composes them the way it composes any small tool: pipe tar’s output through gzip to get a packed-and-compressed file. The result is .tar.gz.

You can open a tar.gz right here in your browser with ZipTool: drop the file onto the page and both layers are decoded entirely on your device — nothing is uploaded to a server. You can browse the archive, search by name, and preview text, images, audio, video, and PDFs inside it without extracting anything to disk. For the dedicated browser workflow, see extracting a tar.gz online.

tar.gz vs ZIP: what is different

ZIP and tar.gz solve the same end problem — pack many files into one compressed file — but with different designs. A ZIP compresses each file individually and keeps a central directory at the end, so a ZIP can list its contents and pull out a single file without reading the whole archive. A tar.gz is one solid gzip stream over a flat tar: to reach a file near the end you generally have to decompress everything before it.

The practical upshot: ZIP is better for random access (open, list, grab one file), while tar.gz is the Unix-native default for source distributions and backups, where you usually extract the whole thing anyway. ZIP is also universally handled by operating systems out of the box; tar.gz is native on Linux and macOS but usually needs a tool on Windows. For a deeper comparison, see archive formats explained.

Naming note: .tar.gz and .tgz mean exactly the same thing — the short form just saves four characters. The same layering produces .tar.bz2 (bzip2), .tar.xz (LZMA2), .tar.zst (Zstandard), and .tar.lz, each swapping the outer compressor for a different algorithm.

The gzip layer and the magic bytes

The outer layer is gzip, a single-stream DEFLATE compressor. Every gzip file begins with the magic bytes 1F 8B, so a program can recognise one from its first two bytes. gzip compresses only one file (or one stream), which is exactly why it is paired with tar: tar provides the many-files-in-one packaging that gzip cannot do alone.

Inside, once gunzipped, sits a tar archive. A tar file is a sequence of 512-byte blocks: a header block per entry (name, size, permissions, timestamp) followed by the file’s data padded to a block boundary. Modern tars carry the ustar magic at byte 257 (POSIX/GNU) or use the newer PAX format for extended attributes. There is no central index — entries are read in order from the start.

How to open a tar.gz file

On Linux and macOS, tar.gz is native: tar -xzf archive.tar.gz extracts it, and most file managers open it with a double-click. On Windows 10 and later, the built-in tar command (a BSD tar) handles it from the command line; 7-Zip and WinRAR add a GUI right-click “extract.”

In a browser: open the .tar.gz in ZipTool and browse its contents with nothing installed. Both layers are decoded locally in your tab — there is no upload and no server copy. This is the fastest way to check what is inside a tarball you just downloaded before you commit to extracting it. The full step-by-step is in how to open a tar.gz file.

  • Linux / macOS: tar -xzf archive.tar.gz (or double-click in the file manager).
  • Windows 10+: tar -xzf archive.tar.gz (built-in), or 7-Zip / WinRAR for a GUI.
  • In-browser: drop the .tar.gz onto ZipTool to preview contents with no install and no upload.

What you can preview inside a tar.gz

Once a tar.gz is open in ZipTool, the entries render the same way they do for a ZIP. Source code and config files — JavaScript, TypeScript, JSON, Python, Markdown, HTML, CSS, and many more — open in a syntax-highlighting editor. Images, audio, video, and PDFs render inline.

Because the decoding runs entirely inside your browser (gzip via the platform’s decompression stream, tar via a local parser), the moment you close the tab the data is gone. There is no upload step for it to persist anywhere. You can even disconnect from the internet after the page has loaded and browsing, searching, and previewing keep working.

Is opening a tar.gz file safe?

A tar.gz is just a container — opening one to look at its contents is low-risk, whether in a terminal, a desktop tool, or a browser. The risk is not in viewing, it is in what you do next. A malicious file extracted and then run is still malicious, and tar.gz is a common delivery format on Unix systems for exactly that reason.

Previewing a tar.gz in ZipTool is a privacy win, not a security guarantee: your file never leaves the browser, so there is no server-side copy, but client-side processing does not make a malicious archive harmless. Treat archives from untrusted sources the same way you always would, and read more in security and privacy.

Frequently asked questions

What is a tar.gz file?

A tar.gz (.tar.gz or .tgz) is a tar archive compressed with gzip — two formats layered together. tar bundles many files into one (no compression); gzip then compresses that single stream with DEFLATE. Opening reverses the order: decompress with gunzip, then untar. It is the standard archive format on Unix systems.

Is tar.gz the same as a ZIP?

No. A ZIP compresses each file individually and keeps a central directory, so you can list contents and extract a single file without reading the whole archive. A tar.gz is one solid gzip stream over a flat tar, so reaching a file usually means decompressing everything before it. tar.gz is Unix-native; ZIP is universal across operating systems.

What does .tgz mean?

.tgz is just the short form of .tar.gz — they are identical. The three-letter extension was a workaround for systems that could only handle one dot and a short extension (notably old FAT filesystems and DOS-era tools). The same shorthand exists for .tbz2 (.tar.bz2) and .txz (.tar.xz).

Can I open a tar.gz file online without uploading it?

Yes. ZipTool decodes a .tar.gz entirely in your browser — gzip through the platform’s decompression stream and tar through a local parser — so the file is never uploaded to a server. Drop the tarball onto the page to browse its contents and preview text, images, audio, video, and PDFs inside it.

How is tar.gz different from tar.xz or tar.bz2?

Only the outer compressor changes. tar.gz uses gzip (DEFLATE) — fast and ubiquitous. tar.xz uses LZMA2 — much better ratio, slower. tar.bz2 uses bzip2 — middle ground, older. The inner tar is the same in all three. Choose by how much you value compression ratio versus speed and compatibility.