GCSE · Computer Science · Eduqas · Spec C500QS
Lossless compression
Squash a file down, unsquash it, and every character is back in place. Nothing lost. How?
Eduqas GCSE Computer Science: compression (lossless) sits under Data representation and storage.
Program files
Reason it through
Why does a program file need lossless compression?
First link · your turn
A program is a list of instructions. How is each instruction stored in the file?
Decide
Which type of compression fits?
For each file or situation, pick the type of compression that fits, then read the reason.
Still to sort
Must be lossless (0)
The data has to come back exactly.
Where the line is: If the file must be perfectly preserved, lossless should be used.
Lossy could be acceptable (0)
Some quality loss is fine and a smaller file matters.
Where the line is: Only when the lost quality is acceptable and reducing file size matters more.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Make a file smaller, then get it back exactly the same.
What you need to know
- Compression makes a file smaller. There are two types: lossless and lossy.
- Lossless compression reduces file size without losing any data. Nothing is permanently lost.
- It works by writing the same data more efficiently, for example recording a repeated pattern once, with how many times it repeats.
Have a goA file holds ZZZZZZZZ, eight Zs in a row. Write it the way lossless compression might: the pattern once, plus a count.
Z, 8 (the Z once, repeated 8 times)
The pattern is recorded once with how many times it repeats, which says the same thing as eight Zs in less space.
- A decompression algorithm brings a compressed file back to a usable form. With lossless, the result is an exact copy.
- Because the pattern and its count are stored, every repeat can be rebuilt exactly. So no data is lost.
Have a goSam looks at 'Z, 8' and says: 'You've thrown away seven of my Zs, so that's lost data.' Is Sam right?
No. The count lets all eight Zs be rebuilt.
The pattern and its count are both stored, so decompression rebuilds every repeat exactly. Nothing was thrown away.
- Lossy compression permanently removes some data, so a decompressed lossy file is never an exact copy.
- Lossy removes data considered unnecessary or less noticeable. In general it gives a much smaller file, so lossless files are usually larger.
- Lossless keeps the original quality and is fully reversible. Lossy may reduce quality and is not fully reversible.
Have a goYou compress one file two ways, lossless and lossy. Which result is usually larger, and which can you turn back into the exact original?
Lossless is usually larger, and it is the one you can turn back exactly.
Lossless removes nothing, so it generally saves less but is fully reversible. Lossy removes data, so it is not.
- Use lossless when the data must stay exactly the same and accuracy and detail matter. Text files and program files both need it.
- Choose by accuracy needed, acceptable quality loss and how much size matters. If the file must be perfectly preserved, use lossless.
The big picture
Lossless compression makes a file smaller without losing any data: it writes the same data more efficiently, for example by recording a repeated pattern once with how many times it repeats. Decompression then gives back an exact copy. Lossy compression permanently removes some data, so it can never do that. When data must stay exactly the same, as with text and program files, lossless is the one to use.
Key points
Worked example
Problem
A file has been compressed by recording each pattern once with its repeat count: K 2, L 6, M 1, N 3. Rebuild the original file. Has any data been lost?
⚠ Watch out
Thinking a smaller compressed file must have lost data. Lossless compression makes a file smaller by writing the same data more efficiently; only lossy compression permanently removes data.
Memory hook
LOSSless: loses nothing, comes back exactly. LOSSy: some data is lost for good.
Check yourself
Why can a lossless file be smaller than the original and still decompress to an exact copy? Say it in one sentence.
Flashcards
(14)What are the two types of data compression?
What does lossless compression do to the data?
How does lossless compression make a file smaller?
What does a decompression algorithm do?
Why can decompression rebuild every repeat exactly?
What does lossy compression do to the data?
Which data does lossy compression remove?
Which usually gives the smaller file: lossless or lossy?
What happens to quality with each type?
Which type is fully reversible?
Why do text files need lossless compression?
Why do program files need lossless compression?
What does the choice between lossless and lossy depend on?
When must you use lossless compression?
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 Eduqas GCSE Computer Science topics
How this lesson was checked. This Eduqas GCSE Computer Science (specification C500QS)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 16 November 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.