In the Number Systems chapter you saw that computers only store numbers. So how do they store the letter 'A', or a smiley, or Hindi text? The answer is encoding: every character is assigned a unique number, and that number is what's actually stored in binary. Different schemes do this for different sets of characters.
1ASCII — encoding English
ASCII (American Standard Code for Information Interchange) gives every English character a number from 0 to 127. Because 127 fits in 7 bits, classic ASCII is a 7-bit code with 128 possible characters — enough for the English letters, digits, punctuation and some control codes.
A few ASCII values are worth memorising, because the exam loves them and the letters run in sequence:
| Character(s) | ASCII value |
|---|---|
| 'A' to 'Z' | 65 to 90 |
| 'a' to 'z' | 97 to 122 |
| '0' to '9' | 48 to 57 |
| Space | 32 |
- ASCII gives each English character a number 0–127, stored in 7 bits (128 characters).
- Key values: A–Z = 65–90, a–z = 97–122, 0–9 = 48–57, space = 32.
- Lowercase is 32 more than uppercase; the character '0' (48) differs from the number 0.
2ISCII and Unicode — encoding every language
128 characters is fine for English, but the world has thousands of characters — Devanagari, Tamil, Chinese, emoji. Two schemes extended things:
- ISCII (Indian Script Code for Information Interchange) — an 8-bit code designed to represent Indian scripts (Devanagari, Bengali, Tamil and more) alongside ASCII. A made-in-India standard.
- Unicode — the global solution. It aims to give every character in every language a single unique number (called a code point), so text works the same everywhere. It includes ASCII as its first 128 characters, so ASCII text is automatically valid Unicode.
UTF-8, UTF-16, UTF-32
Unicode defines the numbers; UTF (Unicode Transformation Format) defines how those numbers are stored in bytes:
| Scheme | Uses |
|---|---|
| UTF-8 | 1 to 4 bytes per character — compact, the most common on the web (backward-compatible with ASCII). |
| UTF-16 | 2 or 4 bytes per character. |
| UTF-32 | A fixed 4 bytes per character — simple but uses the most space. |
- ISCII is an 8-bit Indian standard for representing Indian scripts.
- Unicode gives a unique code point to every character of every language; its first 128 match ASCII.
- UTF-8 (1–4 bytes, web standard), UTF-16 (2 or 4 bytes), UTF-32 (fixed 4 bytes) define how code points are stored.
★ Practical: encode by hand
Using the ASCII values from this chapter:
- Write the ASCII values for the characters in the word 'Cat'.
- If 'A' is 65, what is the ASCII value of 'a'? Explain the rule you used.
- What is the ASCII value of the character '5' (the digit)? How is it different from the number 5?
- In one sentence, explain why Unicode was needed when ASCII already existed.
Ready for the chapter test?
Answer 5 questions. Score 60% or more to mark this chapter complete.
Start the test →💡 Log in to save your progress and earn the certificate.