UpperGrades
GCSE Computer Science/Data Representation/Character Encoding (3.3.5)

Character Encoding: ASCII & Unicode

Understand how computers represent human text using binary numbers. Inspect 7-bit ASCII codes, master the Bit-5 case flip trick, calculate sequential letter offsets without memorising the chart, and see why Unicode was created to represent global writing systems and emojis.

AQA 8525 Spec 3.3.5•Data Representation

Character Encoding: ASCII & Unicode

Explore 7-bit ASCII, 8-bit bytes, the Bit-5 case flip, sequential offsets, and global Unicode.

Encoding Direction:
Click a character to inspect its bit pattern:
Selected Character
U
Category: uppercase
✓ Standard 7-bit ASCII & Unicode match
8-Bit Register & Place Values (Powers of 2)
128
0
b7
64
1
b6
32
0
Bit 5 (Case)
16
1
b4
8
0
b3
4
1
b2
2
0
b1
1
1
b0
Place Value Addition: 64 + 16 + 4 + 1 = 85
Denary Code
85
7-Bit ASCII
1010101
8-Bit Padded
01010101
Hexadecimal
0x55
Total Text File Size Formula (AQA Spec 3.3.5)Total: 11 characters (11 ASCII)
7-Bit Standard ASCII
77 bits
11 chars × 7 bits
8-Bit Extended ASCII
11 bytes
88 bits (11 chars × 1 byte)
16-Bit Unicode (UTF-16)
22 bytes
176 bits (11 chars × 2 bytes)
32-Bit Fixed (UTF-32)
44 bytes
352 bits (11 chars × 4 bytes)
Aligned to AQA GCSE Computer Science (8525) Spec 3.3.5.

1. What is a Character Set?

Computers are electronic devices consisting of billions of transistors that can only store and process electrical states: binary 0s and 1s. Computers cannot naturally understand letters, punctuation, or spaces.

Definition (AQA 8525):

A character set is an agreed list of all the characters (letters, numbers, symbols, spaces, and control signals) that a computer system can recognise, along with the unique binary integer code assigned to each character.

7-Bit Standard ASCII

Created in 1963, ASCII (American Standard Code for Information Interchange) uses 7 bits per character.

  • • Capacity: 2⁷ = 128 unique codes (0 to 127).
  • • Codes 0–31 & 127: Non-printing control codes (Line Feed, Carriage Return, Tab).
  • • Code 32: Space (␣).
  • • Codes 33–126: Printable characters (A-Z, a-z, 0-9, punctuation).

Universal Unicode

Because 7-bit ASCII was limited to the English alphabet, Unicode was created to support every written language on Earth:

  • • Capacity: 1,114,112 code points (U+0000 to U+10FFFF).
  • • Covers Arabic, Greek, Cyrillic, Kanji, Devanagari, emojis, and math symbols.
  • • 100% Backward Compatible: The first 128 codes (0–127) are identical to 7-bit ASCII!

2. Sequential Ordering & Calculating Codes

You do not need to memorise the full ASCII chart for the exam. The AQA specification explicitly requires students to know that character codes run in consecutive sequence.

Uppercase Letters
‘A’ = 65 to ‘Z’ = 90

Running continuously across 26 letters. ‘B’ is 66, ‘C’ is 67, etc.

Lowercase Letters
‘a’ = 97 to ‘z’ = 122

Running continuously across 26 letters. ‘b’ is 98, ‘c’ is 99, etc.

Digit Glyphs
‘0’ = 48 to ‘9’ = 57

Running continuously across 10 digits. ‘1’ is 49, ‘2’ is 50, etc.

AQA Model Exam Question

“In the 7-bit ASCII chart, the character code for ‘A’ is 65 (1000001). Calculate the 7-bit binary code for the character ‘D’. [2 marks]”

Step 1: Calculate alphabet offset: ‘D’ is the 4th letter. Since ‘A’ is the 1st letter, offset = 4 - 1 = +3.

Step 2: Add to base denary code: 65 + 3 = 68. (Award 1 mark).

Step 3: Convert 68 to 7-bit binary: 64 + 4 = 1000100. (Award 1 mark).

3. The Bit-5 Case Switch (+32 / -32)

Notice the mathematical difference between uppercase and lowercase letters:

‘a’ (97) - ‘A’ (65) = 32

‘b’ (98) - ‘B’ (66) = 32

Because 32 is exactly 2⁵ (Bit 5 in binary), lowercase letters have the exact same bit pattern as uppercase letters, except that Bit 5 is set to 1:

LetterDenaryBit 7 (128)Bit 6 (64)Bit 5 (32) [CASE]Bit 4 (16)Bit 3 (8)Bit 2 (4)Bit 1 (2)Bit 0 (1)
‘A’ (upper)6501000001
‘a’ (lower)9701100001

4. Text File Size Calculations

Calculating the storage requirement of text is an essential skill across both Paper 1 and Paper 2:

File Size (bits) = Number of Characters × Bits per Character

To convert bits to bytes, divide by 8. Remember: spaces, digits, and punctuation marks count as full individual characters!

Worked Example: Calculating Storage

“A text message reads: “Pass AQA 2026!”. Calculate the file size in bits using 7-bit ASCII, and in bytes using 8-bit ASCII.”

  1. 1. Count characters: ‘P’‘a’‘s’‘s’ (4) + space (1) + ‘A’‘Q’‘A’ (3) + space (1) + ‘2’‘0’‘2’‘6’ (4) + ‘!’ (1) = 14 characters.
  2. 2. 7-bit ASCII size = 14 × 7 = 98 bits.
  3. 3. 8-bit ASCII size = 14 × 8 = 112 bits = 14 bytes (since each char is 1 byte).

5. Five Mistakes That Cost Marks in AQA Exams

Mistake 1: Confusing Character ‘0’-‘9’ with Integer Values

When asked for the character code for ‘5’, many students write binary 00000101 (denary 5). This is wrong! In ASCII, the character glyph ‘0’ starts at code 48. So character ‘5’ is 48 + 5 = 53 (00110101).

Mistake 2: The Off-By-One Offset Slip

If ‘A’ is 65, finding the 4th letter ‘D’ requires adding 3 (offset = position - 1 = 4 - 1 = 3), giving 68. Students who add 4 arrive at 69 (‘E’) and lose the mark.

Mistake 3: Forgetting Spaces in Storage Counts

In text file size calculations, students frequently only count letters. Spaces (ASCII 32) and punctuation marks each require a full character code and must be included in the total character count.

Mistake 4: Claiming Unicode “Compresses” or “Speeds Up” Data

Unicode does not compress data or make text faster to send. Its advantage is that it can represent far more characters: other alphabets and languages, plus special and mathematical symbols.

Mistake 5: Saying ASCII is an 8-Bit Code

Standard ASCII is strictly a 7-bit code with 128 characters. While it is commonly stored inside an 8-bit byte (with a leading zero), the ASCII specification itself is 7 bits.

Complete Your GCSE Data Representation Revision

Now that you’ve mastered Character Encoding, practice Binary Addition, Sound Wave Sampling, and Bitmap Images.