Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I just downloaded MySQL for Windows 64bit which 211.9MB but when I extracted it it is now 1.05GB. How did they do it? They archive wasn't damaged at all nor corrupted.

Before (Compressed):

After: (Uncompressed):

I was just totally amazed, I thought this wasn't possible. Archive info from WinRar:

share|improve this question
If it was damaged or corrupt it wouldn't have extracted in the first place. – Alan B Feb 19 '13 at 13:55
You've never received an attachment that would uncompress to 128 TB binary zeroes followed by "You've been zipped"? – ott-- Feb 19 '13 at 14:19
noped, I have not. – Michelle Mar 9 '14 at 11:22
up vote 7 down vote accepted

The compression ratio used may depend on the files that are being compressed. A text file with one million "ABC" will probably have a very good compression ratio. Additionally, they have probably chosen a good compression algorithm and the highest possible settings.

share|improve this answer
Create a 1GB file with all bytes the same and it'll indeed compress fairly spectacularly! – Alan B Feb 19 '13 at 13:57
People used to create "archive bombs" like this. You'd email a tiny zip file to someone, their mail server's AV would extract it, find another archive, extract it, run out of memory, and crash. I've got a 6kb gzip file somewhere that, when fully extracted, is something like 40GB.. – rbsec Feb 19 '13 at 18:58

Deflate is one of the most used compression algorithms. It searches for patterns on the data and stores it on a dictionary. The more "repetitive" a file is, the more it can be compressed. A very good explanation of the algorithm can be found here.

share|improve this answer
Once I wrote a script to test 7zip power by compressing a 3gb txt full of 1's. The result was a file of ~60kb – kb_sou Feb 19 '13 at 14:04
That's not very good compression for such a file. Did you try to re-compress the compressed file? – Adrian Pronk Feb 20 '13 at 9:21
Actually I started sending the file to my friends as a prank – kb_sou Feb 20 '13 at 12:47

Different files can be compressed to different sizes.
For example, if you compress bitmap or text files, you'll get high results.
It also depends on compressor program and its method of compression (just use 7Zip instead of WinRAR and you'll see that it compresses much better).

Recently I've found KGB Archiver, which is probably the best high-compression tool for today.
I couldn't believe that file which size is ~1GB can be compressed to some MBs, but it could do it!!
So 19% compressed archive seems nothing compared to it ;)
It uses PAQ6 algorithm, thus it needs a lot of CPU and RAM to compress.
Now it's an open-source project and is located in SourceForge. You can download it here.

share|improve this answer
"KGB Archiver, which is probably the best high-compression tool today" - PAQ6 has many successors now which are much better. Of course, these aren't suitable for general use because the RAM/CPU/time requirements are just too high for both compression and decompression. – Karan Feb 19 '13 at 18:46
+1 Coool... I haven't seen it before – Searush Mar 24 '13 at 21:04
@Karan Can you tell us some of their names?? – Searush Mar 24 '13 at 21:05
@SEARAS: The Wikipedia article on PAQ is a good starting point. – Karan Mar 25 '13 at 4:37
Thanks, I'll look for it. – Searush Mar 27 '13 at 19:40

Your question inspired me to do some research and learn a little bit about compression works.

How did they do it? Basically, lots of epic math, but one basic method is Huffman Coding

The file is divided into chunks, those chunks are sorted into a tree, with the most common blocks being given the shortest location names in the tree. The zip is created from a description of the tree followed a list of addresses in the tree required to rebuild the file. Sometimes a pre-computed tree is used this eliminates the need to share the tree. The more repetitious the program, the smaller the tree and better the compression. There is so much more to it then this though, it's complicated.

share|improve this answer

You must log in to answer this question.

protected by Community Feb 9 '15 at 7:22

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .