Skip to content

Choosing an archive format

Four formats, three genuinely different designs, and one that no free software is allowed to create. Which you want depends almost entirely on who opens it.

Last reviewed

The short answer

Sending something to a person: ZIP. It opens on every Windows, macOS and Linux machine made this century with nothing installed. That is worth more than any compression advantage, and it is the only format about which that is true.

Backing up or moving a directory tree on Unix: tar.gz. It records permissions, ownership and symbolic links, which nothing else in common use does properly, and it compresses better than ZIP.

Squeezing something as small as it will go: 7z. Substantially smaller than ZIP on most material, with AES-256 encryption that can hide the file names as well as the contents. The recipient needs software, which is free but is a step.

RAR: you almost certainly do not need it, and if you do, only WinRAR can make one. That is explained below, because it is the question people arrive with most often.

Why tar.gz beats ZIP on size

The difference is structural rather than a matter of better compression. ZIP compresses each file separately, which is what lets a reader pull one item out of a large archive without touching the rest. A .tar.gz compresses everything as one continuous stream — tar concatenates the files, and gzip wraps the whole result.

That means a compressed tar can exploit repetition between files, and a ZIP cannot. On a folder of fifty similar source files, configuration documents or log files, the difference is substantial. On a folder of unrelated photographs it is nothing, because neither can compress already-compressed data.

The cost is paid at the other end. Because the compression wraps everything, a .tar.gz has no catalogue: listing its contents means decompressing from the start, and getting the last file out means decompressing all of it. A ZIP lists instantly at any size. Which is better depends entirely on whether the archive will be unpacked whole — which a backup or a source release always is.

What compresses, and what does not

This is the single most useful thing to know and it applies to every format. Already-compressed files do not compress again. JPEGs, PNGs, MP3s, MP4s, PDFs and other archives have had their repetition removed already; running any compressor over them gains a fraction of a per cent while costing time.

So a ZIP of fifty photographs is essentially the size of fifty photographs, and that is the format working correctly rather than failing. The reason to archive them is to send one file instead of fifty. Text, documents, source code, spreadsheets and uncompressed images are where compression earns its keep — often to a third or less.

The corollary is that choosing a stronger format for a folder of media is wasted effort. 7z will beat ZIP substantially on source code and barely at all on a photo library.

Why nothing free can create a RAR

RAR is owned. RarLab licenses it, WinRAR is paid software, and the licence on the only source that can create a RAR explicitly forbids using it to build a compatible compressor. Not discourages — forbids, in writing, as the central condition of access.

Decompression is deliberately different. RarLab publishes an unrar source that anyone may use to read the format, which is why 7-Zip, The Unarchiver, VLC and this site all open RAR files quite legitimately. Opening is permitted; creating is not. That asymmetry is why every archiver you have used can extract a RAR and only one can make one.

So when a website offers "ZIP to RAR", one of three things is happening. It renames your .zip to .rar, which fools a file listing and nothing else. It runs a licensed copy of WinRAR on a server, meaning your files were sent to a stranger's machine. Or it does nothing at all behind a progress bar. There is no fourth possibility.

If a system genuinely demands the extension, buy WinRAR. For everything people actually want RAR for — hard compression, splitting into volumes, strong encryption, recovery records — 7-Zip does it better and is free.

Passwords, and the one to avoid

ZIP has two encryption schemes and the difference matters enormously. The original ZipCrypto is broken — recovery tools crack it in seconds — and it is still what a surprising number of "password protect your ZIP" tools quietly use. ZIP with AES-256 is sound, and is what current 7-Zip and WinZip produce when you ask for encryption.

There is a second trap even with good encryption. A standard encrypted ZIP leaves its catalogue readable, so anyone holding the file can see exactly what is inside it without the password. The names of the documents are frequently as revealing as their contents. 7z can encrypt the headers too, and the option is worth ticking.

This site does not offer password protection on archives at all, deliberately: offering the broken scheme would be worse than offering nothing, because it looks like protection. For a genuinely private archive, use 7-Zip with AES-256 and header encryption.

What a download cannot restore

Worth knowing before you unpack a source release or a backup in a browser. Unix permissions, ownership and symbolic links are recorded in a tar and cannot be restored by a download — files arrive with ordinary permissions, so an executable script comes out non-executable and a symlink comes out as the small file it physically is.

For reading a document or pulling out an image on a machine where you cannot install anything, opening it here is exactly right. For unpacking something you intend to build or run, use the command line — tar -xzf is on every Mac and Linux machine, and on Windows since 2018.

Frequently asked questions

Why did my ZIP barely shrink?

Because what went into it was already compressed — photographs, music, video or PDFs. Those formats have already removed their own repetition, so there is nothing left for an archiver to find. The archive is still useful as one file instead of many.

Is 7z safe to send to someone?

The format is fine; the question is whether they can open it. 7-Zip is free on Windows, and The Unarchiver and Keka handle it on macOS — but it is a step, and if the recipient is not technical a ZIP avoids the conversation entirely.

What is the difference between .tar, .tar.gz and .tgz?

A .tar is uncompressed — just files concatenated with their metadata. A .tar.gz is that, compressed with gzip, and .tgz is the same thing with a shorter name for systems that disliked two dots. There is also .tar.bz2 and .tar.xz, which compress harder and more slowly.

Can I open a RAR without WinRAR?

Yes, easily. 7-Zip, The Unarchiver, Keka and even VLC read RAR files, and so does this site. Only creating one is restricted.

Is a password-protected ZIP actually secure?

With AES-256, yes, with the caveat that the file names remain readable unless you use a format that encrypts headers. With the legacy ZipCrypto — still used by some tools without saying so — no; treat it as an obstacle rather than protection.