Updated October 27, 2026: We replaced the published ratio ranges with our own compression test of source code, logs and photos. We added a WinRAR vs 7-Zip comparison, Windows 11's built-in support for RAR and 7z, steps to convert RAR to ZIP, and a 2025 WinRAR security fix. We also corrected the archive API section: ApyHub's extraction APIs open RAR and 7z files as well as ZIP.
01Introduction
7z makes the smallest archives, ZIP opens everywhere, and RAR sits in between. In our test, 7z made a folder of source code 56% smaller than ZIP did. RAR made it 12% smaller with default settings, and 48% smaller with solid compression turned on. On photos, all three were within 3% of each other, because JPEGs are already compressed.
The short version:
| If you want to... | Use |
|---|---|
| Send files to anyone | ZIP |
| Get the smallest archive | 7z |
| Split a huge archive into parts and repair damaged downloads | RAR |
| Back up or ship files to Linux | tar.gz or tar.zst |
| Protect sensitive files with a password | 7z with AES-256 |
The rest of this post shows the test, explains why the numbers come out this way, and compares the two apps most people choose between: WinRAR and 7-Zip.
02Our test: same files, six formats
Most comparisons repeat the same "30 to 70% smaller" ranges. We wanted our own numbers, so we compressed three kinds of content on the same machine, with each tool's default settings:
- Source code: the Django 5.1.4 source, 6,809 files, 44.4 MB
- Logs: 10 web server access logs we generated, 69.8 MB
- Photos: 19 JPEG photos, 1.4 MB
Tools: Info-ZIP 3.0, 7-Zip 23.01, RAR 7.00 (RAR5 format), GNU tar with gzip 1.12, xz 5.4.5 and zstd 1.5.5, on a 2-core cloud server. We extracted every archive and checked the files matched the originals byte for byte.
Source code (44.4 MB, 6,809 files)
| Format | Size | Smaller than ZIP | Time to compress |
|---|---|---|---|
| ZIP | 15.8 MB | baseline | 1.7 s |
| RAR (default) | 14.0 MB | 12% | 4.7 s |
| RAR (solid) | 8.3 MB | 48% | 8.6 s |
| 7z | 6.9 MB | 56% | 14.1 s |
| tar.gz | 10.6 MB | 33% | 1.6 s |
| tar.xz | 7.0 MB | 56% | 23.3 s |
| tar.zst | 9.7 MB | 39% | 0.3 s |
Logs (69.8 MB, 10 files)
| Format | Size | Smaller than ZIP | Time to compress |
|---|---|---|---|
| ZIP | 9.6 MB | baseline | 1.6 s |
| RAR (default) | 8.7 MB | 9% | 8.7 s |
| 7z | 8.0 MB | 17% | 27.4 s |
| tar.gz | 9.6 MB | 0% | 1.7 s |
| tar.xz | 7.5 MB | 22% | 49.2 s |
| tar.zst | 11.1 MB | 15% larger | 0.5 s |
Photos (1.4 MB, 19 JPEGs)
Every format landed between 96.6% and 99.5% of the original size. 7z saved 3%. RAR saved nothing.
Your numbers will differ with your files and hardware. The pattern holds, and it's worth understanding.
03What the numbers show
1. 7z wins when you have many similar files. On source code, 7z was less than half the size of ZIP. Thousands of files share the same keywords, imports and license headers, and 7z finds that repetition across files.
2. RAR's default leaves a lot on the table. WinRAR doesn't use solid compression unless you tick "Create solid archive" (or pass -s on the command line). With it on, RAR went from 12% to 48% smaller than ZIP on our source code.
3. Already-compressed files don't shrink. JPEG, MP4, MP3 and PDF files are already compressed. Archiving them saves 0 to 3%. Use an archive to bundle them, and use an image or video compressor to make them smaller.
4. Better compression costs time. 7z took 8 times longer than ZIP on source code, and tar.xz took 30 times longer on logs. Extraction is fast for every format, so the cost is paid once.
5. tar.zst is the speed pick. It compressed source code in 0.3 seconds and still beat ZIP by 39%. At its default level it lost to ZIP on logs, so for archives you keep, raise the level (zstd -19, which got the logs to 7.6 MB).
04Why 7z beats ZIP: solid compression
ZIP compresses every file on its own. That makes it easy to pull one file out of a large archive. The cost is that ZIP can't reuse patterns from one file in the next.
7z compresses all files as one stream by default. This is called solid compression. A pattern found in file 1 is reused in file 2,000, which is why it wins on source code and similar documents.
The trade-off: to extract one file from a solid archive, the tool has to decompress everything stored before it. For backups you restore all at once, that's fine. For an archive people open one file at a time, ZIP is more convenient.
tar.gz and tar.xz work the same way. tar joins the files into one stream first, then gzip or xz compresses it. That's why tar.gz beat ZIP by 33% on source code while using the same compression method.
05WinRAR vs 7-Zip
Most people searching "RAR vs 7z" are really choosing an app. Here's how the two compare.
| WinRAR | 7-Zip | |
|---|---|---|
| Price | Paid license, 40-day trial | Free, open source |
| Creates | RAR, ZIP | 7z, ZIP, tar, gzip, xz and more |
| Opens | RAR, ZIP, 7z and more | 7z, ZIP, RAR and more |
| Best compression | RAR solid | 7z (smallest in our test) |
| Repair damaged archives | Yes, with recovery records | No |
| Split into parts | Yes | Yes |
| Platforms | Windows (command-line RAR for Linux and macOS) | Windows (command-line builds for Linux and macOS) |
WinRAR. The license is perpetual, and you can try it free for 40 days (WinRAR). After the trial, WinRAR keeps working and shows a reminder to buy (tbreak), though the license terms say you should pay to keep using it. Its standout feature is recovery records, which can repair a partly damaged archive.
7-Zip. Free, including for commercial use, and actively maintained. Version 26.05 came out on October 21, 2026 (7-Zip). It made the smallest archives in our test.
Keep either one updated. In 2025, attackers used a WinRAR flaw (CVE-2025-8088) to hide malicious files inside archives that looked harmless. It affected WinRAR 7.12 and was fixed in 7.13 (Help Net Security). Archive tools are a common attack target, so update whichever one you use.
You may not need either. Windows 11 can open RAR and 7z files without extra software since version 23H2, and can create 7z and tar archives since 24H2. It can't create RAR files or open encrypted archives (Pureinfotech).
Verdict: for most people, 7-Zip. It's free, and it compressed better. Choose WinRAR if you need recovery records or already work with RAR files.
06Encryption compared
| Format | Encryption | Hides file names? |
|---|---|---|
| ZIP (ZipCrypto) | Old and easy to break | No |
| ZIP (AES-256) | Strong | No |
| 7z | AES-256 | Yes, if you turn on header encryption |
| RAR5 | AES-256 | Yes, with "Encrypt file names" |
Many tools still use ZipCrypto by default, so pick AES-256 by hand when you password-protect a ZIP. For sensitive files, 7z with AES-256 and header encryption is the safest choice, because it hides the file list too.
07How to convert RAR to ZIP
There's no direct conversion. You extract the RAR, then compress the files as a ZIP:
- Right-click the RAR file and choose Extract All (Windows 11) or 7-Zip > Extract Here.
- Select the extracted files.
- Right-click and choose Compress to > ZIP File (Windows 11) or 7-Zip > Add to archive with ZIP as the format.
The same steps convert 7z to ZIP, or RAR to 7z.
08Archives inside an app
When your app receives archives from users, or has to send files to them, the question changes. You can't choose the format users upload, and the archive you send has to open on any device.
ApyHub has APIs for both sides:
- Unarchive Files API: extracts ZIP, RAR and 7z archives and returns a link for each file.
- Generate Archives API: bundles files or URLs into a ZIP.
- Generate Secure Archives API: creates password-protected ZIPs.
- Unarchive Secured Files API: opens password-protected ZIP, RAR and 7z archives.
We sent a solid RAR5 archive to the Unarchive Files API:
curl -X POST "https://api.eu.apyhub.com/apyhub/unarchive-files/url/link" \
-H "apy-token: $APY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/uploads/backup.rar"}'It returned a signed link for each of the two files inside:
{
"data": [
"https://apyhub-outgoing.s3.eu-west-1.amazonaws.com/.../stest1.txt?X-Amz-Expires=900&...",
"https://apyhub-outgoing.s3.eu-west-1.amazonaws.com/.../stest2.txt?X-Amz-Expires=900&..."
]
}A 7z archive worked the same way. The links expire after 15 minutes (X-Amz-Expires=900), so download the files or copy them to your own storage.
ZIP is the right format for files your app sends out, because every device can open it. Extraction is where all three formats matter, since you don't control what users upload. Running extraction through an API also keeps archives from unknown users off your own servers.
Every ApyHub API is also available through ApyHub MCP. Claude, ChatGPT, Cursor and other AI assistants can call these APIs directly, with no wrapper code. For example: "unzip this upload and list what's inside". The assistant calls a ready-made endpoint instead of writing extraction code, which gives consistent results and uses fewer tokens.
Try the Unarchive Files API free →
09Conclusion
Use ZIP when someone else has to open the file. Use 7z when size matters and you control both ends: in our test it was 56% smaller than ZIP on source code. Turn on solid compression if you use RAR. Use tar.gz or tar.zst for Linux. Don't expect any format to shrink photos, videos or PDFs.
Between the apps, 7-Zip is free and compressed best. WinRAR is worth paying for if you need recovery records.
Start free on ApyHub, no card required →
10FAQ
Which is better, RAR, ZIP or 7z?
7z makes the smallest files. ZIP is the most compatible. RAR sits between them and adds recovery records. In our test, 7z was 56% smaller than ZIP on source code.
Is 7-Zip better than WinRAR?
For most people, yes. 7-Zip is free and made smaller archives in our test. WinRAR is better if you need recovery records for damaged archives.
Is WinRAR free?
No. It has a 40-day free trial and then needs a paid license. It keeps working after the trial with a reminder to buy. 7-Zip is free.
Does 7z compress better than ZIP?
Yes, especially with many similar files. 7z was 56% smaller than ZIP on source code and 17% smaller on logs. On JPEGs, the difference was 3%.
Why doesn't zipping make my photos or videos smaller?
JPEG, MP4 and MP3 files are already compressed. Archiving them saves 0 to 3%. Use an image or video compressor instead, such as the Image Compression API.
How do I convert RAR to ZIP?
Extract the RAR file, then compress the extracted files as a ZIP. Windows 11 and 7-Zip can both do it from the right-click menu.
Can Windows 11 open RAR and 7z files?
Yes, since version 23H2. Since 24H2 it can also create 7z and tar files. It can't create RAR files or open encrypted archives.
What is solid compression?
Compressing all files in an archive as one stream, so patterns repeated across files are stored once. 7z uses it by default. RAR needs it turned on.
How can I extract ZIP, RAR or 7z files in my app?
Send the archive to the Unarchive Files API and get back a link for each file inside. Password-protected archives go to the Unarchive Secured Files API.
How can I test the archive APIs before writing code?
Use the "Try it" panel on each API page, or save the request in Voiden, a free, open-source API client that keeps requests as files in your project. You can also ask an AI assistant connected to ApyHub MCP to run it.
11About ApyHub
ApyHub runs a catalog of ready-made APIs and is the trusted operational layer between your application and the services it depends on. One subscription, billed in atoms, covers the whole catalog of over 1,500 endpoints and capabilities, and it keeps growing. Every service is evaluated before it is listed and carries machine-readable certification covering GDPR, SOC 2 and ISO 27001. Every endpoint is MCP-ready by default. ApyHub runs dedicated EU and US regions and serves more than 65,000 developer workspaces every month. Start on the free tier with no card, or publish your own API on ApyHub.
