Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      Lesson details

      Learning outcome

      I can describe and use run length encoding to compress data.

      Key learning points

      1. Run length encoding is a lossless data compression technique that reduces the size of repeating sequences of data.
      2. Run length encoding uses the concept of redundancy to reduce file size.
      3. Redundancy is about the repetitive information within a data set, which can be removed without losing essential meaning.
      4. Run length encoding may not always reduce file size and may not be suitable for all applications.

      Keywords

      • Run length encoding - a common type of lossless compression

      • Data pattern - a recurring trend, relationship, or structure found within a set of data

      • Redundancy - repeated or extra data that isn’t needed

      Common misconception

      Run length encoding always reduces file size.

      Run length encoding only works well when data has long repeated patterns. If data is random or has frequent changes, RLE may not reduce the file size and can even make it bigger. For example, compressing "HELLO" with RLE results in "1H1E2L1O".

      Teacher tip

      Make links to real use cases and explain where run length encoding is commonly used for example bitmap images, printers and document scanning. This will give context to learners and show it's not just theory.

      Licence

      This content is © Oak National Academy Limited (2025), licensed on Open Government Licence version 3.0
      except where otherwise stated. See Oak's terms & conditions
      (Collection 2).

      Lesson video

      Loading...

      Prior knowledge starter quiz

      6 Questions

      Q1.
      What is the compression ratio?

      the ratio of the compressed data to the original data
      the size of compressed data only
      the processing speed of compression algorithms
      Correct answer: the ratio of the original data to the compressed data

      Q2.
      What happens when the compression ratio is higher?

      Correct answer: The file size decreases, but performance may slow down.
      The file size increases.
      The file size remains the same.
      The file quality always improves.

      Q3.
      What is the term for the file size before compression?

      compressed size
      ratio size
      Correct answer: original size
      file ratio

      Q4.
      What is the term for the file size after compression?

      file ratio
      data speed
      original size
      Correct answer: compressed size

      Q5.
      What does a higher compression ratio require?

      less processing power
      Correct answer: more processing power and time
      no decompression
      increased file size

      Q6.
      What must be considered when selecting a compression algorithm?

      file size only
      Correct answer: data quality and processing speed
      the compression ratio only
      the type of storage device

      6 Questions

      Q1.
      What type of compression is run length encoding?

      lossy compression
      Correct answer: lossless compression
      random compression
      encrypted compression

      Q2.
      What does run length encoding use to reduce file size?

      Correct Answer: redundancy, redundant data

      Q3.
      What is redundancy in a data set?

      random information
      data that cannot be compressed
      Correct answer: repetitive information that can be removed
      a method to increase data size

      Q4.
      When does run length encoding work best?

      Correct answer: when data has long repeated patterns
      when data is entirely random
      when data is encrypted
      when data is already compressed

      Q5.
      Which of the following is an example of run length encoding?

      replacing ABC with XYZ
      encrypting data with a password
      Correct answer: compressing AAAA to 4A
      expanding file size for clarity

      Q6.
      Does run length encoding always reduce file size?

      Yes, it always reduces file size.
      Yes, even with random data.
      No, it only works for encrypted data.
      Correct answer: No, it works best with data that has long repeated patterns.

      To help you plan your 10 computer science lesson on: Run length encoding, download all teaching resources for free and adapt to suit your pupils' needs...