ZIP vs RAR vs 7z: which archive format to use
How ZIP, RAR and 7z differ in compression, compatibility, encryption and licensing, and which one to pick when you send, store or receive files.
What an archive does
An archive packs many files and folders into one file, usually with lossless compression. Nothing is lost: extracting the archive gives back the exact original files. That makes archives the easy way to email a folder, ship a download, back up a project or keep related files together.
ZIP, RAR and 7z all do this job. They differ in how well they compress, which devices can open them without extra software, how they encrypt, and who controls the format.
ZIP: the one everyone can open
ZIP dates from 1989 and Phil Katz's PKZIP. Windows, macOS, iOS, Android and ChromeOS all open and create ZIP files with built-in tools, so a ZIP is the format least likely to cause trouble for the person who receives it.
Each file inside a ZIP is compressed on its own, usually with DEFLATE. That means you can pull out one file quickly, and damage to one part of the archive usually affects only the files stored there. It also means similar files can't share compression, so ZIP archives are often larger than 7z or RAR for the same content.
Classic ZIP encryption is weak. Stronger AES encryption exists as an extension, but the built-in tools in Windows and macOS don't always open it, so password-protected ZIPs can be awkward to share.
RAR: strong compression, closed format
RAR was created by Eugene Roshal in 1993. Only WinRAR and the RAR command-line tool can create RAR archives, and the format is proprietary, though free extractors such as 7-Zip and The Unarchiver can open it. The current version, RAR5, arrived with WinRAR 5.0 in 2013.
RAR has a few features others lack. It can add a recovery record that repairs some damage, it splits archives into volumes neatly, and it can compress solid, treating all files as one stream so similar files compress better. It supports AES-256 encryption and can hide the file names too.
Windows 11 can now open RAR files in File Explorer, but older Windows versions, macOS and phones still need an app. If someone sends you a RAR, you don't need to buy WinRAR to read it.
7z: free, open and usually the smallest
7z is the format of 7-Zip, which Igor Pavlov first released in 1999. It is free and open source, and its LZMA and LZMA2 compression with solid mode often makes the smallest archives of the three, especially for software, source code, game files and other large sets of similar files.
7z supports AES-256 encryption and can encrypt the file list as well. Windows 11 opens 7z files in File Explorer in recent versions. On macOS you need an app such as Keka or The Unarchiver, and phones need a file manager that supports it.
The cost of strong compression is speed. Creating a 7z at high settings takes longer than a ZIP, and solid archives must be read from the start to reach a file in the middle.
How much smaller does each one make files?
It depends almost entirely on what you compress. Photos, videos, music and PDFs are already compressed, so none of the three formats shrinks them much. Zipping a folder of JPGs mostly saves the person you send it to from downloading files one by one.
Text, code, databases, logs and documents compress well in every format. That is where 7z and RAR in solid mode usually beat ZIP, because they can reuse patterns across files. For one large file, the gap is smaller.
Which format should you use?
Sending files to someone else: use ZIP. It opens on every device without extra software, and the size difference rarely matters for photos and documents.
Archiving or backing up large amounts of text, code or similar files, where you control the software at both ends: use 7z for the smallest result with a free, open format.
Use RAR only if you need its recovery records or already work in WinRAR. On Linux and in open-source projects, tar.gz is the usual choice.
Converting between formats is simple: extract the archive and pack the files again. Opening a RAR or 7z here and pressing Download all as ZIP turns it into a ZIP in one step.
Staying safe with archives
Archives are a common way to hide malware, because the files inside aren't scanned until they are extracted. Be wary of archives from unknown senders, especially ones that contain .exe, .scr, .js or .bat files, or that ask for a password sent in the same email.
Extracting in the browser doesn't run anything. The files are only listed and saved. Still, scan unknown programs before you open them, and keep in mind that a small archive can expand to a very large size.