A compressed file is a folder or document that has been squeezed down to take up less space on your hard drive or to move faster over the internet
When you compress a file, your computer removes empty space and uses a mathematical pattern to rewrite the data in a smaller form. The file itself does not change — the content stays exactly the same — but the container holding it becomes much smaller. A photo that is 5 megabytes might compress down to 2 megabytes. A folder with 100 documents might shrink to half its original size.
You cannot open or use a compressed file the way you would a normal document or photo. If you double-click a compressed file, your computer will not show you the picture or let you read the text inside. Instead, you have to extract (or unzip) the file first, which reverses the compression and returns everything to its original form. After extraction, the files work normally again.
Compressed files are useful for two main reasons: they take up less storage space on your device, and they move faster when you email them or download them from the internet. If you are trying to send five large photos to a friend, compressing them first means the email arrives quicker and takes up less of their inbox space.
Key Takeaways
- A compressed file is a smaller version of a folder or document created by removing empty space and rewriting the data in a more compact form.
- You cannot use the contents of a compressed file until you extract or unzip it, which returns the files to their original state.
- Compressed files are smaller and move faster over the internet, which is why they are commonly used for email attachments and downloads.
- Windows, Mac, and most phones have built-in tools to compress and extract files without needing to install anything extra.
- The most common compressed file format is ZIP, which works on every major operating system.
How compression actually works
Compression works by finding patterns in your data and replacing them with shorter codes. Imagine a document that uses the word "the" 500 times. Instead of storing "the" each time, the compression tool might replace every instance with a single symbol, then store a note saying "this symbol means the." The file becomes much smaller because one symbol takes up far less space than the letters t-h-e repeated 500 times.
Different types of files compress differently. Text documents and spreadsheets often shrink by 50 to 80 percent because they contain a lot of repetition. Photos and videos compress less — sometimes only 10 to 20 percent — because the data inside them is already tightly packed and does not have as many patterns to find. Some file types, like JPEG photos, are already compressed when you save them, so compressing them again does not make them much smaller.
The compression process does not lose any information. When you extract the file, you get back exactly what you started with, down to the last character or pixel. This is called lossless compression, and it is different from the compression that happens when you save a photo in JPEG format, which does throw away some detail to make the file smaller.
Common file formats you will see
ZIP is by far the most common compressed file format. It works on Windows, Mac, and Linux, and most phones can open ZIP files without installing anything. When you see a file ending in .zip, that is a compressed archive. On a Mac, you might also see .tar or .tar.gz files, which work the same way but use different compression methods. On Windows, .rar files are less common but still appear sometimes, usually for large downloads.
Each format uses slightly different compression methods, but the end result is the same: a smaller file that contains the original content. ZIP is the standard because it has been around for decades and works everywhere. If you are compressing something to send to someone else and you are not sure what device they use, ZIP is always the safe choice.
How to compress a file on Windows
Right-click the file or folder you want to compress. A menu will appear. Look for an option that says "Send to" or "Compress" — the exact wording depends on your Windows version. Click it, then select "Compressed (zipped) folder." Windows will create a new ZIP file in the same location with the same name plus .zip at the end.
If you do not see a compress option, you can use the built-in File Explorer. Select the file or folder, then go to the "Share" tab at the top and look for a "Zip" button. If that does not work either, Windows 10 and 11 have compression built into the right-click menu by default, so try right-clicking again and looking more carefully.
The original file stays where it is. The compressed version is a new file sitting next to it. You can delete the original if you want to save space, but keep the compressed version if you need it.
How to compress a file on Mac
Right-click the file or folder and select "Compress" from the menu. Mac will create a .zip file with the same name. That is it — Mac makes compression simpler than Windows because the option is always in the same place.
If you are compressing multiple files at once, select them all first (hold Command and click each one), then right-click and choose Compress. Mac will bundle them into a single ZIP file.
How to extract a compressed file
On Windows, right-click the ZIP file and select "Extract All." A window will open asking where you want to put the extracted files. Choose a location and click Extract. Windows will unzip everything and put the original files in that folder.
On Mac, just double-click the ZIP file. It will extract automatically and put the contents in the same folder. You do not have to do anything else.
On a phone, the process depends on what device you have. iPhones can extract ZIP files using the Files app — just tap and hold the ZIP file and select "Uncompress." Android phones vary, but most can extract files using a file manager app or a dedicated archive app from the Google Play Store.
When you should and should not compress
Compress files when you are sending them by email, uploading them to a cloud service, or sharing them over the internet. Compression makes the transfer faster and uses less bandwidth. Compress large folders when you want to back them up or store them long-term to save space on your hard drive.
Do not compress files that are already compressed, like MP3 music files, JPEG photos, or MP4 videos. Compressing them again will not make them smaller and will just waste time. Do not compress files you use every day — extract them first so you can work with them normally. Leaving files compressed and trying to open them directly from the ZIP folder can cause problems and slow things down.
If you are storing files for years and want to make sure you can still open them later, ZIP is the safest format because it has been standard for so long. Newer or less common compression formats might not be readable on future devices or operating systems.
Frequently Asked Questions
Does compressing a file damage it or change the content?
No. Compression uses lossless methods that preserve every bit of data. When you extract the file, it is identical to the original. The only thing that changes is the file size and how long it takes to move the file around.
Can I edit a file while it is still compressed?
Not directly. You have to extract it first. If you try to open a file from inside a ZIP folder, your computer will extract it to a temporary location, let you edit it, and then re-compress it when you save — but this can cause confusion and lost changes. Always extract first, then work with the files normally.
What if I cannot open a compressed file?
Make sure you have extracted it, not just clicked on it. If extraction fails, the file might be corrupted or incomplete. Try downloading it again. If you received a .rar or .tar file and your computer does not recognize it, you may need to install a third-party app like 7-Zip or WinRAR to open it.
Does compressing a file make it take up less space permanently?
Only while it stays compressed. Once you extract it, the files return to their original size. If you want to save space long-term, keep the files in their compressed form and extract them only when you need to use them.
Can I password-protect a compressed file?
Yes. Most compression tools, including Windows and Mac, let you add a password when you create a ZIP file. When someone tries to extract it, they will have to enter the password. This is useful for sending sensitive documents over email, though it is not as secure as full encryption.