← Years 5–6 Data & Information

Representing text with number codes

A number the computer uses to stand for one letter or symbol. It stores the number, then turns it back into the character on screen. In one A=1 code, A is 1 and B is 2.

Understanding Representing text with number codes in Years 5–6 Data & Information

What it does: The computer keeps the number 3 for C. When it shows the text, it turns 3 back into the letter C. Using A=1, the numbers 3, 1 and 20 stand for C, A and T. Someone who does not know the code sees only numbers. A=1, B=2, C=3. You count along the alphabet to find the number. H is the 8th letter and I is the 9th, so 8 9 spells HI. The order of the numbers matches the order of the letters. Letters, digits and symbols such as ! and ? all have number codes, so a computer can store and show them.

Common mistakes: In an A=1 code, C is the third letter, so C = 3, not 4. In an A=1 code, A is the first letter, so A becomes 1. The number 2 is the code for B.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 1–10) and word search (Modules 1–20).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
How does a computer store the letter B?
As a number codeAs a tiny picture of the letter
Matches
In an A=1 code, D = 5
↓
D is the 4th letter, so it should be 4. The number 5 is the code for E.
Applying
Meanings
Term
character code
Meaning
A number the computer uses to stand for one letter or symbol. It stores the number, then turns it back into the character on screen. In one A=1 code, A is 1 and B is 2.
Practice
print(ord('A'))
Testing
Gaps
A = 1, B = 2, C =
Check Answer
Spots
2B = 2
3C = 4

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Hippopotamus' badge — Savannah Titan, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. How does a computer store the letter B?
A. As a number code ✓
B. As a tiny picture of the letter
Computers store everything as numbers. Each letter has its own number code, and the computer turns the number back into the letter on screen.
2. In a simple A=1 code, which number stands for the letter C?
A. 3 ✓
B. 4
A=1, B=2, C=3. You count along the alphabet to find the number.
3. In an A=1 code, the numbers 8 and 9 stand for which word?
A. HI ✓
B. IH
H is the 8th letter and I is the 9th, so 8 9 spells HI. The order of the numbers matches the order of the letters.
4. Which statement about character codes is true?
A. Only letters have codes, so symbols like ! do not
B. Every letter and symbol has its own number code ✓
Letters, digits and symbols such as ! and ? all have number codes, so a computer can store and show them.
5. What does the computer do with a character code when it shows text on the screen?
A. It shows the number instead of the character
B. It turns the number back into the character ✓
The computer stores the number, then uses the code to turn it back into the letter or symbol you see.

Match the Pairs

A=1, B=2, C=3 → A simple code where each letter is stored as its place in the alphabet
HI = 8 9 → The word HI written as number codes, with H as 8 and I as 9
A computer stores the letter C as a number, then turns it back into a letter on screen → C = 3
A secret code swaps each letter for its number so others cannot read the message at a glance → 3 1 20 = CAT
In an A=1 code, D = 5 → D is the 4th letter, so it should be 4. The number 5 is the code for E.
The computer stores the letter B as the letter 2 → The computer stores B as the number 2, not as a letter. The number is turned back into B when it is shown.

Key Term

character code
A number the computer uses to stand for one letter or symbol. It stores the number, then turns it back into the character on screen. In one A=1 code, A is 1 and B is 2.

Fill in the Blanks

1. A = 1, B = 2, C = 3
Hint: Type the number that comes next in the A=1 pattern for the letter C.
2. Code for CAB: 3, 1, 2
Hint: Type the number code for the letter B in an A=1 code.
3. A number for a letter is a character code
Hint: Type the word that describes the kind of code that stands for one letter or symbol.
4. Stored number: 2 Shown on screen: B
Hint: Type the letter the computer turns the stored number back into in an A=1 code.
5. Secret code for DOG: D=4, O=15, G=7
Hint: Type the number for the letter G by counting through the alphabet.

Spot the Error

Question 1
A A = 1
B B = 2
C C = 4
D CAB is 3 1 2
Line C — In an A=1 code, C is the third letter, so C = 3, not 4.
Question 2
A word = CAB
B C becomes 3
C B becomes 2
D A becomes 2
E coded message: 3 1 2
Line D — In an A=1 code, A is the first letter, so A becomes 1. The number 2 is the code for B.
Question 3
A In an A=1 code, A is 0
B B is 2
C C is 3
Line A — In an A=1 code, A is 1. Because B is 2 and C is 3, A cannot be 0.
Question 4
A message: 8 9
B 8 is H
C 9 is J
D so the message says HI
Line C — In an A=1 code, 9 is the letter I (A=1 ... H=8, I=9). J would be 10. The message says HI, so 9 must be I.
Question 5
A letter = 'A'
B code = chr(letter)
C print(code)
D # prints 65
Line B — ord() changes a letter into its number code. chr() changes a number into a letter. The line should be code = ord(letter).

Student with a class code? Join your class →