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.

Possible Duplicate:
How can I evaluate the best choice of archive format for compressing files?

I've just downloaded phpBB3 and saw they offer a bz2 (1.51 MB) and a zip (2.35 MB) download. This is the reason why I want to know if the ZIP file format has any advantages over bzip2.

According to the Wikipedia article, the zip-files can be compressed using the bzip2-compression algorithm. Why is the zip-file then that much bigger?

share|improve this question

migrated from stackoverflow.com Aug 31 '11 at 9:59

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Nifle, DMA57361 Aug 31 '11 at 10:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers 4

up vote 2 down vote accepted

.zip files can contain more than one file.

.bz2 can just contain one file. The .bz2 header is more compact and it does solid compression by design.

tar is usually used to put more than one file into a .bz2 archive. This is why you often see .tar.bz2 files.

share|improve this answer

Not relevant to the merits of one algorithm over the other, but a practical point for ZIP is support on Windows: since XP, there is ZIP support out-of-the-box, but you need external tools (e.g. 7-zip) to work with bzip2.

share|improve this answer

I want to know if the ZIP file format has any advantages over bzip2.

More people have software that can handle the zip format then a tar.bz2 file.

Zip-files can be compressed using the bzip2-compression algorithm. Why is the zip-file then that much bigger?

"Can" doesn't mean "always will be".

share|improve this answer
    
+1 "Can" doesn't mean "always will be": And in this case, that would be counter-productive, since the zip file only exists for the benefit of people without bzip decompression software. –  Thilo Aug 31 '11 at 10:12
1  
More to the point: .zip files with compression other than DEFLATE are not universial. –  Jens Mühlenhoff Aug 31 '11 at 10:20

In general, they support tar.gz (or bz) for linux users, and zip for windows users - most linux systems have support for the former by default, and every modern version of windows has zip.

Most zip files use deflate rather than bzip for compatability reasons, and as such the files are a little larger. In practical use though, the difference isn't really that significant.

share|improve this answer

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