Character sets: ASCII and Unicode

Cambridge IGCSE Computer Science (0478) · lesson 5 of 35 · 20 min

Why Do We Need Character Sets?

Computers store everything as numbers. To store text, we need an agreed mapping between numbers and characters — a character set. Without a standard, a file created on one computer would display as gibberish on another.

ASCII

ASCII (American Standard Code for Information Interchange) was developed in the 1960s. It uses 7 bits to represent 128 characters (0–127), including:

  • Control characters (0–31): newline, tab, carriage return, etc.
  • Printable characters (32–126): space, digits 0–9, uppercase A–Z, lowercase a–z, punctuation.
  • Character
  • Denary
  • Binary
  • Hex
  • A
  • 65
  • 01000001
  • 41
  • B
  • 66
  • 01000010
  • 42
  • a
  • 97
  • 01100001
  • 61
  • 0
  • 48
  • 00110000
  • 30
  • Space
  • 32
  • 00100000
  • 20

Key pattern: Uppercase letters start at 65; lowercase at 97. The difference is always 32 (bit 5). Digits start at 48.

Unicode

ASCII only covers English characters. Unicode is an international standard that assigns a unique code point to every character in every language — over 140,000 characters including emoji.

UTF-8 is the most common Unicode encoding. It uses 1 byte for ASCII characters and up to 4 bytes for others, making it efficient for English text while supporting all languages.

What is the ASCII code for the letter “A”?

  • 41
  • 65
  • 97
  • 64

Answer: 65
A = 65 in denary (41 in hex).

How many characters does standard ASCII represent?

  • 256
  • 128
  • 512
  • 64

Answer: 128
7 bits = 2⁷ = 128 characters.

Which encoding supports all world languages and is backward compatible with ASCII?

  • ASCII-256
  • UTF-8
  • EBCDIC
  • ISO-8859

Answer: UTF-8
UTF-8 is the dominant Unicode encoding and is backward compatible with ASCII.


Previous lesson: Two’s complement representation
Back to Cambridge IGCSE Computer Science (0478)
Next lesson: Representing images: pixels, resolution, colour depth