Sending a folder of documents by email, you zip it first and watch a hundred megabytes shrink to twenty, yet the same trick on a folder of holiday photos barely changes the size at all. Compression is doing real work in both cases, but what it can achieve depends entirely on what is inside the file. Once you grasp the simple principle underneath, removing repetition and predictability from data, the puzzling parts start to make sense. This primer explains how zipping and similar methods shrink files, why some collapse dramatically and others refuse, and when reaching for compression is worth the bother.
The core idea behind shrinking data
Compression works by finding patterns and describing them more briefly. If a file contains the word “and” ten thousand times, storing the word once and noting where it repeats is far shorter than writing it out in full each time. A long run of identical pixels, say a plain white background, can be recorded as a colour and a count rather than thousands of separate values. Anything predictable or repeated is redundancy, and redundancy is what compression squeezes out. A second technique assigns shorter codes to common values and longer codes to rare ones, so frequently used letters or bytes take up less room than unusual ones. Real tools combine both, spotting repeats and then coding whatever is left as compactly as they can.
Consider a plain text log where the same status line repeats over and over. A tool can store that line once and then record each repeat as a short reference back to it, so a thousand identical lines cost barely more than one. The more the data repeats, the more dramatic the outcome, which is why logs and simple databases can shrink to a small fraction of their original size.
This is why the makeup of a file matters so much. Text, spreadsheets, and program code are full of repetition and structure, so they shrink a great deal. Data that is already dense and varied offers little to remove. The file still has to be stored somewhere sensible afterwards, and how the operating system arranges it on disk, the subject our guide to the way drives organise files covers, is a separate layer from the compression itself.
Lossless and lossy compression
There are two broad families, and confusing them causes a lot of misunderstanding. Lossless compression shrinks data while keeping every original bit, so unzipping restores an exact copy. It suits anything where a single wrong character would matter, such as documents, spreadsheets, code, and archives. The trade-off is that it can only remove genuine redundancy, which limits how far it can go. Typical lossless savings on plain text land somewhere between a third and a half of the original, depending on how repetitive the content is.
Lossy compression goes further by throwing away information judged too subtle for people to notice. Photo and audio formats do this, discarding fine detail and frequencies the eye or ear tends to miss. The result is far smaller but no longer a perfect copy, and repeatedly re-saving degrades quality. The choice between the two is really a question of whether losing some detail is acceptable in exchange for a smaller size.
| Aspect | Lossless | Lossy |
|---|---|---|
| Original data | Restored exactly | Partly discarded |
| Typical use | Text, code, archives | Photos, audio, video |
| Size reduction | Modest to large | Very large |
| Re-saving | Safe to repeat | Quality drops |
Why photos and videos barely shrink in a zip
Zipping a folder of photos rarely saves much, and the reason follows straight from the core idea. Formats like JPEG and the codecs inside video files are already compressed, using lossy methods tuned for images and motion. The obvious redundancy has already been removed at the point the picture was saved. What remains looks, to a general-purpose zip tool, almost like random data, and random data has no patterns left to exploit.
A zip archive can still be handy for bundling many images into one file to share, but expect the size to stay close to the sum of the originals. To actually reduce a photo and video collection you have to work at the media level, choosing formats and resolutions deliberately, the approach the primer on handling a growing media library sets out. Zipping is the wrong tool for that particular job.
When compression helps and when it wastes effort
Compression pays off when data is redundant and you value the space or the tidiness of a single file. Archiving old projects, sending mixed documents, backing up text-heavy data, and packaging software all benefit clearly. It also helps when transferring many small files, since bundling them into one archive avoids the overhead of handling each separately.
It wastes effort when the data is already compressed, as with photos, music, and video, where you spend processor time for almost no saving. Compressing such files before storing them can even slow access for no benefit. If a drive is filling up with media, the answer is usually to manage or offload files rather than zip them, a situation the explainer on what occurs as a disk runs out of room examines in more detail.
What this means in practice
The single principle to carry away is that compression removes redundancy, so its success depends on how much redundancy a file holds. Text and similar structured data are full of it and shrink well without losing anything. Photos, audio, and video have already had theirs removed by lossy formats, so a second pass through a zip achieves little. Matching the method to the material saves both time and confusion.
For everyday use, lean on lossless zipping for documents and archives, accept lossy formats for media where a perfect copy is not needed, and do not expect a zip to rescue a full drive of photos. Planning capacity around the files you keep, rather than hoping compression will claw space back later, the habit our look at estimating the storage you require encourages, avoids most unpleasant surprises.
Answers to common questions
Why doesn’t zipping my photos make them smaller?
Because photo formats such as JPEG are already compressed. The repetition a zip tool looks for was removed when the image was first saved, using methods designed for pictures. What is left resembles random data with no patterns to exploit, so the archive ends up roughly the same size. Zipping still bundles the photos into one file, but it will not meaningfully shrink them.
What is the difference between lossless and lossy compression?
Lossless compression keeps every original bit, so the file unzips to an exact copy, which suits text, code, and archives. Lossy compression deletes detail judged too subtle to notice, reaching much smaller sizes but no longer restoring the original perfectly. Photos, audio, and video normally use lossy methods. The trade is simple: lossless preserves everything at modest savings, lossy sacrifices some detail for far greater reduction.
Does compressing files damage them?
Lossless compression does not. It rearranges data into a smaller form and restores it exactly when you extract it, so documents and archives are safe to zip and unzip repeatedly. Lossy compression does discard some detail permanently, and re-saving in a lossy format again lowers quality each time. The zip format itself is lossless, so zipping any file never harms the contents inside.
