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.

7 of 7 still to sort.

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?

Exam line: Give the reason, not just the method: lossless when the file must be perfectly preserved, lossy when a slight loss of quality is acceptable for a smaller file.
Watch out: A tight storage limit pulls you towards lossy. It does not change what a text file needs: every character back, exactly.

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?

Computer Science · Data compression

How can it shrink if nothing is removed?

A text file is compressed with a lossless method. The compressed file needs fewer bits than the original.

Nothing was permanently removed, yet the file is smaller. Which idea is closest to what you think?
How sure are you?

Lossless vs lossy

LosslessvsLossy

Same goal, a smaller file. Two very different deals.

Focus

What happens to the data

Lossless

All of it is kept. Nothing is permanently removed.

Lossy

Some of it is removed.

The insight

This is the whole difference. Everything else in the table follows from it.

Getting the original back

Lossless

Decompress and you get exactly the original. Fully reversible.

Lossy

Not exactly, because the removed data is no longer there.

Quality

Lossless

Quality and exact detail preserved.

Lossy

May be reduced.

File size

Lossless

Generally larger than lossy.

Lossy

Generally smaller than lossless.

Choose it when

Lossless

The file must be perfectly preserved.

Lossy

A slight loss of quality is acceptable for a smaller file.

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

1Lossless compression makes a file smaller without losing any data, so nothing is permanently removed.
2A lossless file decompresses back to exactly the original: fully reversible, with quality and exact detail preserved.
3Use lossless when the file must be perfectly preserved. Text files, PNG images and ZIP bundles are the examples to know.
4Lossy generally gives a smaller file but removes data and may reduce quality. Lossless gives a larger file but keeps all the data.
5The choice depends on the accuracy needed, the quality needed and the storage limits.

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?
It reduces the number of bits needed to represent a file, by removing unnecessary data or rearranging information more efficiently.
What must happen to a compressed file before you can use it again?
It must be decompressed.
What is lossless compression?
Compression that makes a file smaller without losing any data. No data is permanently removed.
Why is lossless compression called fully reversible?
Decompressing gives back exactly the original, with its quality and exact detail preserved.
Which kinds of file need lossless compression?
Files where the data must be exactly the same, such as text files, where every character must be preserved.
What is PNG good for?
A lossless image format used where the highest quality must be kept. It supports transparent pixels.
What does ZIP do?
It compresses several files into one file, which can be unpacked into the originals exactly as they were.
Lossy or lossless: which generally gives the smaller file?
Lossy generally gives the smaller file. Lossless gives a larger file but keeps all the data.
What does lossy compression do to the data and quality?
It removes data and may reduce the quality.
Name the three things the choice of method depends on.
The accuracy needed, the quality needed and the storage limits.
When do you choose lossy instead of lossless?
When a slight loss of quality is acceptable in return for a smaller file.

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 Edexcel GCSE Computer Science topics

See the full Edexcel Computer Science curriculum →

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.