GCSE · Computer Science · Edexcel · Spec 1CP2

Lossless compression

Squash a file down, send it, unsquash it. Has anything changed? With lossless compression the answer is a very satisfying 'nope, not one bit'.

Computer Science · Data compression

Lossless or lossy: you decide

Sort each file into the compression it needs. Commit, then check 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 lives 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. It only belongs here when that slight loss really doesn't matter.

7 of 7 still to sort.

Seven files, one question each time: does the exact original have to come back? Pick first, then read why.

Exam line: Always give the reason, not just the method: lossless when the file must be perfectly preserved, lossy when a slight loss of quality is fine for a smaller file.
Watch out: A nearly full memory stick pulls you towards lossy. It doesn't 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. Lock in your guess first.

What does your friend end up with after decompressing it?

Computer Science · Data compression

Smaller, but nothing removed? How?

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 got smaller. Which idea is closest to what you think right now?
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. Every other row follows from it.

Getting the original back

Lossless

Decompress and you get exactly the original. Fully reversible.

Lossy

Not exactly, because the removed data isn't there any more.

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 cuts the number of bits needed to represent a file, by removing unnecessary data or rearranging information more efficiently.
  • Here's the catch: 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 it's fully reversible: decompress it and you get exactly the original back, quality and exact detail included.
  • Have a goSam compresses his essay losslessly, then groans: 'Great, now some of my best sentences are probably gone.' Should Sam panic?

    No. When he decompresses it, every word comes back exactly.

    Sam is assuming smaller means something was deleted, but lossless permanently removes nothing, so the round trip is fully reversible.

  • Text files need lossless, because every character must be preserved exactly for the file to stay correct and usable.
  • Have a goImagine a compressor turned 'Meet at 5' into 'Meet at 6' in a text file. Just one character. Would that be acceptable?

    No. One wrong character and the message is wrong.

    It's tempting to call one character a tiny loss, but text is only correct and usable if every character is preserved exactly.

  • PNG is a lossless image format, used where the highest quality must be kept, and it supports transparent pixels.
  • ZIP squeezes several files into one file, and unpacking it gives back 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 yours?

    Three files, each exactly as it was before zipping.

    Bundling into one file isn't permanent merging: unpacking a ZIP gives back the originals exactly, because it's lossless.

  • Lossy generally gives a smaller file than lossless, but it removes data and may reduce quality.
  • Pick lossless when the file must be perfectly preserved, and lossy when a slight quality loss is fine for a smaller file.
  • Have a goDev announces: 'Lossy always wins because it gives a smaller file, so I use it for everything.' When is Dev wrong?

    Whenever the file must be perfectly preserved, like a text file.

    A smaller file is only worth it when a slight loss of quality is acceptable; lossy removes data, so it fails any file that must come back exactly.

  • The choice comes down to the accuracy needed, the quality needed and the storage limits.

The big picture

Compression cuts the number of bits needed to represent a file, and a compressed file has to 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 whenever a file must be perfectly preserved, like a text file. 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: 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

Thinking a smaller file always means something was thrown away. That's 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

Loss-less: zero loss, not a little less. Compress it, send it, decompress it, and every bit is back in its seat.

✓

Check yourself

A friend insists: 'If a file got smaller, some of it was deleted.' Explain why that isn't always true, and name one kind of file that needs lossless compression.

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 has to happen to a compressed file before you can use it again?
It has to 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?
It's a lossless image format used where the highest quality must be kept, and 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 the 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 would 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 26 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.