📄 Paper 1 · 1.1 Data Representation
1.1.4 Character Encoding (ASCII and Unicode)
Cambridge 9618 · International A Level Computer Science · ~12 min read
Notes
Video
Slides
Quiz
Worksheet

Character Encoding

Computers store all data as binary. To represent text, every character (letters, digits, punctuation, control characters) is assigned a unique binary code. The system defining this mapping is called a character encoding or character set.

ASCII (American Standard Code for Information Interchange)

Standard ASCII uses 7 bits per character, giving 2⁷ = 128 possible characters. These include:

  • Control characters (0–31): non-printable, e.g. null (0), carriage return (13), newline (10)
  • Printable characters (32–127): space, digits 0–9, uppercase A–Z, lowercase a–z, punctuation

Important ASCII values to know

CharacterDecimalBinary (7-bit)
'A'651000001
'a'971100001
'0'480110000
Space320100000

Note that uppercase letters (A=65) and lowercase letters (a=97) differ by 32 (or bit 5). Digits start at 48, so '0'=48, '1'=49, ..., '9'=57.

Extended ASCII

Extended ASCII uses 8 bits, giving 256 characters (0–255). The extra 128 codes (128–255) were used for national characters (e.g. accented letters like é, ñ), but different countries implemented different extensions — causing compatibility problems.

Unicode

ASCII was designed for English and cannot represent characters from most of the world's languages. Unicode is a universal character standard that assigns a unique code point to every character in every language, plus emoji, symbols, and technical characters.

PropertyASCIIUnicode
Bits per character7 (standard) / 8 (extended)Varies (8, 16, 32 depending on encoding)
Number of characters128 / 256Over 1,114,112 code points
Languages supportedEnglish only (standard)All world languages + emoji + symbols
Backward compatibleYes — first 128 Unicode code points match ASCII

Unicode Encodings

Unicode defines code points (U+0041 for 'A'), but the actual binary storage format is called an encoding:

  • UTF-8: Variable length (1–4 bytes). Compatible with ASCII for first 128 characters. Most common on the web.
  • UTF-16: Uses 2 or 4 bytes. Used internally by many operating systems (Windows, Java).
  • UTF-32: Fixed 4 bytes per character. Simple but uses more memory.

Advantages of Unicode over ASCII

  • Supports all world languages, scripts, and symbols in a single standard
  • Eliminates ambiguity caused by different ASCII extension tables
  • Backward compatible — existing ASCII documents work without changes
  • Supports emoji, mathematical symbols, ancient scripts

Disadvantage of Unicode

  • Uses more memory per character (especially UTF-16 and UTF-32) compared to ASCII
  • More complex to implement and process than fixed-length ASCII
Exam tip: Know the ASCII codes for 'A' (65), 'a' (97), '0' (48). Be able to state that ASCII uses 7 bits (128 characters) and Unicode supports all world languages. For Unicode questions: state that Unicode uses more bits per character, supports more characters, is backward compatible with ASCII. Cambridge often asks for advantages/disadvantages or comparisons between the two.
⚠️ Common Mistakes
  • Saying ASCII uses 8 bits — standard ASCII is 7 bits (extended ASCII is 8 bits)
  • Confusing character encoding with character set (they are related but not identical)
  • Forgetting that Unicode is backward compatible with ASCII
  • Not knowing that UTF-8 is variable length
  • Saying Unicode "replaces" ASCII — Unicode includes ASCII code points unchanged
✅ Notes completed!
Video coming soon
Click slide or press arrow keys to navigate

Worksheet — 1.1.4 Character Encoding

8 questions · instantly marked · Cambridge 9618 standard

Q1State the number of bits used in standard ASCII and calculate how many different characters it can represent.[2]
✅ Mark scheme
Mark scheme
7 bits [1]; 2⁷ = 128 characters [1].
Q2The ASCII code for 'A' is 65 (denary). What is the ASCII code for 'D'? Show your reasoning.[2]
✅ Mark scheme
Mark scheme
Letters are sequential: A=65, B=66, C=67, D=68 [1]; ASCII code for 'D' = 68 [1].
Q3Explain why ASCII cannot be used to represent text in Arabic, Chinese or other non-Latin scripts.[2]
✅ Mark scheme
Mark scheme
ASCII only defines 128 (or 256 in extended) characters [1]; not enough to represent the thousands of characters needed for Arabic, Chinese etc. — ASCII was designed for English/Latin script only [1].
Q4State two advantages of Unicode over ASCII.[2]
✅ Mark scheme
Mark scheme
Any two: Supports all world languages and scripts [1]; Supports over 1 million code points (far more than ASCII) [1]; Backward compatible with ASCII [1]; Eliminates ambiguity of different extended ASCII tables [1]; Supports emoji and symbols [1].
Q5State one disadvantage of Unicode compared to ASCII.[1]
✅ Mark scheme
Mark scheme
Any one: Uses more storage/memory per character [1]; More complex to process [1]; Variable-length encoding (UTF-8) can complicate string manipulation [1].
Q6Explain what is meant by 'backward compatible' in the context of Unicode and ASCII.[2]
✅ Mark scheme
Mark scheme
The first 128 Unicode code points are identical to the ASCII character set [1]; files and software using ASCII encoding can be interpreted correctly without modification when Unicode is used [1].
Q7UTF-8 is described as a variable-length encoding. What does this mean, and why is it useful?[3]
✅ Mark scheme
Mark scheme
Variable length means different characters use different numbers of bytes (1–4 bytes) [1]; common characters (ASCII range) use only 1 byte [1]; this makes storage efficient — documents using mainly Latin script are no larger than equivalent ASCII files [1].
Q8A student claims that ASCII is always preferable to Unicode because it uses less memory. Evaluate this claim.[3]
✅ Mark scheme
Mark scheme
Partially correct — ASCII uses only 7/8 bits per character vs UTF-16/UTF-32 which use more [1]; however, UTF-8 uses just 1 byte for ASCII-range characters, matching ASCII storage use [1]; ASCII cannot represent non-Latin scripts at all, making it unsuitable for global use — Unicode is necessary for any multilingual application [1].
Topic Quiz
Question 1 of 15
You scored
out of 15
Card 1 of 10
Click to reveal definition
🎉
All cards reviewed!
TermDefinition
🎯

Mini Test — 1.1.4 Character Encoding

10 questions · 10 marks · 10 minutes

← 1.1.3 Floating-Point
4 of 82 · Cambridge 9618
1.1.5 Image Representation →