Why does .ZIP files become smaller than the original file?

Hello everyone,

today I converted a folder to a .ZIP file.

The folder was 15 GB and contained a lot of pictures and movies, but when the conversion was completed the .ZIP file size was only 13 GB.

How is this possible?

I know you "compress" it in order to become a .ZIP file, but doesn't this mean the pictures and movies loses quality?

Please let me know.

Mac mini, OS X El Capitan (10.11.6), Late 2012

Posted on Oct 31, 2016 6:46 AM

Reply
7 replies

Nov 1, 2016 8:36 AM in response to FilipAAOfficial

Yes ZIP files are intended to be compressed and therefore smaller than the original files. Yes this is a lossless process in that when you expand the ZIP file it restores copies of the original files which will be exactly the same quality/size as the original files.


There are lots of different compression algorithms, even ZIP can use multiple different ones. These will work in different ways and might be either able to compress certain types of files better than others, or be faster. Some other software will use other quite different algorithms e.g. JPEG photo image compression which is lossy.


As a very simplistic example of how lossless compression can work lets assume a hypothetical text file containing a line of text as follows.


AAAAAAAAAAAAAAAAAAA


This as normal uncompressed would take 20 bytes of space at least. However a very simple (and not real) method of compression might be to store this as


20xA


As you can see this is much shorter and would only take four bytes. It should be obvious how this would be 'decompressed' back to AAAAAAAAAAAAAAAAAAA


So there are lots of different techniques/algorithms which can be used to do lossless compression like this. As mentioned some methods are more suited to certain types of files.


It should be noted that these days many files types have their own built-in file compression schemes, e.g JPEG, PDF and even .docx so this can mean that these types of files might not compress by any noticeable amount when you try to compress them again with ZIP. (This is very common with PDF files.)

Nov 1, 2016 11:44 AM in response to FilipAAOfficial

You say the folder was mostly pictures and movies. Usually those are already in compressed format and won't compress any farther. In fact a zipped file of an already compressed file can end up being larger than the original because there is a certain amount of overhead in creating a zipped version. Normally the compression plus overhead results in a smaller file but if essentially no additional compression can be made the file will become larger with the overhead. Usually zipping works best with files such as text files or full quality media formats such as AIFF, WAV, TIFF, etc.


Zipping does not lose quality but the files will not be easily accessible if zipped. You will have to unzip them to work with them. I rarely zip files these days unless it is to package several small files into a single file for e-mailing.

Nov 1, 2016 9:15 AM in response to FilipAAOfficial

Hello FilipAAOfficial,

Just so you know, the standard movie and image file formats that you use already use lossy encryption methods. They have probably already lost quality. There are a few types of video and image formats that don't lose quality, but they are rarely used. It's not something you should be worried about, but you should know what is going on behind the scenes.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Why does .ZIP files become smaller than the original file?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.