GCSE · Computer Science · Edexcel · Spec 1CP2
Lossless compression
Make a file smaller, send it, then make it big again. Has anything changed? With lossless compression, the answer is a very satisfying 'no'.
Computer Science · Data compression
Lossless or lossy: which would you pick?
Sort each file into the kind of compression it needs. Commit to a choice, then read the reason.
Still to sort
Must be lossless (0)
The exact original has to come back.
Where the line is: If the file must be perfectly preserved, it goes here. Lossless keeps all the data, so decompressing gives back exactly what you started with.
Lossy is acceptable (0)
A slight loss of quality is fine for a smaller file.
Where the line is: Lossy generally gives a smaller file but removes data and may reduce quality, so it only belongs here when that slight loss really is acceptable.
Every file needs a decision. Make it first, then read why. The reason always comes back to one question: does the exact original need to come back?
Predict, then check
A text file is compressed losslessly, sent to a friend, then decompressed. Commit before you look.
What does your friend have after decompressing it?
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
What you need to know
- Compression reduces the number of bits needed to represent a file, by removing unnecessary data or rearranging information more efficiently.
- A compressed file has to be decompressed before you can use it again.
- Lossless compression makes a file smaller without losing any data. Nothing is permanently removed.
- So a lossless file decompresses to exactly the original: fully reversible, with quality and exact detail kept.
- Files that must be exactly the same, like text files, need lossless, because every character has to be preserved.
Have a goImagine a compressor changes just one character in a text file, turning 'Meet at 5' into 'Meet at 6'. Is that acceptable? Why or why not?
No. In a text file every character must be preserved exactly.
If even one character changes, the file is no longer correct, which is why text needs lossless compression.
- PNG is a lossless image format. It is used where the highest quality must be kept, and it supports transparent pixels.
- ZIP compresses several files into one file, and unpacking it gives you the originals exactly as they were.
Have a goYou ZIP three files into one and your friend unpacks it. How many files do they end up with, and how do they compare with your originals?
Three files, each exactly as it was before zipping.
ZIP compresses several files into one file, but unpacking gives the originals back exactly, so it is lossless.
- Lossy generally gives a smaller file than lossless, but it removes data and may reduce quality.
- Choose lossless when the file must be perfectly preserved, and lossy when a slight loss of quality is acceptable for a smaller file.
Have a goDev announces: 'Lossy always wins because it gives a smaller file, so I use it for everything.' Using the rule, when is Dev wrong?
Whenever the file must be perfectly preserved, such as a text file.
Lossy generally gives a smaller file but removes data, so it only fits when a slight loss of quality is acceptable.
The big picture
Compression reduces the number of bits needed to represent a file, and a compressed file must be decompressed before you can use it again. Lossless compression makes a file smaller without losing any data, so decompressing gives back exactly the original. That matters for files that must be perfectly preserved, such as text files. PNG and ZIP are lossless examples. Lossy generally gives a smaller file but removes data and may reduce quality, so the choice depends on the accuracy needed, the quality needed and the storage limits.
Key points
Worked example
Problem
Maya has a text file of her coding notes and wants it smaller to save space on a memory stick. Should she use lossy or lossless compression, and what must she do before she can read the notes again?
⚠ Watch out
Believing that a smaller file always means something was thrown away. That is true for lossy. With lossless, the file gets smaller and no data is permanently removed, so the exact original comes back when you decompress.
Memory hook
Lossless means you lose nothing. Compress it, send it, decompress it, and every bit is back in its seat.
Check yourself
A friend says 'if a file got smaller, some of it was deleted'. Explain why that is not always true, and name one file type that needs lossless.
Flashcards
(11)What does data compression do?
What must happen to a compressed file before you can use it again?
What is lossless compression?
Why is lossless compression called fully reversible?
Which kinds of file need lossless compression?
What is PNG good for?
What does ZIP do?
Lossy or lossless: which generally gives the smaller file?
What does lossy compression do to the data and quality?
Name the three things the choice of method depends on.
When do you choose lossy instead of lossless?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore Edexcel GCSE Computer Science topics
How this lesson was checked. This Edexcel GCSE Computer Science (specification 1CP2)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 9 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.