File compression shrinks files by removing redundant data, making them faster to send and easier to store
When you compress a file, software scans it for patterns and repetition, then replaces those patterns with shorter codes. A file that repeats the same phrase 500 times doesn't need to store that phrase 500 times — it can store it once and say "use this phrase here, here, and here." The compressed file is smaller, but contains the same information. When you decompress it, the software reverses the process and rebuilds the original.
The amount of shrinkage depends on what's inside. A text document with lots of repeated words might compress to half its original size. A photo or video that's already been compressed by the camera compresses very little, because there's less redundancy left to remove. Some files barely shrink at all.
Compression matters because smaller files move faster over the internet, take up less space on your hard drive, and are easier to back up or share. If you're sending a folder of documents to someone, compressing it first means they download one file instead of ten, and it arrives in less time.
Key Takeaways
- Compression works by finding patterns in a file and replacing them with shorter codes, making the file smaller without losing information.
- Text files and documents compress well because they contain repetition; photos and videos compress poorly because cameras already compress them.
- Smaller files download faster, use less storage space, and are simpler to email or back up to another device.
- You decompress a file by opening it with the same software that compressed it, or by using your operating system's built-in tools.
- Compressed files are not encrypted or hidden — compression is about size, not security.
Two types of compression: lossless and lossy
Lossless compression removes redundancy but keeps every bit of the original data. When you decompress it, you get back exactly what you started with. ZIP files, RAR files, and 7Z files all use lossless compression. This is what you use for documents, spreadsheets, and any file where losing even a tiny piece of information would matter.
Lossy compression throws away data that the human eye or ear probably won't notice. JPEG photos, MP3 music, and MP4 video all use lossy compression. A JPEG file is much smaller than the original photo because it discards color information in areas where your eye won't see the difference. Once you save a photo as JPEG, you can't get back the discarded data — decompressing it won't restore what was thrown away.
For everyday use, you'll mostly encounter lossless compression when you're bundling files to send or store. Lossy compression is already built into the photos and videos on your phone — you don't usually compress them further yourself.
How to compress files on Windows and Mac
Both Windows and Mac include built-in compression tools, so you don't need to install anything. On Windows, right-click the file or folder, select "Send to," then choose "Compressed (zipped) folder." Windows creates a ZIP file in the same location. On Mac, right-click the file or folder and select "Compress." Mac creates a ZIP file the same way.
If you're compressing a single large file, the process takes a few seconds to a few minutes depending on size. If you're compressing a folder with hundreds of files, it may take longer. The original files stay where they are — compression creates a new compressed copy.
To decompress on Windows, double-click the ZIP file and Windows opens it like a folder. You can then copy the files out, or right-click and select "Extract All" to unzip everything at once. On Mac, double-click the ZIP file and it automatically decompresses. Both systems handle ZIP files without any extra software.
When compression actually saves you space
Compression is most useful for files you're about to send or store somewhere else — email, cloud backup, external hard drive, or a file-sharing service. If a file lives on your computer and you're not moving it anywhere, compression saves disk space, but the savings are usually small enough that it doesn't matter unless you're running out of room.
Compression shines when you're working with email attachments. Many email services limit attachment size to 25 MB or so. If you have a folder of documents totaling 40 MB, compressing it to 15 MB lets you send it as one file instead of splitting it across multiple emails or using a file-sharing link.
For cloud storage like Google Drive or OneDrive, compression can help if you're near your storage limit and need to back up files before upgrading. It's also useful if you're uploading to a service with a file-size cap, or if your internet connection is slow and you want uploads to finish faster.
Why compressed files sometimes don't shrink much
Photos, videos, and audio files are already compressed by the device that created them. Your phone's camera compresses photos as JPEG before saving them. Streaming services send you video that's already compressed. If you compress these files again with ZIP, you might see only 5 to 10 percent shrinkage, or sometimes none at all.
This happens because the original compression already removed the easy redundancy. There's not much left for a second round of compression to find. It's like trying to squeeze water out of a sponge that's already been wrung dry.
Text files, spreadsheets, and documents compress much better — often to 30 to 50 percent of their original size — because they contain a lot of repeated words and formatting that compression can exploit. A Word document with the same header on every page is full of repetition that compression loves.
Compressed files and security
Compression is not encryption. A ZIP file is smaller than the original, but anyone who opens it can read the contents. If you need to send sensitive information, compress it first if you want, but then encrypt it separately using a tool like BitLocker on Windows or FileVault on Mac, or send it through a service that handles encryption for you.
Some compression tools like 7Z and WinRAR let you add a password when you compress, which adds basic encryption. This is convenient for sharing a password-protected file with someone, but it's not as strong as full-disk encryption. Use password-protected compression for casual privacy — like keeping a folder of personal documents away from other users on a shared computer — but not for truly sensitive data like financial records or medical information.
Compressed files won't open? Troubleshooting the basics
If you download a ZIP file and it won't open, the most common cause is that the download was interrupted and the file is corrupted. Try downloading it again. If it's a file someone sent you, ask them to resend it.
If you're trying to open a RAR or 7Z file and your computer doesn't recognize it, you need software that handles that format. Windows and Mac natively handle ZIP, but not RAR or 7Z. Download WinRAR, 7-Zip, or another tool that supports the format you need. Most of these are free.
If a compressed file is very large and your computer runs out of memory while decompressing, try decompressing it to an external hard drive with more free space, or break the task into smaller pieces. Some compression tools let you extract individual files from an archive without extracting everything at once.
Frequently Asked Questions
Does compressing a file make it take longer to open?
No. Once you decompress a file, it opens at normal speed. While it's still compressed, you can't open it directly — you have to decompress first. But decompression is fast, usually taking just a few seconds.
Can I compress files that are already in the cloud?
You can download them, compress them locally on your computer, then upload the compressed version. But if you're just trying to save cloud storage space, it's usually easier to delete files you don't need or upgrade your storage plan than to compress and re-upload everything.
What's the difference between ZIP, RAR, and 7Z?
They're all lossless compression formats. ZIP is the most common and works on every computer without extra software. RAR and 7Z compress slightly better but require additional software to open. For everyday use, ZIP is the standard choice.
If I compress a file and then compress it again, will it get smaller?
Usually not. The first compression already removed the redundancy. Compressing again typically makes it slightly larger because you're adding a second layer of file structure. Compress once and stop.
Is it safe to delete the original file after compressing it?
Yes, once you've confirmed the compressed file opens and contains what you expect. But keep the original until you've verified the backup works — don't delete it immediately after compressing.