KS3 · Computer Science

Representing text with ASCII

Press h and your computer doesn't keep an h. It keeps 1101000, picked from a table. Let's encode a word, then decode it back.

Computer Science · Representing text

Turn a word into 0s and 1s, then back again

Step through and watch each character of her get swapped for its code from the ASCII table. Then watch the swap run backwards.

Predict first: every character gets a 7-digit code. How long will the coded message for her be, and do the spaces between the codes count?

1 Message to encode: her
2 ASCII table (just the rows we need)
3 h 1101000
4 e 1100101
5 r 1110010
6 p 1110000
directioncharacterbinary codecoded messagedecoded textlength
start(empty)0

Output

 

Step 1: We are going to encode the word her. Nothing is coded yet, so the length is 0.

1 / 7

Use Next to move one step at a time. Keep an eye on the length column as the coded message grows.

Step 1 of 7: We are going to encode the word her. Nothing is coded yet, so the length is 0..

Watch out: You look each code up in the table; you don't work it out. And the spaces between the codes count towards the length.

Computer Science · Representing text

How does a computer keep the letter A?

You press the A key on a keyboard and a letter A appears on the screen. Somewhere inside the computer, that A has to be stored.

Which is closest to what you think is happening?
How sure are you?

Computer Science · Coding schemes

Three coding schemes, three sets of rules

Morse code, braille and ASCII are all coding schemes. For each property, decide which of them it describes.

Morse code
Braille
ASCII

Computer Science · Encoding

Find the faulty line

A student encoded the word per, one character per line, using the ASCII table. One line has the wrong 7-digit code. Which one?

A student's encoding — which line goes wrong?

Computer Science · Representation length

How long is the coded message?

Work out the representation length of the message computing in ASCII. Remember that the spaces between the codes count.

  1. The message computing has 9 letters.Count the letters first.
  2. missing step
Which line is step 2?

Predict, then check

Both versions of the message use the same rule for length: count every symbol, spaces included.

The message babbage is coded in Morse code and in ASCII. Which coded message has the greater representation length?

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

What you need to know

  • A coding scheme is a set of rules for swapping symbols into another form.
  • In Morse code, each character is a combination of dots and dashes. A is dot dash.
  • Braille is a system of raised dots, read with the fingers. Each character is a different pattern in a six-dot rectangle.
  • Have a goWhich of Morse code, braille and ASCII is built to be read with your fingers?

    Braille.

    Braille is a system of raised dots read with the fingers. Morse code is dots and dashes, and ASCII is 0s and 1s.

  • Computers only use two symbols, 0 and 1. Every piece of information is a sequence of them.
  • Two physical states can show those symbols, like a torch that is on (1) or off (0).
  • Have a goA torch can only be on or off. How many different symbols can one torch show?

    Two: on is 1 and off is 0.

    Two physical states match the two symbols, 0 and 1, that computers use.

  • ASCII is a character set. Each character, whether letter, number or symbol, gets its own unique numerical value.
  • You find the codes in an ASCII table, which lists each character with its ASCII code and its binary code.
  • For example, the character A has the ASCII code 65.
  • Encoding converts information from one form into another. Decoding reverses it, turning coded data back into what it was.
  • In this lesson's ASCII examples, every binary code has 7 digits. Here h is 1101000 and e is 1100101.
  • Have a goSpot the odd one out: 1101000, 1100101, 11001010. Which can't be a code from this lesson?

    11001010, because it has 8 digits.

    Every code in this lesson's ASCII examples has exactly 7 digits.

  • Representation length is the total number of symbols in the coded message, spaces included.
  • Have a goA message is 4 codes of 7 digits each, with a space between the codes. What is its representation length?

    31: 28 digits plus 3 spaces.

    4 codes need 3 spaces between them, and the spaces count towards the length.

The big picture

A coding scheme is a set of rules for swapping symbols into another form. Morse code, braille and ASCII are all examples. A computer only has the symbols 0 and 1, so ASCII gives every character a code you look up in the ASCII table, which also lists its binary code. Encoding turns text into binary digits and decoding turns them back. The representation length counts every symbol in the coded message, spaces included.

Key points

1A coding scheme is a set of rules for swapping symbols into another form. Morse code, braille and ASCII are examples.
2Computers only have the symbols 0 and 1, so every piece of information, text included, is held as sequences of 0s and 1s.
3ASCII gives each character a unique numerical value. You look it up in the ASCII table, which also lists the binary code.
4Encoding turns text into binary digits by looking each character up. Decoding looks each code up again to get the text back.
5Representation length counts every symbol, spaces included. In this lesson's ASCII examples, each character takes 7 binary digits.

Worked example

Problem

Encode the word cat in Morse code. Then work out its representation length, counting the spaces between the characters.

⚠ Watch out

Forgetting the spaces. When you work out representation length you count the symbols and then add the spaces between the characters. They are part of the length, and a message with 9 characters has 8 of them.

🧠

Memory hook

Look up, swap, look up back. The table swaps each character for its code, and the same table swaps it back. Then count the symbols and don't forget the spaces.

✓

Check yourself

Cover the page. Encode pep with the ASCII table (p is 1110000, e is 1100101) and give its length, spaces included. Then say why a computer needs a table at all.

Flashcards

(14)
What is a coding scheme?
A set of rules that defines how symbols map to another form.
Name three coding schemes.
Morse code, braille and ASCII.
Which two symbols does a computer use?
0 and 1. Every piece of information is held as sequences of them.
How can a torch show the symbols 0 and 1?
Two states: on is 1 and off is 0.
What is ASCII?
A character set (a character coding scheme) that gives each character, letter, number or symbol, a unique numerical value.
How do you find a character's ASCII code?
Look it up in an ASCII table, which lists each character with its ASCII code and its binary code.
What ASCII code does the character A have?
65.
What does encoding mean?
Converting information from one form into another, typically to make it easier to store, transmit or process.
What does decoding do?
It reverses encoding, converting coded data back into its original form.
How many digits does each character's binary code have in this lesson's ASCII examples?
7 digits.
In this lesson's ASCII table, what is the binary code for p?
1110000.
How does Morse code represent each character?
As a combination of dots and dashes. For example, A is dot dash.
What is braille?
A system of raised dots read with the fingers, used by blind people and people with low vision.
What is representation length?
The total number of symbols in the coded sequence, including spaces.

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 KS3 Computer Science topics

See the full KS3 Computer Science curriculum →

How this lesson was checked. This KS3 Computer Sciencelesson 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.