ZIP and TAR both turn many files into one, but they come from different worlds. ZIP grew up on PCs and compresses each file as it adds it. TAR grew up on Unix and only bundles; compression is applied afterwards by a separate tool, which is where names like .tar.gz come from.
How TAR works
TAR (tape archive) dates back to 1979 Unix and was designed for writing to tape. It stores each file as a 512-byte header followed by the file's data, one after another, with no index at the end. A plain .tar file is not compressed at all.
To compress it, the whole TAR stream is passed through a compressor:
.tar.gzor.tgz: gzip (Deflate), the most common.tar.bz2: bzip2, smaller but slower.tar.xz: xz (LZMA2), smaller still.tar.zst: Zstandard, fast with good ratios
How ZIP works
ZIP compresses each file individually and writes an index, the central directory, at the end of the archive. A reader can list the contents and pull out a single file without touching the rest. See What is a ZIP file? for the details.
Key differences
| Feature | ZIP | TAR + gzip |
|---|---|---|
| Compression | Per file, built in | Whole archive, by a separate compressor |
| Many small, similar files | Good ratio | Often a little better, because files are compressed together |
| Listing contents | Fast; reads the index | Must decompress and read the whole stream |
| Extracting one file | Fast | Must read through everything before it |
| Damage | Usually limited to the affected file | Can make everything after the damaged point unreadable |
| Unix permissions and symlinks | Supported by some tools; ownership usually not kept | Fully supported; the format was built for it |
| Streaming | Possible, but the index is written last | Natural; designed for pipes and tapes |
| Built-in support | Windows, macOS, Linux, iOS, Android | Linux and macOS; Windows 10 and 11 via the tar command; recent Windows 11 in File Explorer |
Common commands
# ZIP
zip -r archive.zip folder/
unzip -l archive.zip
unzip archive.zip -d destination/
# TAR + gzip
tar -czf archive.tar.gz folder/
tar -tzf archive.tar.gz
tar -xzf archive.tar.gz -C destination/In tar, c creates, x extracts, t lists, z uses gzip and f names the archive file. The folder given to -C must already exist. GNU tar and bsdtar detect the compression when extracting, so tar -xf archive.tar.gz works too.
Which should you use?
- Sharing with people on Windows, Macs or phones: ZIP.
- Linux software, source releases and server backups:
.tar.gzor.tar.xz, because they keep permissions and symlinks and every Unix system hastar. - Frequently grabbing single files from a big archive: ZIP, thanks to its index.
- Squeezing many small text files as small as possible:
.tar.xzusually beats ZIP.
Converting between ZIP and TAR
TAR to ZIP turns .tar, .tar.gz or .tgz files into a ZIP that opens natively on Windows and macOS, keeping folders and timestamps. ZIP to TAR goes the other way, producing .tar or .tar.gz with Unix permissions kept and long or non-English names preserved through pax headers. Both run locally in your browser.
The extension alphabet soup
The stacked suffixes describe a pipeline, not one format. archive.tar is an uncompressed bundle. archive.tar.gz means that bundle was passed through gzip, whose container is specified in RFC 1952. archive.gz is the same compressor applied to a single file, with no bundle inside.
| Extension | What it actually is |
|---|---|
| .tar | A TAR bundle, no compression |
| .tar.gz, .tgz | TAR bundle compressed with gzip |
| .tar.bz2, .tbz2 | TAR bundle compressed with bzip2 |
| .tar.xz, .txz | TAR bundle compressed with xz |
| .tar.zst | TAR bundle compressed with Zstandard |
| .gz | One gzip-compressed file, not a bundle |
| .zip | A ZIP container with its own index, compressed per file |
A tool that says it opens .gz may only handle single files. To unpack a bundle you need the TAR layer as well, which is why .tar.gz is often called a tarball.
Metadata: permissions, links and names
TAR grew up as a backup format for Unix, so every 512-byte header carries a mode, owner and group numbers, a modification time, and a type flag that can mark a symbolic link or a directory. That is why source tarballs preserve executable bits and links when unpacked on Linux or macOS.
ZIP was designed for PCs. It stores an MS-DOS-style timestamp, generic external attributes and a UTF-8 name flag; it has no universal place for Unix ownership, and symbolic links are handled differently by different tools. When exact permissions and links matter, keep the archive as TAR.
- Long and non-ASCII names: TAR uses pax or GNU extension records; ZIP uses the UTF-8 flag. Both work in modern tools.
- Ownership: TAR records numeric IDs, but a normal extraction does not make you the owner; only a privileged restore does.
- File times: TAR keeps seconds, classic ZIP stores time in two-second steps, although extra fields can carry finer values.
- Neither format records why a file exists or what application created it; do not treat archive metadata as provenance.
How extraction works in practice
The structural difference becomes obvious when you want one file out of a large archive. A ZIP reader jumps to the entry using its central directory. A TAR reader must walk the stream from the beginning, skipping headers and data until it reaches the wanted file, because there is no index at the end.
- ZIP: read the directory, pick an entry, seek to its offset, decode just that entry.
- TAR: read the first header, advance by the stored size, repeat until the target appears.
- Compressed TAR: decompress the stream as you go, so a damaged byte early on can affect everything after it.
- Before extracting either format, check paths: entries such as
../fileor absolute paths must never write outside the chosen folder.
A high compression ratio is a warning sign in either format. A small archive that claims to expand to gigabytes can exhaust memory or disk; Aback ZIP warns before processing such files.
TAR and GZIP support in Aback ZIP
Aback ZIP treats TAR and gzip as separate layers, so it can read compressed tarballs and single compressed files, but it cannot create every codec it can read. The exact division is below; see Create a TAR.GZ file for a worked example of the supported write path.
| Input or output | What Aback ZIP does |
|---|---|
| Plain .tar | Read, browse and write |
| .tar.gz and .tgz | Read, browse and write |
| .tar.bz2, .tar.xz, .tar.zst, .tar.lzma | Read and extract |
| Single .gz file | Compress and decompress |
| Single .bz2, .xz, .zst or .lzma file | Decompress only |
| 7z and RAR archives | Not supported; detected and reported |
Two limits are worth knowing: XZ files that use BCJ filters for executables are not supported, and Zstandard streams that need a dictionary are not supported. Zstandard checksums are not verified. Nothing is uploaded to work around a codec the browser engine cannot handle.
Common tasks, side by side
# Inspect without extracting
unzip -l archive.zip
tar -tf archive.tar.gz
# Extract one named file
unzip archive.zip path/to/file.txt
tar -xzf archive.tar.gz path/to/file.txt
# Create with a chosen level
zip -9 -r archive.zip folder/
tar -cjf archive.tar.bz2 folder/Note that unzip takes the archive name first and the member path second, while tar -x takes the member after the archive. Both commands extract into the current directory unless you give an output directory, so inspect paths before running them on an unfamiliar file.