What is compression, and how does it make files smaller?
General knowledgeAsked by Anonymous22 Oct 2026, 11:08 PM ISTUpdated
In one line
Making files smaller by removing unnecessary or repeated information is called compression.
The rule
Compression is the process of reducing the size of a file by encoding its data more efficiently, so it takes up less storage space.
There is no single formula, but the idea is: Compressed size < Original size
Let's understand it simply
Imagine you are packing clothes for a trip. If you just throw them in, the bag fills up fast. But if you fold them tightly, you can fit more in the same bag. Compression does something similar for files. It finds smart ways to store the same information using fewer bits (the smallest pieces of data in a computer).
Another way: Think of a cricket scorecard. Instead of writing “Sachin scored 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,” you can write “Sachin scored 1 run 10 times.” Both mean the same, but the second is much shorter. This is what compression does with files.
Lossless vs Lossy Compression
Lossless
Lossy
Data lost?
No
Yes
Examples
ZIP, PNG
MP3, JPEG
Can get original back?
Yes
No
How it works
The computer looks for repeated patterns or unnecessary data in the file.
It replaces these patterns with shorter codes or removes extra parts.
The new, smaller file is saved.
When you want to use the file, the computer can reverse the process to get back the original data (if it's lossless compression).
Sometimes, some data is thrown away to save even more space (this is lossy compression), like in MP3 songs or JPEG photos.
How file compression works
Find repeated patterns in the file
Replace patterns with shorter codes
Save the new, smaller file
Reverse the process to get the original file back (if lossless)
The story behind it
Compression became important as computers and the internet grew. Early computers had very little storage. In the 1970s and 1980s, scientists like Abraham Lempel and Jacob Ziv created famous compression methods (like ZIP files). Their work helps us share photos, videos, and songs quickly, even on slow internet.
Where you see it in real life
WhatsApp images: When you send a photo, it gets compressed so it uploads faster and uses less data.
ZIP files: When you download a big folder from the internet, it is often in a .zip file. This is a compressed version.
MP3 songs: The music files are compressed so you can store hundreds of songs on your phone.
YouTube videos: Videos are compressed so they play smoothly, even if your internet is slow.
PDF documents: Scanned pages are compressed to make the file easy to email.
Why it matters
Saves storage space on your phone, computer, or pen drive.
Makes it faster to send files over the internet, especially with slow connections.
Reduces costs for companies storing lots of data (like Google or YouTube).
Essential for streaming music, videos, and even making apps smaller to download.
Common mistakes
Thinking compression always loses data: Some types (like ZIP) keep everything; others (like MP3) remove some details.
Believing all files can be compressed a lot: Some files (like already compressed videos) can't be made much smaller.
Forgetting you need the right software to open compressed files (like WinZip for ZIP files).
Remember it
Compression is like folding clothes to fit more in your bag — it saves space by packing data smarter.
Check yourself
What is the main goal of file compression?
To reduce the file size by storing data more efficiently.
Why can some files not be compressed much further?
Because they are already compressed or have little repeated data.
Give one example of lossless and one of lossy compression.
Lossless: ZIP file; Lossy: MP3 song.
Why does WhatsApp compress images before sending?
To make the file smaller so it sends faster and uses less data.
Quick recap
Compression makes files smaller by removing repeated or extra data.
It helps save storage and makes sharing files faster.
There are two types: lossless (no data lost) and lossy (some data lost).
You see compression in ZIP files, MP3 songs, and WhatsApp images.