Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I took 3 test files and ZIPped them. With the 3 test files again I RARred them. Each .RAR archive is smaller than the corresponding .ZIP archive.

Does the RAR compression algorithm give a better compression ratio than the ZIP compression algorithm?

share|improve this question
1  
Hard to say exactly since a Zip file may be using any one of several compression algorithms. The most commonly used algorithm is the Deflate algorithm, which is not a super-great and modern algorithm but has become the lowest common denominator since all zip-aware tools can use it. –  Andrew Lambert Jul 19 '11 at 22:59
    
@Amazed: such a wonderful answer, wasted as a comment :) –  akira Jul 20 '11 at 4:21
    
@akira Thanks. It just felt like a non-answer to say "well that all depends." –  Andrew Lambert Jul 20 '11 at 5:51
add comment

2 Answers 2

up vote 4 down vote accepted

Although it depends on what you're compressing, I've noticed that RAR often does get a slightly better compression ratio (although I usually don't find it to be too significant), but the data I need to compress is likely very different from the data you need to compress.

If you run any benchmarks of your own, be sure to include 7-Zip in the list of contenders as well since it's definitely a worthwhile cross-platform alternative that can also handle the .ZIP and .RAR formats seamlessly:

  7-Zip (free and open source)
  http://www.sevenzip.sourceforge.net/

Also, here's a document that examines compression ratios between various compression archiver tools, which I believe you'll find interesting:

  Archiver Comparison
  http://warp.povusers.org/ArchiverComparison/
  http://www.squeezechart.com/main.html
  http://compressionratings.com/rating_sum.html

share|improve this answer
1  
7-Zip is a great tool, and my experience has been that 7z is the great format most of the time. –  Zoredache Jul 20 '11 at 0:14
    
7zip only works for windows!? –  Pacerier Jul 20 '11 at 6:09
    
I use 7-Zip on NetBSD. I did mention that it's "a worthwhile cross-platform alternative" after all, and a list of download options for many platforms can be found here: sevenzip.sourceforge.net/download.html –  Randolf Richardson Jul 20 '11 at 6:14
add comment

The 7-Zip .7z format gives best results overall, and also has much stronger encryption than the .zip format.

Please recall that the .zip format is actually two DIFFERENT formats:

  • Old 16 bit style zip, with a 2gb file size limit
  • New zip format, which lifts this file size limit

Many tools, such as the zip support built into some versions of Windows, only support the older zip format.

Additionally, the zip format has really weak encryption that is easily cracked. The RAR and 7z formats are both dramatically better than the old style zip encryption (I am not versed in the quality of new zip compression, so cannot comment on it).

7z is a great choice. RAR is also a good choice.

HTH!

share|improve this answer
1  
what do you mean by cracked? i mean i can't understand what's there to crack a zip file –  Pacerier Jul 20 '11 at 6:07
    
@Pacerier: Some popular archival tools support some sort of password protection mechanism, and a few of these turned out to be very easy to "crack" (or even circumvent altogether). 7-Zip, on the other hand, supports 256-AES encryption (and can optionally encrypt the filenames too), which is better than simple password protection because decryption can be far more demanding of processing resources than attempting to crack a password. –  Randolf Richardson Jul 20 '11 at 6:27
    
@Sam Jones: "the zip format has really weak encryption that is easily cracked" .. not true: read superuser.com/questions/145167/is-zips-encryption-really-bad/… –  akira Jul 20 '11 at 8:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.