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: her2 ASCII table (just the rows we need)3 h 11010004 e 11001015 r 11100106 p 1110000
| direction | character | binary code | coded message | decoded text | length |
|---|---|---|---|---|---|
| start | (empty) | 0 |
Output
Step 1: We are going to encode the word her. Nothing is coded yet, so the length is 0.
Use Next to move one step at a time. Keep an eye on the length column as the coded message grows.
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
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?
Name three coding schemes.
Which two symbols does a computer use?
How can a torch show the symbols 0 and 1?
What is ASCII?
How do you find a character's ASCII code?
What ASCII code does the character A have?
What does encoding mean?
What does decoding do?
How many digits does each character's binary code have in this lesson's ASCII examples?
In this lesson's ASCII table, what is the binary code for p?
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
- Abstraction in computational thinking
- Adding binary numbers
- Binary to denary conversion
- Boolean logic: AND, OR, NOT
- Bubble sort
- Building truth tables
- Client-server vs peer-to-peer
- Collecting and recording data
- Comparing sorting algorithms
- Compressing data
- Creating a 3D animation
- Decomposition: splitting problems up
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.