Compressing with RAR vs ZIP

85

21

A lot of people are compressing files with RAR, sending compressed files with RAR and so on.

ZIP is more standard and works on all platforms. Windows users have ZIP included and Linux users have no trouble with that file format.

The tests I did sometime ago showed me that RAR compress better (some kilobytes, no more) but not enough to use a non-free program when ZIP works on almost all computers for free.

Why do some people use RAR rather than ZIP for compressing?

FerranB

Posted 2009-07-16T17:25:55.033

Reputation: 1 059

Question was closed 2017-10-09T14:27:14.497

rar has better compression ratio and far more features. Just look at the comparisons on the internet like this and you'll see

– phuclv – 2017-10-09T13:29:00.147

1@FerranB, did you use a wide variety of test files in your tests? Not everything compresses the same; the ratio depends on what you are compressing. – Synetech – 2011-08-15T06:07:33.177

4This question is seeking opinions, and subjective arguments. As such, it should be a community-wiki. – Sampson – 2009-07-16T17:27:53.030

13That isn't the reason for community wiki. – Lance Roberts – 2009-07-16T17:41:26.383

3Actually, I'd like to vote in 7-zip if Ferran does not mind. – nik – 2009-07-16T17:54:09.160

I may be sounding a little harsh in my comments, please note my focus is not on the people using RAR or ZIP, its on these tools themselves. – nik – 2009-07-16T17:58:30.307

It's difficult to express the right tone in short comments. That's totally normal. Even though we now have 600 chars, no one writes them that long... – R. Martinho Fernandes – 2009-07-16T18:00:01.127

As a token of respect, I have not and, shall not down vote any answer on this question at any time. – nik – 2009-07-16T18:00:12.127

6@Lance It is actually exactly what community wiki is for. I agree with Jonathan, subjective and should be a community wiki. – BinaryMisfit – 2009-07-16T18:06:33.127

3@Lance - any question that doesn't have a one and definite answer should be community wiki. There have been enough discussions on the subject on SO, so check there to see the unofficial policy on CW. – Rook – 2009-07-17T12:24:41.270

Answers

156

Stop using these WinRAR and WinZip tools -- shift to 7-Zip.

  • It's free
  • available across platforms, as command-line and GUI
  • available in portable form across platforms
  • has good compression ratio (check the site or try for yourself)
  • has no pop-up pain
  • allows you to use most of the other formats
  • it is also open-source
  • can be used in commercial and personal development (within GNU LGPL constraints)
  • live support forum at Sourceforge
  • Vista 32-bit compatibility
  • multiple languages supported

The only compression format I find not supported for extraction is ACE.

References.


I am told that my opening sentence to this answer feels 'markety'.

I take it with all the good intention, because
without being paid for this free software or
being in any way associated with it or, the people making it,
I strongly feel the desire to push it to everyone I remotely know.

This comes from my innumerable encounters over the years with
people using these other tools and muttering about incompatibilities,
annoying pop-ups and many other problems, yet, somehow
continuing to miss 7-Zip when it arrived on the scene.

I have since decided to take every opportunity to publicize 7-Zip.

nik

Posted 2009-07-16T17:25:55.033

Reputation: 50 788

Zzips main drawback is that it is incredibly slow when extracting a file and can't create easy multi volume sfx archives. – Jim B – 2014-09-07T00:56:59.583

@Molly7244 KGB looks interesting, but I am scared by the fact that a simple file compressor requires me to disable my OS's security features to run it (it says I have to completely disable UAC in Vista). – davr – 2010-05-17T17:43:00.547

4Besides the style that can be badly taken, I don't especially like the fact that the question "rar or zip, which is better" is answered with "7zip". So ok, we know, 7 zip is loved by hundreds (probably allegedly), and that explains why the upvotes are so numerous. But it's a pity that the preferred answer to this question is finally a bit off-topic. – Gnoupi – 2010-05-24T14:27:24.270

@Gnoupi, why pity if a more popular answer is beyond the range of the options in such a question? Should be fine as long as it serves the purpose. For example, if there were a newer tool that did all 7z does and more... and it was recognized, it would (and should) raise beyond this answer as a new reference. – nik – 2010-05-26T02:03:57.123

Last I checked 7z was, like tar.gz/tar.bz2, extremely slow when it comes to extracting a single file out of an archive as everything before that file had to be processes for the file to be extractable. rar/zip don't have that problem. – Grumbel – 2010-07-25T17:24:33.853

Something that RAR can do and 7-zip can't: Create mutli-volume SFX archives. You need to fiddle with NSIS to achieve that and need serious planning beforehand... – Saxtus – 2010-10-16T01:04:22.970

WinRAR is free too, although not for commercial purposes. Plus, it fully supports both .rar and .zip, both for creating and reading. I know that this answer is old, but it requires an update. Furthermore, .rar can provide very good compression, particularly through solid archives. – John – 2020-02-27T17:52:28.907

If compression's what your after, then check out NanoZip. It’s got an insane compression ratio (along with a commensurate compression-time).

– Synetech – 2011-08-15T06:06:09.993

52This doesn't quite answer the question: Compressing with RAR vs ZIP. – R. Martinho Fernandes – 2009-07-16T17:49:27.207

1Yes Martinho, I am requesting for an extra candidate in the election. – nik – 2009-07-16T17:55:24.323

17-zip is insanely good. I've used it to compress 50GB+ of .log files without any problems - it spreading the load over 4 cores and allowing you to pause it. Also the fact that 7-Zip supports both .rar and .zip allows you to remove WinZip/WinRar entirely. – Lazlow – 2011-11-30T19:42:29.920

2It is a well-formed and informative answer, so I would go against downvoting it, though. – R. Martinho Fernandes – 2009-07-16T18:00:58.410

Well, perhaps except that first line. It feels a bit harsh and "markety". – R. Martinho Fernandes – 2009-07-16T18:01:46.693

Plus it's got a LGPL library for inclusion in setup apps and the like! – MiffTheFox – 2009-07-18T02:52:14.743

@Miff, Exactly! There are a lot of installers already using 7z. – nik – 2009-07-18T04:32:12.533

4i would upvote this post if it weren't for the poor style, starting a post with telling folks what to use and what not is insulting. make your recommendation and respect the readers' intelligence to make up their own mind ... as for WinRAR, there are still scenarios where you achieve better compression, so it is still a viable alternative. 7-Zip is superior to Zip but not necessarily to RAR. – None – 2009-11-04T20:37:23.293

@Molly, the first line is NOT meant to be insulting. I have tried to express that many times (not just on Superuser); sometimes it takes a little more to get the message out in clear. Please take a look at my other answers to check how I approach them. And, it would be useful if you gave some details on how 7-zip may-not-be superior to RAR -- if you add that data here as a new answer, it could be useful to people. – nik – 2009-11-05T02:44:52.617

77-Zip is also VERY good at using several processors, which Winrar and Winzip are neither very good at. – Stefan Thyberg – 2009-07-19T16:28:03.620

Nik, i already said that RAR compresses certain files better than 7-Zip, so telling folks to STOP using it is baloney (unless, of course, you consider compression ratio a minor factor in the evluation of a compression tool). have you ever heard of peaceful co-existence? :) – None – 2009-11-06T01:23:43.213

@Molly, I am not giving my own data. I suggest you check RAR compression against 7-zip and others yourself and also look at other places of comparison (you can scroll down at http://www.7-zip.org/, but that would be considered 'biased' I guess. Maybe Pavlov picked two samples where 7z worked better...). Balony is a strong word and I use it sparingly -- particularly, with peaceful co-existence in mind :-) IMHO, While compression ratio is not a minor factor, its importance should be gauged from the values of these ratios and other factors of usefulness considered.

– nik – 2009-11-06T04:04:40.597

we can argue here all day long, one fact remains: "Stop using these Winrar tools' is poor style. by the way, when it comes to compression ratio, there's another free, cross-platform, open source archiver (KGB) that beats both 7-zip and RAR by a country mile (and any other packer under the sun for that matter), but i don't tell folks to "Stop using these 7-zip tools". :) – None – 2009-11-06T18:14:32.097

You did not mention 7zips capability to unzip nsis installers - thats a criminal offense! – nawfal – 2013-08-14T11:21:00.253

Also 7zip doesnt clutter your shell context menu with options unlike winrar. It just groups nicely into one category. Can I add these to your answer? – nawfal – 2013-08-14T11:26:08.510

Yay! Only 100 rep needed to edit CW posts here! – mmyers – 2009-07-21T22:23:16.860

31

It's HARDCORE!

Really.
That's most RAR users' reason for preferring RAR: Part of the scene. A standard. A sign of doing things like the black-arts-pros do it.

None of these are valid reasons. There was an argument that RAR was faster or that RAR achieved smaller sizes, and this holds true versus ZIP files. But the same people will insist on splitting RAR archives, and creating non-MD5 sums and generating an extra PAR parity file when in the end, they're going to use a Torrent and not Usenet to move the files. In torrents there's no reason for any of that. In fact there's a strong reason not to compress, so the file can be used while being seeded.

But as you can see from here already, the value of having a good version or implementation of the compressor and decompressor can not be understated, and WinRAR just fails that test.

7-Zip takes that cake, and generally does better for size and speed. BZip2 really should be in the running, but lots of people don't have a good GUI implementation. The command-line is great of course, but right clicking like 7-Zip, or drag-and-drop like StuffIt is just so much easier.

Here's someone's 2002 measurements that seem to put RAR ahead. But multi-threading and memory use are allowing for changes in this area that seem to leave RAR behind.

P.S. The worst example of compression used badly is when I see image, video and audio files that are already compressed with a lossy compression like JPEG, DivX, or MP3 further "compressed" with any lossless format. I'm sorry but it should be obvious that in most cases you're not reducing the file to less than 95% of the original size, and in that case you're just wasting everyone's time and efforts.

dlamblin

Posted 2009-07-16T17:25:55.033

Reputation: 9 293

Hmm, RAR is still being actively developed isn't it? So what has multi-threading and memory got to do with leaving RAR behind? – Pacerier – 2015-05-20T08:40:47.257

it's the solid archive capability that makes rar superior to zip – andrej – 2017-02-09T15:00:35.253

This Question is "protected by nhinkle♦ Jan 2 '12 at 23:26" because it is such a bad, subjective question it got deleted. But it drives search results to the site and continues to get a comment or two in drive by. I think rar and zip have problems around being proprietary; meaning if in 20 years you need to unrar or unzip what will you do if there was something done making the tools harder to get. Other than that I've only seen it used in a pirated software or media context. So that's why I wrote this answer 7 years ago. I wish it were closed to comments and protected too. – dlamblin – 2017-03-16T01:55:00.313

15

One feature about WinRAR is it preserves the original creation dates of folders on extraction.

Both rar and .zip preserve folder creation date/time but it seems only winrar preserves that info on extraction

bobobobo

Posted 2009-07-16T17:25:55.033

Reputation: 4 632

solid archive si another cool feature – andrej – 2017-02-09T15:02:37.727

14

A point against RAR is that there is (as far as I know) no free software that can compress it. As current versions of WinRAR can decompress 7z (and 7z can decompress rar), and 7z usually compresses better than zip (and often better than rar), I tend to send those who send me RAR files 7Z files back :)

All the others get plain old .zip files of course. Maybe they learn from it ;)

mihi

Posted 2009-07-16T17:25:55.033

Reputation: 3 217

I always send back 7z regardless of the original format. The default context menu for 7z in my company disables "compress to 7z" item and almost no one knows how to or bother to enable it back – phuclv – 2017-10-09T13:46:17.383

4This is a good reason to not use RAR at all. And, use 7-zip to open RAR when you have no other alternative archive available. – nik – 2009-07-16T17:43:44.787

11

RAR files don't have the limits that ZIP files do. I think ZIP files are limited to containing 65536 files and each file and the total size of the archive is limited to approximately 4GB. There is ZIP64, but it is not an open file format.

From Wikipedia's entry on the Zip file format:

The maximum size for both the archive file and the individual files inside it is 4,294,967,295 bytes (232−1 bytes, or 4 GiB minus 1 byte) for standard .ZIP, and 18,446,744,073,709,551,615 bytes (264−1 bytes, or 16 EiB minus 1 byte) for ZIP64.

Wikipedia also states that RAR was first released in 1993, whereas ZIP64 may not have been released until 2001(?). Also support for ZIP64 was not built in to Windows XP.

See also:

FigBug

Posted 2009-07-16T17:25:55.033

Reputation: 455

Also, some implementations of Zip might not support extracting archives that were encrypted with a password. This might lead (or have led in the past) to interoperability problems between different Zip implementations, whereas with RAR there is (and only ever was) only one dominant implementation. – mpb – 2017-05-30T00:09:02.373

27-zip (not to be confused with ZIP) supports up to 16000000000 GB files and I do not know of any file count limits -- would be happy to learn that. – nik – 2009-07-16T17:46:42.830

10

Another thing that RAR has over Zip: Authenticity information. I can "sign" my RAR Archive and then the receiver can see a) who created it, b) what the original filename was, c) when it was created. Additionally, Archive Locking means that the archive cannot be modified - I do not know if Zip can do that, haven't checked. Same goes for recovery records, not sure if Zip/7-Zip support them.

Rar Auth Example

Also, what I like about Rar vs. 7-Zip is the Command Line support. Last time I checked 7-zip, the command line was lacking. I think it was about appending the current date to the filename.

Michael Stum

Posted 2009-07-16T17:25:55.033

Reputation: 3 061

1I think recovery records are the big thing that RAR has that ZIP doesn't, at least as far as file sharing goes. As the file passes through 100 hands, if it becomes corrupted at some point you can still repair it. – endolith – 2010-02-01T16:07:53.150

7z command line has a lot of great features, for example you can create reverse delta archives (i. e. delete all files from archive YESTERDAY that are the same in archive TODAY), or give different kinfs of masks. You cannot append the current date to the filename, but since the filename is from your .cmd file anyway, you can append it using cmd's date variable. – mihi – 2009-09-03T17:01:47.587

2In fact, the only reason i use 7-zip is because Rar doesnt have the command line support i need. – RCIX – 2009-09-09T04:06:49.353

What does this "Authenticity verification" actually check or prove? – Samuel Edwin Ward – 2012-08-21T18:50:38.560

@Samuel The Name, Author and Date of when the archive was created, and that no one has tampered with it. No idea if it has been cracked, although a cracked WinRAR license can be used to spoof the author. So it's a nice touch, but it's not a SHA-256 hash. – Michael Stum – 2012-08-21T21:10:02.653

1PGP if you want to sign something. There's really no value in a signature without a trusted key to verify it. I would most certainly not trust proprietary software for this... – bambams – 2013-12-09T17:14:25.423

9

A point against RAR is that there is (as far as I know) no free software that can compress it.

Just to make a comment on this point, the fully-functional command line implementation of RAR is free. (it compresses, it decompresses, it makes summer dresses.. okay not that last one, but it's just as, if not more, powerful than the GUI non-free version).

user26897

Posted 2009-07-16T17:25:55.033

Reputation:

9

I use Zip because it's available and supported on the machines we have at work, and everyone can work with Zip files.

Lance Roberts

Posted 2009-07-16T17:25:55.033

Reputation: 7 895

9

Advantage of RAR over ZIP: GMail doesn't complain when you send executable files (or any other kind of files) in RAR files, but does when you do it in ZIPped files.

Rook

Posted 2009-07-16T17:25:55.033

Reputation: 21 622

Just remove the '.exe' extension, archive it and send it. – Eddie B – 2014-12-15T19:53:56.167

I really can't see why this is downvoted - I find it a very good reason for using rar over zip. – Rook – 2009-11-04T22:05:52.273

4I rarely send any compressed files through email, but when I do, all you need to do to send zip files is tack on a fake .txt extension (so the filename ends up being something like compressedstuff.zip.txt) and tell the person I am sending it to to make sure to remove that. – Jason Bunting – 2009-12-04T06:50:39.860

A more simple solution is to use something like Dropbox where you don't have a size limit or executable attachment problem. – Cole Johnson – 2014-05-07T01:24:16.990

9

If you work in a Windows environment, then Zip is the best thing to use for compatibility reasons. It may not compress as well as the others, but since support is baked in to XP/Vista/etc, you can be sure that the receiver of a zip file will be able to open it. Especially in a corporate environment, this leads to far fewer instances of 'what do I do with this?'.

If the compression ratio REALLY matters, and you can get the receiver to install something else, then both WinRAR and 7-Zip appear to be able to beat zip in many cases.

But seriously - when does the few percent extra compression they give you matter anymore? Images, sound and video are already compressed for most people (have you EVER worked with raw video at all?), so you aren't going to compress them. And everything else is pretty small by comparison.

With bandwidth being what it is these days, the relatively small amount of extra compression that a non-zip compressor gives you seldom makes up for the compatibility issues.

Michael Kohne

Posted 2009-07-16T17:25:55.033

Reputation: 3 808

9

RAR has the Solid Archive option which concatenate files together before compression. This allows to compress patterns that appear only once per file but are repeated among many files. Very likely with XML files for example.

ZIP does not have such an option.

On Unix platform though, you can TAR your files first before compressing the TAR which will give you roughly the same behavior than RAR with Solid Archive.

7-Zip does support a similar option when using the 7Z compression.

I agree though that ZIP is so standard that it should always be your first option for communication with the outside world. If you can agree with you peers on a better format like RAR or 7ZIP, then do it.

Vincent Robert

Posted 2009-07-16T17:25:55.033

Reputation: 332

4

You can break up a RAR archive into multiple small parts and send each part separately, for example. the archive cannot be fully restored without all parts, so it is handy.

Aside from this, I don't know of any real advantages of RAR of Zip.

Yuval

Posted 2009-07-16T17:25:55.033

Reputation: 2 022

I'll choose to create multiple smaller archives (that are not RAR). – nik – 2009-07-16T17:44:21.307

But say you have a 50 MB per file limit and you're uploading large archives. What are you going to do if those archives contain large files even when compressed? – RCIX – 2009-07-17T08:05:55.773

3@RCIX That's the beauty of it... you can RAR a 50 MB file into an archive, then break up the archive into 50x1MB files named file.r00 to file.r48 (+file.rar) and the parts can be assembled together to make up the original archive =8-) – Yuval – 2009-07-17T09:42:46.243

5Ahhh, this is a non-argument since you can do this with zip files too... I know that 7zip & winzip both support splitting zip files into whatever size chunks you want. – Alconja – 2009-07-21T22:52:19.067

@Alconja Is that a fact? wow, had no idea it was possible for Zip. – Yuval – 2009-07-22T09:06:32.100

3

RAR usually compresses much better than ZIP. Of course it depends heavily on the data, but most of the time fast RAR is similar to ZIP normal, and RAR best is much better.

Extracting RARs is already well supported on platforms other than Windows: check out 7-zip.

R. Martinho Fernandes

Posted 2009-07-16T17:25:55.033

Reputation: 654

Really? I've found that RAR and 7Z are generally SLOWER than ZIP. Of course they usually have better compression ratios, but at the expense of speed. – davr – 2010-05-10T18:07:17.463

2@davr: I meant the fast RAR compression setting yields sizes similar to normal ZIP compression. If you sacrifice speed for size, yes, it sure gets slower. – R. Martinho Fernandes – 2010-05-15T16:31:16.010

2

The tests I did sometime ago showed me that RAR compress better (some kilobytes, no more)

I think you tried to compress already compressed files like images, video, etc.
Here is my result when I compressed a folder containing mainly source file (Java, jar, txt, images, etc):

13.754 Files
2.234 Folders

I used the best compression option in WinRar for zip and for rar archives.

Before compression

494 MB (518.688.768 bytes)

After compression with ZIP

115 MB (121.024.512 bytes)

After compression with RAR

71,6 MB (75.177.984 bytes)

It's a 43,4 MB difference in my case. So as you can see it depends a lot on what type of data you're compressing.

vovahost

Posted 2009-07-16T17:25:55.033

Reputation: 313

2

7zip (generally) has the highest compression ratio but consequently, the slowest. i have ever extracted 4GB wiki data exploded to about 120GB. zip is omnipresent, one of the oldest; anybody, anything, anywhere can handle it, despite in UNIX world, tar + gzip (or bzip) combination is much more preferred. rar has got fair compromises between speed, features/handling and compression ratio, why is it popular among (win) hackers, nobody know though, its a kind of attitude.

aa-

Posted 2009-07-16T17:25:55.033

Reputation: 1

2

I believe bzip2 has the best compression of the lot, but it is very slow. 7-zip is my choice on Windows but its icon is horrible; it looks like it's from Windows 95!

I love the standard Linux (Ubuntu, at least) file archiver. When you extract a file, if there's one file or folder in it, it is extracted to the current directory, otherwise a sub folder. Saves all those folder-in-folder situations, where on Windows I constantly check the contents of the zip before extracting.

DisgruntledGoat

Posted 2009-07-16T17:25:55.033

Reputation: 4 068

I believe bzip2 has the best compression of the lot have you ever heard of KGB archiver? Its compression ratio is far more than any other commonly used softwares. Best is a strong word and no software can claim it's the best. The output size all depends on the type of input – phuclv – 2017-10-09T13:58:41.377

1Don't ever use the 7z GUI. Right click on the .zip file (or the selection of files you want to compress). Why waste time? – MGOwen – 2009-09-03T03:09:46.400

I was talking about extracting files. Often archives contain only one folder, so using "extract to folder" is kinda silly. You have to open the GUI to check what the structure is. On Linux, you just do "Extract" and it works. – DisgruntledGoat – 2009-09-04T12:30:05.707

@DisgruntledGoat good point, why doesn't 7z behave like Ubuntu in this case? I can't think of a situation where redundant-folder-in-folder is desirable. – MGOwen – 2009-09-07T04:18:30.407

You'd have to ask the developers of 7-zip ;) I guess they haven't seen this behaviour. – DisgruntledGoat – 2009-09-07T11:37:44.387

In recent versions, if you right-click, there is an option that says "Extract here", which provides the behavior you're looking for. – sep332 – 2011-12-14T20:33:37.080

@sep332: that option has been there for years before I wrote my answer and it does not do the same as Linux. If your zip file had multiple files/folders at the "root" level then they all get extracted to the current folder which is a mess if you have many files there already. On Linux it will automatically put them in a subfolder. – DisgruntledGoat – 2011-12-15T10:04:18.133

Oh, I thought you had meant the "Extract to foo" option which also exists? It seems one or the other should have the behavior you want? – sep332 – 2011-12-15T15:14:28.583

The 7-Zip GUI is pretty poor as well, but it's open source so I can at least theoretically do something about it. – therefromhere – 2009-07-19T09:15:22.570

1

Rar has mostly better compression, and is supposed to be better with compressing errors.

Fernando Briano

Posted 2009-07-16T17:25:55.033

Reputation: 448

0

Q: Why do some people use RAR rather than ZIP for compressing?

A: Because those people also care about sometime decompressing the compressed file. If I have some time and energy I'll try pit latest 7zip and WinRAR against each other with normal & best settings taking time of compression and decompression of the resulting files. The resulting sizes are generally in similar ballpark so that metric doesn't matter as much (especially when you have decent speed internet available). Atleast couple years ago RAR decompressed twice as fast . v4.0 promises 30% improvement to decompression speed.

I'll update this answer when I have some numbers on hand.

edit: Buried in the comments above was this important thing: "Last I checked 7z was, like tar.gz/tar.bz2, extremely slow when it comes to extracting a single file out of an archive as everything before that file had to be processes for the file to be extractable. rar/zip don't have that problem"

I recall noticing this problem also but I will have to verify on latest 7zip to be sure it's not a problem related to 7z extraction in winrar.

Anonymous Coward

Posted 2009-07-16T17:25:55.033

Reputation: 51

0

I do use 7-zip

It compresses ZIP on par with RAR e.g following will even compress mp4 video or jpeg image a little bit (probably metadata):

7z a -tzip -mfb=258 -mpass=15 -mfb=258 file.zip @list_of_files_no_dir5

It also has a better compression method called 7z which is significantly better (and slower) than RAR.

PS it also extracts RAR, so no big loss going with open source in place of expensive...

ZaB

Posted 2009-07-16T17:25:55.033

Reputation: 2 365

0

WinRar is such a great tool, so I use RAR when I can. But, if I'm seeking interoperability with other people who might not know about RAR, I use ZIP of course. Fortunately, WinRar can do ZIP as well. :)

JP Alioto

Posted 2009-07-16T17:25:55.033

Reputation: 6 278

are there any people who actually purchase winzip? – phuclv – 2017-10-09T13:54:25.387

27-zip can open RAR and work with ZIP across multiple platforms using command-line or GUI. Have you tried it? – nik – 2009-07-16T17:52:46.933

No, but I will check it out! – JP Alioto – 2009-07-16T18:00:38.507

-1

I use RAR, because the people I work with use RAR, and RAR works just fine for me and my needs.

Sampson

Posted 2009-07-16T17:25:55.033

Reputation: 7 244