I was just wondering, what's the difference between these file formats? Shouldn't there be just one or two that generally tend to perform superior to most others?

  • 1
    I vote to close. Question is too subjective.
    – Xavierjazz
    Sep 17, 2011 at 22:06
  • @Xavierjazz: You need 3000 points first, and I think there are factual answers for this.
    – paradroid
    Sep 17, 2011 at 22:09
  • You should change the title to better fit the question Sep 18, 2011 at 3:25
  • @KronoS: I don't think this question can be saved. "Most popular" and "superior to" aren't objectively defined here, he is left with "what is the difference between various compression formats" which I feel is kinda a question that one can easily find online. We can still wipe the answers if it turns out compression formats are hard to understand by a simple Google... Sep 18, 2011 at 23:12
  • @TomWijsman I gave him the chance... it's killed now. Sep 19, 2011 at 1:24

4 Answers 4


compress (the Unix command, ported to Linux and others) itself only has one file extension that is used for its output, and that is .z

There are other compression algorithms (and their associated programs) that compress files differently for different results.

Some popular programs include:

  • Gzip which has the extension .gz
  • Bzip which has the extension .bz2
  • Rar which has the extension .rar
  • Zip which has the extension .zip
  • 7-zip which has the extension .7z
  • and many more...

Generally newer archivers will use better compression algorithms, usually at the cost of taking longer (requiring more CPU time) to compress or requiring more memory or both.

As a general rule though, the newer the program, the newer it's algorithms and therefore the better its compression will be. compress is as old as the hills and its compression ratios tend to be a lot worse than more modern programs like 7-zip.

  • Also - better compression isn't always the end goal. Often there is a compromise between speed and compression factor (imagine how often you'd use winzip if it compressed 10x better but was 10000x slower). Different compression algorithms can also be tailored to different kinds data (e.g. text vs pictures vs audio)
    – nos
    Sep 17, 2011 at 22:03
  • As old as the hills = 1971. While the .z extension is 40 years old (because the concept of file extensions is 40 years old), its underlying format, Huffman coding, was in use since 1951.
    – William C
    Sep 18, 2011 at 0:52

If its linux based, .tar.gz or .tar.bz - otherwise known as your humble tarball. In windows, .zip - natively supported since windows XP. You also often encounter .rar (especially with files from slightly dubious sources) and .7z (windows/open source software most often).

If you want to be ABSOLUTELY sure your file will be opened by most modern OSes (and some not so modern ones), .zip is the safe choice.

Efficiency depends on the filetype in many cases - for example lrzip works best with VERY large files, text files always compress very well, but compressed audio dosen't, and compression ratio is often traded off for processor and ram usage- as such, there is no 'best' file format for compression


While .z is the oldest, as old as Unix, the most prevalent compression format is .zip because it is the only format supported natively by all versions and flavors of Windows since Windows 98.


I prefer compressing my data using *.rar with WinRAR as it is completely customizable. I use it because I can choose how much I want to compress it and I can set passwords to protect my archive. If I'm doing something involving disk images, I'll compress to *.iso or *.daa using PowerISO.

Whenever I'm not on one of my own computers, I compress it using Windows 7's built-in *.zip compressor. On Ubuntu, I will probably compress in *.tar.gz or *.zip.

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