By the end of this lesson you will be able to
- Explain what an archive is and what compression does.
- Create a ZIP file from several files and extract it on Ubuntu and Windows.
- Predict which kinds of file shrink well and which barely shrink.
- Apply safety rules before opening a ZIP file from someone else.
Imagine posting twenty photographs to a friend as twenty separate envelopes. They could get lost, arrive in the wrong order or cost a lot. A ZIP file is the computer's way of putting them in one parcel, and it can often make the parcel smaller too. You will meet ZIP files when you download documents, receive photos and send work by email, so it is worth knowing how to make and open them with confidence.
An archive is a parcel of files
An Archive is a single file that contains other files and folders, together with the information needed to put them back exactly as they were. A ZIP file is the most common kind of archive. Its name usually ends in .zip. It has two useful effects. First, many files travel as one, which makes sending, downloading and storing easier. Second, the contents are usually compressed, so the parcel is smaller than the things inside.
Making a ZIP file does not change your original files. It creates a new file next to them. Taking things out again is called extracting (or unzipping). Extracting also leaves the ZIP file where it was, so you end up with two copies of the content: the packed one and the unpacked one. Delete the ZIP afterwards if you no longer need it.
- Step 1: Three filesNotes, Budget, Photo
- Step 2: CompressPack them up
- Step 3: Pack.zipOne smaller file
- Step 4: ExtractThree files again
Read this figure as text
A flow showing three files being compressed into one ZIP file and then extracted back into three files.
A flow of four steps. Step one: three separate files, Notes.docx, Budget.xlsx and Photo.jpg. Step two: you choose Compress. Step three: one file, Pack.zip, which holds all three and is usually smaller. Step four: you choose Extract, and the three files appear again exactly as they were, in a new folder called Pack.
How compression works, and why photos barely shrink
Compression means storing the same information in fewer bytes. The idea is to find repetition and describe it briefly. If a text file contains the word invoice two hundred times, the compressor can store the word once and note 'repeat this two hundred times'. ZIP uses lossless compression: when you extract, every byte comes back exactly as it was, so nothing is damaged.
How much a file shrinks depends on how much repetition it contains. Plain text, spreadsheets and documents are full of patterns and often shrink by half or more. Files that are already compressed have little left to squeeze. A JPG photo, an MP3 song, an MP4 video and even another ZIP have been compressed when they were created. Zipping them saves very little, sometimes nothing at all.
Read this figure as text
A bar chart comparing file sizes before and after zipping for a text file, a spreadsheet, a photo and a video.
A bar chart with illustrative sizes as percentages of the original, where 100 means no saving. A plain text file zips to about 30 percent of its original size. A word-processor document zips to about 60 percent. A spreadsheet zips to about 40 percent. A JPG photo stays about 98 percent. An MP4 video stays about 99 percent. The lesson is that text-like files shrink and already compressed media do not.
Creating and extracting ZIP files
Make and open a ZIP file
On Ubuntu 24.04 (Files)
Step 1: Select the files
Open Files and go to your practice folder. Click the first file, hold Ctrl and click the others to select several.
You should see: The chosen files are highlighted.
Step 2: Compress
Right-click one of the selected files and choose Compress. In the box, type a name such as
practice-pack, choose .zip from the format list and click Create.You should see: A new file,
practice-pack.zip, appears in the same folder.Step 3: Extract
Right-click the ZIP file and choose Extract Here to unpack it into the current folder, or Extract To to choose a folder. Double-clicking the ZIP file shows what is inside without unpacking.
You should see: The files appear, usually inside a new folder named after the ZIP file.
On Windows 11 (File Explorer)
Step 1: Select the files
Open File Explorer and go to your practice folder. Click the first file, hold Ctrl and click the others.
You should see: The chosen files are highlighted.
Step 2: Compress
Right-click one of the selected files, choose Compress to ZIP file (on some versions it is under Show more options or in the toolbar), then type a name and press Enter.
You should see: A new file with a zipper icon, for example
practice-pack.zip, appears next to the originals.Step 3: Extract
Right-click the ZIP file and choose Extract All, then click Extract. Leave the box ticked that shows the files when complete.
You should see: A new folder with the same name opens and shows the files.
- Marker 1: Originals stay where they were
- Marker 2: The new ZIP file
- Marker 3: The photo is already compressed, so the ZIP is barely smaller
Read this figure as text
A simulated file manager window listing three practice files and one ZIP file with markers explaining each.
A file manager window titled practice. Three files are listed: Notes.txt at 2 KB, Budget.ods at 45 KB, and Photo.jpg at 2.9 MB (marker 1, the original files). A fourth item is practice-pack.zip at 2.8 MB (marker 2). It is the new archive. It is hardly smaller than the originals added together, because the photo is already compressed (marker 3). The originals are still present and unchanged.
- practice
- practice-pack.zipThe archive: stays after extracting
- practice-packCreated by Extract
- Notes.txt
- Budget.ods
- Photo.jpg
Read this figure as text
A folder tree showing practice-pack.zip next to an extracted folder practice-pack that holds three files.
A tree with a folder called practice at the top. Inside it are four items. First, practice-pack.zip, the archive. Second, a folder called practice-pack, created when you extract, which contains Notes.txt, Budget.ods and Photo.jpg. The ZIP stays in place after extraction, so you can delete it once you are happy with the unpacked files.
Passwords and safety
Archives are a favourite hiding place for Malware, because a ZIP file can hold anything, including programs, and an email scanner cannot always look inside. Treat an unexpected ZIP file the way you treat an unexpected attachment: do not open it.
- Know the sender. Only open a ZIP file you were expecting from someone you trust. If a message with a ZIP file seems odd even from a friend, ask them in another way.
- Look before you extract. Open the ZIP in the file manager to see its contents list. Be wary of names ending in
.exe,.scr,.bator.js, which are programs or scripts. - A ZIP that asks you to enable macros or run something is a warning sign. Delete it.
- Extract into a new folder. Never into the Desktop, where a pile of files will mix with your own.
- Do not extract a ZIP file that is unusually huge for what it claims to be. A tiny download that expands into a huge amount of data is a known trick to fill a disk.
Common mistakes
✖ Instead of: Opening a ZIP file from an unknown sender to see what it is.
✔ Do this: Do not open it. Delete it or report it. Open ZIP files only from people you know and were expecting.
✖ Instead of: Working inside the ZIP file and then wondering where the edits went.
✔ Do this: Extract first, work on the extracted copy, and make a new ZIP if you need to send it.
✖ Instead of: Trusting a ZIP password to protect very private files.
✔ Do this: Old ZIP passwords are weak. Use proper encryption tools for private material and send the password by another route.
If something goes wrong
- The ZIP file will not open, or shows an error such as 'the archive is corrupt'.
- The download or transfer may have been cut short. Download or copy the file again, then retry. If it still fails, ask the sender to make and send it again.
- The extracted files are missing or I cannot find them.
- Look for a new folder with the same name as the ZIP file in the same place. On Ubuntu, use Extract To and choose the folder yourself next time.
- A ZIP file asks for a password I do not have.
- Ask the person who sent it to give you the password by phone or another channel. Do not try to guess it or use programs that claim to break passwords.
Key terms
- Archive
- A single file that holds other files and folders packed together.
- ZIP
- A common file type that bundles files together and makes them smaller.
- Compression
- Making data take up less space by storing it more cleverly.
- Lossless compression
- Making a file smaller in a way that lets you get back the exact original.
Practise it for real
Reading is not the same as being able to do it. Complete these on your own computer, then tick only what you have actually done. These ticks are your own honest record: nothing checks them for you.
Make a ZIP, then extract it somewhere else
On your laptop, create a folder called practice and put in three small files: two text or document files and one photo. Select all three and create a ZIP file called practice-pack. Compare the size of the three originals with the size of the ZIP file. Then extract the ZIP into a new folder called unpacked and check that all three files are there and open correctly.
Challenge: judge four ZIP files
On paper, write one sentence for each of these cases saying what you would do and why. (1) A ZIP file called photos-wedding.zip from a cousin who said she would send it. (2) A ZIP file called invoice-paid.zip from an unknown sender. (3) A ZIP file that contains a file called setup.exe. (4) A ZIP file of 300 photographs that you want to send to Amina.
Knowledge check
6 questions. You need 80% to pass. Mistakes here are part of learning, and you can retry as often as you like.
Summary
- A ZIP file is an archive: one file that holds many, usually compressed.
- Creating a ZIP leaves your originals untouched; extracting leaves the ZIP in place.
- Lossless compression shrinks text and documents well but photos, music and video hardly at all.
- Open ZIP files only from trusted, expected senders, and look at the contents list first.
Checklist: can you do these?
Marking a lesson as read does not prove you can do it. Skills count as demonstrated when you pass the quiz (not yet) and complete the practical tasks (not yet).
Related lessons
References and further reading
Official sources for details that can change between versions.
- Ubuntu Desktop guide: compress files (Ubuntu)
- Windows support: zip and unzip files (Microsoft)