Docuboxer
By Sergio Alonzo Piña··5 min read

RAR vs ZIP vs 7z: Which Format Should You Use?

What changes between the three formats, how much each one compresses in a test with real files, and which to pick for what you're about to send.

Use ZIP unless you have a reason not to: every operating system opens it without extra software. Pick 7z when file size matters most and the recipient can install a program, and treat RAR as something you receive rather than something you create, since making one needs WinRAR and it no longer offers a clear edge. If a .rar or .7z lands in your inbox and you don't want to install anything, you can open it in your browser with Docuboxer: it lists the contents, previews files and downloads what you need without uploading the archive anywhere.

What actually differs between RAR, ZIP and 7z?

All three pack many files into one. They differ in the compression algorithm, in who can create them, and in encryption.

  • ZIP (1989) compresses each file on its own with deflate. It is the most compatible: Windows and macOS open and create it with no extra software.
  • RAR (1993) is a proprietary format. Creating a .rar takes WinRAR, although free programs can read it. It offers recovery records, which can repair a damaged archive.
  • 7z (1999) is open and uses LZMA2 by default. The free 7-Zip creates it, and it supports AES-256 encryption.

On a Mac, Archive Utility opens ZIP but not RAR or 7z, so someone else's .rar still needs a third-party app or a browser tool there. One recent change matters on Windows: since 23H2, Windows 11 File Explorer opens RAR and 7z natively through libarchive, the same open-source engine our tool runs on. It has one limit: it can't open or create password-protected archives.

How much smaller does each one get? A measurement

Articles say 7z compresses better than ZIP, and it does, but the size of the gap is what counts. We compressed three sets of files from our own repository with ZIP (Python's zipfile module, deflate, level 9) and with LZMA2, the algorithm 7z uses (Python's lzma module, preset 9, over a single tar stream for the solid case and file by file for the other). RAR isn't in the test because its compressor is proprietary. It is a small sample from one project: other files will give other numbers, though the ranking rarely changes.

SetOriginal sizeZIPLZMA2 solidLZMA2 per file
317 Markdown files (2.39 MB)100%41.7%25.9%39.2%
718 TypeScript and TSX files (7.55 MB)100%32.1%17.7%30.4%
3 PNG and JPG images (0.13 MB)100%97.5%98.4%97.4%

Here is how to read it. On text and code, solid LZMA2 produces roughly half the size of ZIP. On images and anything else already compressed, the format hardly matters, because none of them shrinks it (with only three images this is a hint, not proof). Also, much of 7z's edge comes from being solid, meaning it compresses everything as one block. Compressing each file separately with LZMA2 gave 39.2% and 30.4% on the text and code sets, against ZIP's 41.7% and 32.1%, a small improvement.

Solid archives have a price. To extract one file you must decompress what precedes it in the block, so pulling a single file out of a big solid 7z or RAR takes longer than from a ZIP.

Which one is safest for a password?

Classic ZIP encryption (ZipCrypto) is considered weak. ZIP also supports AES-256, but not every program reads it. 7z with AES-256 is the strongest and most widely supported choice. RAR encrypts too, and both 7z and RAR can hide the file names, which ZIP can't: with a ZIP, anyone can see the list of names without the password.

A practical caveat: our tool's engine opens ZIP files with classic passwords but not password-protected RAR files, and support for modern encryption varies between viewers. If you're sending something sensitive, ask the recipient what they will open it with before you choose a format.

Which one fits your situation

  • Sending files to someone whose setup you don't know: ZIP.
  • A backup of text or code where every megabyte counts: 7z.
  • Photos, videos or PDFs that are already compressed: ZIP. 7z adds nothing here.
  • Large files that might get damaged in a download: RAR with a recovery record, if you have WinRAR.
  • An archive that already arrived as RAR or 7z when you don't want to install anything: open it in the browser.

What to do with a suspicious archive

An archive can hold surprises: paths with "../" that write outside the destination folder (the flaw known as zip slip), or a decompression bomb, a tiny file that expands to gigabytes. Opening it in the browser first lets you see the file list, sizes and paths without extracting anything to disk. Docuboxer reads the sizes the archive declares and stops obvious bombs before extracting, truncates extraction at the declared size and warns about dangerous paths. If the contents look doubtful, check what each file really is with the File Inspector, and read a file extension doesn't tell you what a file is.

Frequently asked questions

Which is better, RAR, ZIP or 7z?

ZIP if you value compatibility, since it opens on any computer with nothing to install. 7z if you value size and strong encryption. RAR only makes sense if you already work with WinRAR or need its recovery records.

How do I open a RAR file without WinRAR?

Since Windows 11 23H2, File Explorer opens RAR natively (without a password). On other systems you can open it in the browser with a tool like Docuboxer's, which processes it locally without uploading it.

Why doesn't my ZIP get any smaller?

Because its contents are already compressed. JPG photos, videos, PDFs full of images and modern Office files barely shrink with any format. In our test, with only three images, ZIP left 97.5% of the size and solid LZMA2 left 98.4%.

Can a damaged archive be recovered?

Sometimes. RAR can carry a recovery record that repairs damaged blocks. In ZIP and 7z, files that remain intact can often still be extracted even when the rest fails.

Is it safe to open an archive in the browser?

Yes, if it is processed locally: the archive isn't sent to a server and nothing is executed. Still, don't run the executables inside it afterwards unless you trust the sender.

Open your RAR, ZIP or 7z file

Drop the archive, browse its contents and download only what you need. Free, and it's never uploaded.

Open RAR, ZIP and 7z →

Related tools