TAR vs ZIP
Tar and ZIP solve the problem in different orders. Tar only bundles files — compression is a separate layer applied to the whole bundle, giving .tar.gz or .tar.xz. ZIP compresses every file on its own and adds an index of them at the end. Almost every practical difference follows from that.
Do it in your browser, nothing uploaded
- Convert TAR to ZIPTurn a .tar into a .zip in your browser. Entries are read from the tar stream and compressed into a new ZIP; nothing is uploaded.
- Convert ZIP to TARConvert a ZIP into a TAR archive locally. Entries are decompressed and written into a new USTAR container with PAX headers where paths need them.
- Convert TAR.GZ to ZIPConvert .tar.gz or .tgz archives to ZIP in your browser. The gzip layer is decompressed, the tar is read, and a fresh ZIP is built locally.
- Open a TAR fileOpen and extract .tar archives in your browser: v7, USTAR, PAX and GNU long names. See every entry, then download all of it or one file. Nothing is uploaded.
Side by side
| TAR (.tar, .tar.gz) | ZIP | |
|---|---|---|
| Origin | Version 7 Unix, 1979 | Phil Katz / PKWARE, 1989 |
| Identified by | ustar at byte 257 (no signature at offset 0) | 50 4B 03 04 at offset 0 |
| Compression | None; gzip, bzip2, xz or Zstandard over the whole archive | Per file; each entry names its method, such as DEFLATE |
| Index | None — headers are walked one by one | Central directory at the end |
| Extracting one file | A .tar.gz must be decompressed up to that file | Direct |
| Many small, similar files | Smaller when compressed: repetition across files counts | Each file compressed alone |
| Unix metadata | Permissions incl. setuid, owner, symlinks, hard links, devices | Permission bits and symlinks via Info-ZIP conventions; no devices |
| Timestamps | 1-second, or sub-second with PAX | 2-second DOS time with no time zone, unless an extra field adds more |
| Streaming | Natural: tar -c dir | ssh host tar -x | Writing needs data descriptors; reading wants the end of the file |
| Encryption | None | ZipCrypto (weak) or AES-256 |
| Windows | tar.exe since Windows 10 1803; File Explorer from Windows 11 23H2 | File Explorer since Windows Me and XP |
| macOS and Linux | Built in everywhere | Built in on macOS; unzip on Linux where it is installed |
When tar is the right choice
- Unix file trees that must come back exactly — backups, source releases, container image layers. Owners, permission bits, symlinks and hard links survive.
- Smallest size for many small files — a .tar.xz or .tar.gz of a source tree beats a ZIP of it, because the compressor sees across files.
- Pipelines — tar reads and writes streams, so it can go straight over a network or into a compressor without a temporary file.
When ZIP is the right choice
- Sending to Windows users — double-click works on every version, not only Windows 11.
- Pulling single files out of a large archive — the central directory gives direct access without decompressing everything before it.
- Password protection — ZIP has AES-256; tar has no encryption at all.
- Updating in place — files can be added or removed by rewriting the central directory (
zip -u,zip -d); a compressed tar must be rebuilt.
The same jobs, in both
tar -czf project.tar.gz project/ # create
zip -r project.zip project/
tar -tzf project.tar.gz # list
unzip -l project.zip
tar -xzf project.tar.gz -C out/ # extract into out/
unzip project.zip -d out/Converting between them keeps every file byte for byte. TAR to ZIP compresses the contents and keeps timestamps and read, write and execute bits; ownership, device nodes and symbolic links do not cross, and hard links become copies. ZIP to TAR writes USTAR with PAX headers where a path needs one.
Questions
Is tar.gz better than ZIP?
Smaller for many small similar files, and better at preserving Unix metadata. Worse for pulling out one file, and less convenient on older Windows. For sending to arbitrary people, ZIP; for Unix backups and source releases, tar.gz or tar.xz.
Does tar compress files?
No. Tar bundles; gzip, bzip2, xz or Zstandard compresses the bundle. A plain .tar is about the size of its contents plus headers.
Can ZIP keep Unix permissions?
Partly. Info-ZIP records permission bits in each entry's external attributes and unzip restores them, but ownership, device nodes and setuid bits are not carried portably. Tar keeps all of them.
How do I convert a tar to a ZIP?
In a browser, with the TAR to ZIP or TAR.GZ to ZIP converter here — nothing to install, nothing uploaded. On the command line, extract with tar -xf and re-pack with zip -r.