GCSE · Computer Science · Eduqas · Spec C500QS

Lossless compression

Squash a file down, unsquash it, and every character is back in place. Nothing lost. How?

​

Computer Science · Compression

One file, three forms

  1. 1 Find
  2. 2 Explore
  3. 3 Translate
  4. 4 Spot the mismatch

Model. A made-up file, used as an example. It shows one simple way of recording repeats: each pattern once, with how many times it repeats. It is not a method you have to learn.

Step 1 · Find

The original contains BBB. Tap any part of the compressed table that records it.

PatternRepeats

Each repeated pattern is recorded once, with how many times it repeats.

Check your thinking

What really happens to the data?

Maya compresses a text file with a lossless method, then decompresses it to get the file back.

Which of these is closest to what you think?
How sure are you?

Lossless or lossy?

LosslessvsLossy

Read across each row. Look for the one that people usually get backwards.

Focus

File size

Lossless

Smaller than the original, but in general larger than a lossy version

Lossy

In general a much smaller file than lossless gives

The insight

Nothing is removed from a lossless file, so there is less to save. That is why lossless files are usually larger.

Data removed

Lossless

None. No data is permanently lost.

Lossy

Some data is permanently removed: data considered unnecessary or less noticeable.

Quality

Lossless

Original quality preserved

Lossy

May be reduced

Reversible?

Lossless

Fully reversible: decompression gives an exact copy

Lossy

Not fully reversible: a decompressed copy is never exact

UK note

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?

Link 1 of 4

First link · your turn

A program is a list of instructions. How is each instruction stored in the file?

2
Locked — reveal the link above first
3
Locked — reveal the link above first
4
Locked — reveal the link above first

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.

5 of 5 still to sort.

Exam practice

Write it, then mark it

A school keeps its rules in a text file and wants the file to use less storage space. Explain why lossless compression should be used. [3 marks]

0 words · your answer stays on this page and is not sent anywhere.

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

1Lossless compression makes a file smaller without losing any data: no data is permanently lost.
2It records a repeated pattern once, with how many times it repeats, and decompression rebuilds every repeat exactly.
3Lossy compression permanently removes some data, so a decompressed lossy file is never an exact copy; lossless files are usually larger.
4Use lossless when data must stay exactly the same, as with text files and program files.

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?
Lossless and lossy.
What does lossless compression do to the data?
It reduces file size without losing any data. No data is permanently lost.
How does lossless compression make a file smaller?
It represents the same data more efficiently, for example recording a repeated pattern once with how many times it repeats.
What does a decompression algorithm do?
It brings a compressed file back to a usable form. With lossless, the result is an exact copy of the original.
Why can decompression rebuild every repeat exactly?
Because the repeated pattern and its count (or positions) are stored.
What does lossy compression do to the data?
It permanently removes some data, so the decompressed file is never an exact copy.
Which data does lossy compression remove?
Data considered unnecessary or less noticeable.
Which usually gives the smaller file: lossless or lossy?
Lossy, in general much smaller. Lossless files are usually larger.
What happens to quality with each type?
Lossless preserves the original quality. Lossy may reduce it.
Which type is fully reversible?
Lossless. Lossy is not fully reversible.
Why do text files need lossless compression?
Every character matters and must be kept exactly, in the right order, for the file to stay correct and usable.
Why do program files need lossless compression?
The instructions must be restored exactly. Changing or losing any bit could make the program behave incorrectly or not run.
What does the choice between lossless and lossy depend on?
The need for data accuracy, the acceptable level of quality loss and how important reducing file size is.
When must you use lossless compression?
When the file must be perfectly preserved: the data must stay exactly the same after decompression.

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 posted

More Eduqas GCSE Computer Science topics

See the full Eduqas Computer Science curriculum →

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.