ZIP, GZIP and TAR: Which Archive and Compression Format to Use
Archive formats seem interchangeable until you try to send a Linux-style .tar.gz to a colleague on Windows, or open a .gz file and find only one file inside. ZIP, GZIP and TAR do different jobs, and the confusion comes from the fact that two of them are about packaging and one is about compression. This guide untangles the three, explains when each makes sense, and says plainly which of them our tools can create and extract.
Two different jobs: bundling and compressing
It helps to separate two ideas. Archiving means bundling many files and folders into a single file, keeping names and folder structure. Compressing means making data take up fewer bytes. Some formats do both; some do only one:
- ZIP bundles and compresses, file by file.
- TAR only bundles. A plain
.tarfile is not smaller than the sum of its contents. - GZIP only compresses, and it compresses a single stream of data. It has no idea of folders or multiple files.
On Linux and macOS you commonly see TAR and GZIP combined as .tar.gz or .tgz: TAR bundles the files, GZIP then compresses the bundle.
ZIP: the universal choice
ZIP is understood natively by Windows, macOS, Android and iOS, and by countless programs, so it is the safest format when you do not know what the recipient uses. Each file inside is compressed separately, which has two practical consequences. First, you can extract a single file without unpacking everything. Second, compression cannot take advantage of similarity between files, so a TAR plus GZIP of many near-identical files can end up smaller. ZIP files keep file names and folders, and can be protected with a password, although older ZIP password schemes are weak.
With Create ZIP you choose files, set the ZIP's name, optionally place everything inside a named folder and pick a compression level: Store (no compression), Fast, Normal or Maximum. Normal is a good default. Store is sensible for files that are already compressed, such as JPG pictures, MP3 and MP4 audio or video, and PDFs with images, because compressing them again saves almost nothing and wastes time. Extract ZIP unpacks an archive and lets you download its files. It cannot open password-protected (encrypted) ZIP files; for those, use a desktop app that asks for the password.
GZIP: compress one file well
GZIP compresses one file into a .gz file. It is widely used for text-like data, such as logs, CSV exports, JSON, SQL dumps and web assets, where it often shrinks files dramatically. It does not store folders, and opening a .gz yields a single file. Use GZIP Compress to turn a file into .gz and GZIP Decompress to open one. Because GZIP is a single-file tool, it is the natural choice for a large data file that you want to store or send in the smallest form, such as a big CSV from our CSV versus Excel versus JSON discussion. Photos and videos will hardly shrink, as they are already compressed.
TAR: bundling for Unix-style workflows
TAR, short for tape archive, was designed to write many files into one stream while preserving names, folders, permissions, timestamps and symbolic links. These attributes matter for software distribution and backups on Linux and macOS. TAR on its own does no compression, which is why it is usually paired with GZIP (.tar.gz), or with other compressors. Windows can open TAR files in recent versions, and most archive programs can.
To be clear about our tools: Create ZIP, Extract ZIP, GZIP Compress and GZIP Decompress run in your browser. We do not offer a browser tool that creates or opens TAR or .tar.gz files. An Archive Converter that converts between ZIP, TAR, GZ and TGZ is listed on our site as a Pro, server-based tool that is not available yet. If you need to open a .tar.gz today, use the built-in tools of your operating system or a desktop archive program.
Which one should I use?
- Sending several files to a person: ZIP.
- Sending a folder structure to someone unknown: ZIP.
- Storing or sending one big text-like file: GZIP, or ZIP if the recipient is less technical.
- Backups or software packages for Linux, where permissions and links matter: TAR with GZIP.
- Files that are already compressed (photos, videos, music): ZIP with Store, or send them as they are. Compression adds almost nothing.
- Sensitive content: encrypt it. A plain ZIP is not private. File Encrypt locks a file with a password using AES-256. Share the password through a different channel.
Step by step: zip several files
- Open Create ZIP and add your files; up to 500 can be added at once.
- Type a name for the archive, for example
invoices-november. - Choose a folder name inside the ZIP, or clear it to put files at the top level.
- Leave compression on Normal unless the files are already compressed, in which case choose Store.
- Create the ZIP and download it.
- Open it once on your own device to confirm that everything is inside before sending it.
For anything important, record the archive's checksum with File Hash and send it alongside, so the recipient can confirm the file arrived intact; see how checksums verify downloads.
Pitfalls and limits
Compression does not help already-compressed data
Zipping a folder of JPG photos might shrink it by one or two per cent. If you need the files smaller, shrink the pictures themselves, as explained in reducing image size.
File names and special characters
Very long names, unusual characters and names that differ only by letter case can cause trouble when archives move between operating systems. Keep names short and plain.
Archives inside archives
Zipping a ZIP gains nothing and just adds a step.
Browser memory
Because our archive tools run in the browser, very large archives, such as several gigabytes, may exceed what a phone or older computer can hold in memory. For huge jobs, use a desktop archive program.
Security of unknown archives
Only open archives from sources you trust, and be careful of executable files inside them. Extracting an archive does not run anything, but double-clicking a program afterwards does.
Written by SmarTech Apps. General information only, not legal or professional advice. Questions or corrections? Contact us.