📁 Paper 1 · Topic 1: Data Representation
1.2a Text Representation — ASCII & Unicode
Cambridge IGCSE Computer Science 0478 · ~11 min read · ⭐ Pro

Why Text Needs to Be Represented in Binary

Computers can only store binary data. To store text (characters, digits, symbols), each character must be assigned a unique binary number. A character set is a defined list of characters and their corresponding binary codes.

ASCII

ASCII (American Standard Code for Information Interchange) is a 7-bit character set, representing 128 characters (2⁷ = 128). An extended version uses 8 bits for 256 characters.

  • Uppercase letters: A = 65, B = 66 ... Z = 90
  • Lowercase letters: a = 97, b = 98 ... z = 122
  • Digits: 0 = 48, 1 = 49 ... 9 = 57
  • Also includes punctuation and control characters (e.g. newline, tab)
CharacterDenary codeBinary (7-bit)
A651000001
a971100001
0480110000

Key patterns: Uppercase letters and their lowercase equivalents differ by 32 (bit 5 changes). Digit characters and their numeric values differ by 48.

Unicode

Unicode is a larger character set designed to represent characters from all the world's writing systems. It includes ASCII as its first 128 characters.

  • UTF-8: variable width, 1–4 bytes per character; backwards compatible with ASCII
  • UTF-16: 2 or 4 bytes per character; more efficient for many non-Latin scripts
  • UTF-32: fixed 4 bytes per character; simple but uses more storage
  • Unicode can represent over 1 million characters (emojis, Chinese, Arabic, etc.)

ASCII vs Unicode

FeatureASCIIUnicode
Bits per character7 (or 8 extended)8–32 bits (varies)
Number of characters128 (or 256)Over 1 million
Languages supportedEnglish onlyAll writing systems
File sizeSmallerCan be larger
CompatibilityWidely compatibleUTF-8 backwards-compatible with ASCII

File Size Calculation

File size = number of characters × bits per character

Example: A 500-character text file using ASCII (7 bits): 500 × 7 = 3500 bits = 437.5 bytes ≈ 438 bytes

Exam tip: Cambridge often asks you to compare ASCII and Unicode, or to calculate the file size of a text file. Remember: each character is stored as one code value, and file size = characters × bits per character.
⚠️ Common Mistakes
  • Confusing the character '0' (ASCII 48) with the number 0 — they are different
  • Saying Unicode uses 16 bits — it varies (UTF-8 can be 8, 16, 24 or 32 bits)
  • Forgetting that ASCII only covers English characters; Unicode covers all languages
Video coming soon
Click slide or press arrow keys to navigate
✍️

Worksheet — Text Representation

5 questions · 8 marks

Q1State the ASCII code (denary) for the character 'D', given that 'A' = 65.[1]
✅ Mark scheme
68 [1] (A=65, B=66, C=67, D=68)
Q2Explain what is meant by a character set.[2]
✅ Mark scheme
A character set is a defined list of characters [1]; each character is assigned a unique binary/numeric code [1]
Q3Give two advantages of Unicode over ASCII.[2]
✅ Mark scheme
Any 2 of: supports more languages/scripts [1]; can represent over 1 million characters including emojis and symbols [1]; backwards compatible with ASCII (UTF-8) [1]
Q4Calculate the file size in bits of a text file containing 1200 characters stored using Unicode UTF-16 (16 bits per character).[2]
✅ Mark scheme
1200 × 16 [1] = 19 200 bits [1]
Q5State one disadvantage of using Unicode instead of ASCII.[1]
✅ Mark scheme
Unicode files take up more storage space than ASCII files [1] (because more bits are used per character)
Quiz — Text Representation
Q 1 of 8
Score
out of 8
Click to reveal
TermDefinition
🎯

Mini Test — Text Representation

10 minutes · exam conditions

  • 5 MCQ + 2 short answer · 9 marks
← 1.1c Binary Arithmetic Topic 1: Data Representation Next: 1.2b Images →
🔒
Pro Content
Subscribe to access all lessons.
£7.99/month
or £59/year
Subscribe now →