Skip to the page
Year 8 · Spring 1 · Representations: from clay to silicon

ASCII and Unicode

PracticalPresent ▶

What this lesson covers

Topic 4 Representing text

KS3 Computing · Every character gets a number. The number is stored in binary. The agreed list of characters and numbers is a character set.

Computer SystemsCambridge Lower Secondary Computing 0860

You will learn to

  • Explain why every computer must use the same character set.
  • Convert characters to ASCII codes and back, using A = 65, a = 97 and the digit 0 = 48.
  • Explain why the code for B is one more than the code for A.
  • Explain why Unicode was needed, and that its first 128 codes are the same as ASCII.

Success criteria

  • I can write my name as ASCII codes with the ASCII toy.
  • I can work out the code for any capital letter, starting from A = 65.
  • I can work out how many bytes a word takes at one byte per character.

Key words

Say each word, then read what it means. Every one is in the glossary too.

ASCII
7-bit character set with 128 characters. A = 65.
Unicode
Character set for every writing system, plus emoji.
Character set
The agreed list of characters and the number for each.
UTF-8
The usual way Unicode is stored. 1 byte for the old ASCII characters (so old files still work), 2 bytes for ñ or é, 3 for €, 4 for emoji.

The explanation

Read it here, or open the study page below to go one step at a time with things to try.

ASCII

ASCII (said 'ass-key') was agreed in the 1960s.

  • 7 bits per character → 2⁷ = 128 characters.
  • Covers A–Z, a–z, 0–9, punctuation, space, and invisible control characters like 'new line'.
  • 'Extended ASCII' uses 8 bits for 128 more, like é and ñ.
CharacterCodeBinary
A6501000001
B6601000010
Z9001011010
a9701100001
0 (the digit)4800110000
space3200100000

Worked example: storing 'Hi'

  1. Look up H → 72. Look up i → 105.
  2. 72 in binary: 64 + 8 → 01001000.
  3. 105 in binary: 64 + 32 + 8 + 1 → 01101001.
  4. The computer stores 01001000 01101001.
  5. Size: 2 characters × 8 bits = 16 bits = 2 bytes.

Unicode: when 256 isn't enough

ASCII has no room for Chinese, Arabic, Hindi, Greek or emoji. Unicode is one giant list for every writing system.

  • Room for over a million characters. About 150,000 used so far, including emoji.
  • Its first 128 codes are the same as ASCII, so A is still 65.
  • UTF-8 stores ASCII in 1 byte and other characters in 2 to 4 bytes.

Study it

Open the study page and go one step at a time.

The steps for this lesson

Try it

Build it

Check yourself

One question at a time. The reason shows after each answer.

Saved on this device.