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 table3 write its 7-digit binary code (with a space before it, unless it is first)4 DECODE split the message into 7-digit groups5 look each group up in the ASCII table, in order
| character | binary code | binary message so far | length (digits + spaces) | decoded text |
|---|---|---|---|---|
| h | 1101000 | 1101000 | 7 + 0 = 7 | — |
Output
Step 1: Find h in the table: its binary code is 1101000. First code, so no space yet.
Look each character up in the ASCII table and copy its binary code.
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
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?
Name three coding schemes.
Why is there more than one coding scheme?
Which two symbols does a computer use?
How can a torch show the symbols 0 and 1?
What is ASCII?
What ASCII code does the character A have?
Where do you find a character's ASCII code and binary code?
What does encoding mean?
What does decoding do?
How many digits are in each ASCII binary code in this lesson?
What is the binary code for p in the ASCII table?
How does Morse code represent each character?
What is braille?
What is representation length?
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 postedMore KS3 Computer Science topics
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.