KS3 · Computer Science

Representing text with ASCII

To a computer, your name is just 0s and 1s. Let's encode a word letter by letter, then get it back.

Computer Science · Representing text

Encode “her”, then decode it back

One character at a time: look it up, write its binary code, watch the message grow. Then run it backwards.

Before you step to r: what will the length be once its code joins the message?

1 ENCODE for each character in the text:
2 look it up in the ASCII table
3 write its 7-digit binary code (with a space before it, unless it is first)
4 DECODE split the message into 7-digit groups
5 look each group up in the ASCII table, in order
characterbinary codebinary message so farlength (digits + spaces)decoded text
h110100011010007 + 0 = 7—

Output

 

Step 1: Find h in the table: its binary code is 1101000. First code, so no space yet.

1 / 6

Look each character up in the ASCII table and copy its binary code.

Step 1 of 6: Find h in the table: its binary code is 1101000. First code, so no space yet..

Watch out: Decode the 7-digit groups in the order they arrive. Swap the order and you get different text.

What do you think?

How does a computer hold the letter A?

You press the A key. Somewhere inside the computer, that letter now has to be held.

Which is closest to what you think right now?
How sure are you?

Three coding schemes

Morse code, braille or ASCII?

Tick every property each coding scheme has. Then check, and look down each column for where they differ.

Morse code
Braille
ASCII

Check the encoding

Where did this go wrong?

Encode per using the ASCII table: p = 1110000, e = 1100101, r = 1110010.

A classmate's answer — which line goes wrong?

Your turn to fill the gaps

How long is “computing” in ASCII?

The word computing is encoded in ASCII, with a space between neighbouring 7-digit codes. Work out its representation length.

  1. Count the letters: c-o-m-p-u-t-i-n-g is 9 letters, so 9 binary codes.
  2. missing step
Which line is step 2?

Predict, then check

Commit first. Count both versions the same way: symbols plus spaces.

Babbage has 7 letters. Which version of the message babbage has the longer representation length: Morse code or ASCII?

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 turning symbols into another form.
  • Morse code, braille and ASCII are all coding schemes, and different schemes suit different situations.
  • Morse code turns each character into a mix of dots and dashes. A is dot dash.
  • Braille is raised dots read with the fingers. Each letter or number is a six-dot rectangle with its own pattern.
  • Have a goYou're labelling the buttons in a lift so that someone who can't see them can still find floor 3. Which of the three coding schemes do you use?

    Braille.

    Braille is the one made of raised dots you read with your fingers. Morse code and ASCII are coding schemes too, but neither is built from raised dots.

  • Computers use just two symbols, 0 and 1. Every piece of information becomes sequences of them.
  • Two physical states can show those symbols, like a torch on (1) or off (0).
  • Have a goYour friend flashes a torch at you from across the street: on, off, off, on. Using the torch rule, write the message as 0s and 1s.

    1001

    On is 1 and off is 0, taken in the order you saw them. Swap the rule round and you'd write 0110 instead.

  • ASCII gives every character, whether a letter, number or symbol, its own unique number. A is 65.
  • Look a character up in the ASCII table to find its code and binary code. Here each binary code is 7 digits: h is 1101000.
  • Encoding converts information into another form, like text into binary. Decoding reverses it, back to the original form.
  • Representation length is the total number of symbols in the coded message, and that includes the spaces.
  • Have a goA 4-letter word is written in ASCII, with a space between neighbouring 7-digit codes. What's its representation length?

    31: 28 digits + 3 spaces.

    4 × 7 = 28 digits, and 4 codes have 3 spaces between them. Forget the spaces and you'd say 28; one space per letter would give 32.

The big picture

A coding scheme is a set of rules for turning symbols into another form. Morse code, braille and ASCII are all coding schemes, and different schemes suit different situations. Computers use just two symbols, 0 and 1, which two physical states such as a torch on or off can show. ASCII gives every character its own number (A is 65), and the ASCII table lists each character with its code and its binary code. Encoding means looking each character up; decoding means looking each code up again. Representation length counts every symbol in the coded message, spaces included.

Key points

1Coding schemes such as Morse code, braille and ASCII are rule sets that turn characters into another form, each suited to its own situation.
2Computers hold every piece of information as 0s and 1s, which two physical states can show.
3ASCII gives each character a unique number, listed in the ASCII table with its binary code; A is 65.
4To encode text, look each character's binary code up; to decode, look each code up again, in order.
5Representation length counts every symbol, spaces included, so the same message can be longer in one scheme than another.

Worked example

Problem

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

⚠ Watch out

Leaving the spaces out of the representation length. It looks like only the 0s and 1s should count, but representation length is every symbol in the coded message. So her in ASCII is 21 digits + 2 spaces = 23, not 21.

🧠

Memory hook

Look it up, write it down, look it up back. Then count digits AND spaces.

✓

Check yourself

Encode pep using p = 1110000 and e = 1100101, then give its representation length. (Answer: 1110000 1100101 1110000, which is 21 digits + 2 spaces = 23.)

Flashcards

(15)
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.
Why is there more than one coding scheme?
Different schemes work for different situations.
Which two symbols does a computer use?
0 and 1. Every piece of information is represented as sequences of them.
How can a torch show the symbols 0 and 1?
With its two states: on is 1 and off is 0.
What is ASCII?
A character set that gives each character (letters, numbers and symbols) its own unique numerical value.
What ASCII code does the character A have?
65.
Where do you find a character's ASCII code and binary code?
In an ASCII table, which lists each character with its ASCII code and its binary code.
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 encoded data back into its original form.
How many digits are in each ASCII binary code in this lesson?
7.
What is the binary code for p in the ASCII table?
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. Each character is a six-dot rectangle in two columns.
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 27 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.

Helpful guides for parents and students