← ACARA Digital Technologies Years 7–8

Converting a word to ASCII decimal codes

Look up each character in the ASCII table and write its decimal number in order. Capitals and lowercase differ, so Hi is 72 105 (H is 72, i is 105).

Understanding Converting a word to ASCII decimal codes in ACARA Digital Technologies Years 7–8

What it does: L is 76, e is 101 and o is 111. Each letter is looked up once and the codes stay in word order. Capital M is 77 and lowercase m is 109, which shows that capitals and lowercase are kept separate. Write the codes in the same order as the letters. H is 72 and i is 105, so Hi is 72 105. Capital M is 77. Lowercase m is 109. Mia starts with a capital M, then i is 105 and a is 97. Work from left to right: L is 76, e is 101, o is 111. Reversing the list would spell a different word.

Common mistakes: Capital H is 72 in the ASCII table. 73 is capital I. The line should be H = 72. The string is missing its closing quote. It should be word = "Cat".

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 128–152) and word search (Modules 69–152).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which list gives the ASCII decimal codes for the word "Hi"?
105 7272 105
Matches
Mia = 77 97 105
↓
The codes are in the wrong order. The word is M, i, a, so the codes should be 77 105 97.
Applying
Meanings
Term
ASCII decimal code
Meaning
Look up each character in the ASCII table and write its decimal number in order. Capitals and lowercase differ, so Hi is 72 105 (H is 72, i is 105).
Practice
S = 83
Testing
Gaps
=("H")
Check Answer
Spots
1word = "Hi"
2H = 73

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

The 'Giant Isopod' badge — Patient Builder, 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. Which list gives the ASCII decimal codes for the word "Hi"?
A. 105 72
B. 72 105 ✓
Write the codes in the same order as the letters. H is 72 and i is 105, so Hi is 72 105.
2. Which statement about the letters A and a is true in ASCII?
A. A is 65 and a is 97 ✓
B. A and a are both 65
Capitals and lowercase letters have different codes, so keep them separate. A is 65 and a is 97.
3. Which list gives the ASCII decimal codes for the name "Mia"?
A. 109 105 97
B. 77 105 97 ✓
Capital M is 77. Lowercase m is 109. Mia starts with a capital M, then i is 105 and a is 97.
4. How many ASCII codes do you write for the word "Jack"?
A. 4 codes, one for each character ✓
B. 1 code for the whole word
Look up each character once and write its own code. J, a, c and k give four codes: 74 97 99 107.
5. Which list gives the ASCII decimal codes for "Cat"?
A. 67 97 116 ✓
B. 99 97 116
Capital C is 67. Lowercase c is 99. Cat starts with a capital C, then a is 97 and t is 116.

Match the Pairs

Sam = 83 97 109 → S is 83, a is 97 and m is 109, written in the same order as the letters in the word
A = 65, a = 97 → A capital letter and its lowercase letter have different ASCII codes, so they must be kept separate
Write the ASCII code for each letter in the same order as the letters in the word, checking each character once → Leo = 76 101 111
The same letter has two different codes depending on whether it is a capital or lowercase → M = 77, m = 109
Mia = 77 97 105 → The codes are in the wrong order. The word is M, i, a, so the codes should be 77 105 97.
Ava = 97 118 97 → The capital A was given the lowercase code. Capital A is 65, so the answer should be 65 118 97.

Key Term

ASCII decimal code
Look up each character in the ASCII table and write its decimal number in order. Capitals and lowercase differ, so Hi is 72 105 (H is 72, i is 105).

Fill in the Blanks

1. =CODE("H")
Hint: Type the spreadsheet function that returns the number code of a character.
2. Hi = H is 72, i is 105
Hint: Look up lowercase i in the ASCII table and type its decimal code.
3. A is 65, so a is 97
Hint: Capital and lowercase letters have different codes. Type the decimal code for lowercase a.
4. FOR EACH letter IN "Sam" OUTPUT CODE(letter) END FOR
Hint: Type the keyword that links the loop variable to the word, so each character is checked once.
5. =CODE(MID(A1,2,1))
Hint: Type the position number of the second character in the word, so MID picks it out.

Spot the Error

Question 1
A word = "Hi"
B H = 73
C i = 105
D codes = 72 105
Line B — Capital H is 72 in the ASCII table. 73 is capital I. The line should be H = 72.
Question 2
A word = "Cat
B C = 67
C a = 97
D t = 116
Line A — The string is missing its closing quote. It should be word = "Cat".
Question 3
A for ch in "Zoe"
B print(ord(ch))
C # Z = 90, o = 111, e = 101
Line A — A for loop line must end with a colon. It should be for ch in "Zoe":
Question 4
A word: Ava
B A = 65
C v = 118
D a = 65
E codes: 65 118 97
Line D — Lowercase a is 97. 65 is capital A. Capitals and lowercase have different codes, so it should be a = 97.
Question 5
A name = "Leo"
B for ch in len(name):
C print(ord(ch))
Line B — len(name) gives a number (3), which can't be looped over to check each character. It should be for ch in name:.

Student with a class code? Join your class →