🔢 Chapter 1 · Topic 7 · Paper 1 & 2

Hexadecimal

Base-16 — the shorthand that every programmer, designer, and network engineer uses daily

🔥 01 · Did You Know?

The colour of every pixel on your screen right now is stored as a hex code. The deep black background of this page is #080808. The gold you see in every heading is #C9973A. Every website, every graphic, every game texture uses hex colour codes because they are compact, precise, and human-readable. When security researchers analyse malware, they read hex dumps of memory. When network engineers configure devices, they read MAC addresses like A4:83:E7:2B:1C:FF. When a Windows machine crashes with the Blue Screen of Death, the error code is written in hex — 0x0000007E. Hexadecimal is the everyday language of every computing professional. Today you learn exactly why it exists and exactly how it works.

What is Hexadecimal?

Hexadecimal is a base-16 number system. It uses 16 different digits — the familiar 0–9, plus the letters A through F to represent values 10–15. A single hex digit can represent any value from 0 to 15.

💡 Why 16? Because 16 = 2⁴ — each hex digit maps exactly to a group of 4 binary bits (called a nibble). Two hex digits = one byte. This makes hex a perfect shorthand for binary.

All 16 Hex Digits

0
= 0
0000
1
= 1
0001
2
= 2
0010
3
= 3
0011
4
= 4
0100
5
= 5
0101
6
= 6
0110
7
= 7
0111
8
= 8
1000
9
= 9
1001
A
= 10
1010
B
= 11
1011
C
= 12
1100
D
= 13
1101
E
= 14
1110
F
= 15
1111

The Nibble — One Hex Digit = Four Binary Bits

This is the key insight: because 16 = 2⁴, any 4-bit pattern maps to exactly one hex digit. No overlaps, no gaps.

Hex A = 10 in denary
A
1
0
1
0
= 8+2 = 10 ✓
Hex F = 15 in denary
F
1
1
1
1
= 8+4+2+1 = 15 ✓
Two hex digits = 1 byte
3F
0
0
1
1
 
1
1
1
1
3=0011 · F=1111 → 00111111 = 63
Max 2-digit hex value
FF
1
1
1
1
 
1
1
1
1
F=1111 · F=1111 → 11111111 = 255

Why Do We Use Hexadecimal?

Binary is what computers use internally. Denary is what humans understand. Hex sits perfectly in the middle:

1

Compact: A full byte (8 bits) is just 2 hex digits. The same byte in binary is 8 digits. Hex is 4× shorter.

2

Easy to convert: Converting between binary and hex is trivial — just split into nibbles of 4. No division needed.

3

Human-readable: Memory addresses, colour codes, and error codes are far easier to read and type in hex than in binary.

Hex in the Real World

🎨
Web Colours
#FF5733
RGB values 0–255 each written as 2 hex digits. 6 hex digits = full colour.
🌐
MAC Addresses
A4:83:E7:2B:1C:FF
6 pairs of hex digits identify every network device uniquely.
💾
Memory Addresses
0x1A3F2C00
RAM locations written in hex. The 0x prefix means "hexadecimal".
🔵
Error Codes
0x0000007E
Windows BSOD codes, USB device IDs, and CPU flags all use hex.

Hex Place Values

Just as denary uses powers of 10 and binary uses powers of 2, hex uses powers of 16:

Position: 16³ 16² 16¹ 16⁰ Value: 4096 256 16 1 Example: 1 × A(10) × 3 × F(15) = 4096 + 2560 + 48 + 15 = 6719

⚠️ Common Exam Mistakes

Forgetting that A–F represent values 10–15 — treating A as 1 or 10 as two separate digits. In hex, A is a single digit with the value 10.

Converting denary to hex digit-by-digit — you cannot convert each denary digit separately. 25 in hex is 19, not 25.

Mixing up nibble order — when converting a byte to hex, the left nibble (bits 7–4) is the first hex digit, and the right nibble (bits 3–0) is the second.

🏆
Cambridge Exam Tip: The hex digit table (0–F with binary equivalents) is worth memorising completely — it appears in hex↔binary and hex↔denary questions on almost every Paper 1. The letters A–F are case-insensitive in answers, but write them consistently. Hex values may appear with a 0x prefix or a # prefix — both mean hexadecimal.
Hex Explorer
// Build a 2-digit hex value · See binary nibbles & denary live · Understand every conversion step
Quick loads:
FF
A5
1E
C9
3F
80
B4
0A
High nibble (×16)
0
Low nibble (×1)
0
← click a digit below, then select which position
Setting:
Choose a hex digit:
Hex value
00
(prefix: 0x00)
Binary
0
0
0
0
·
0
0
0
0
Denary
0
Enter a hex value above to see the place value calculation.

Converting 0xB7 to Denary and Binary

A two-part question — exactly as Cambridge sets them. Work through each step first.

📋 Question: The hexadecimal number B7 is used in a memory address. (a) Convert B7 to denary. (b) Convert B7 to 8-bit binary. Show all working. [4]
1
📊 Identify each hex digit
What are the denary values of B and 7 individually?
▶ Click to reveal
B = 11 (in denary) 7 = 7 (in denary) B is in the 16s column (high nibble) 7 is in the 1s column (low nibble)
2
➕ Convert to denary using place values
Apply the hex place value formula. What is (B × 16) + (7 × 1)?
▶ Click to reveal
B7 in denary: = (B × 16) + (7 × 1) = (11 × 16) + (7 × 1) = 176 + 7 = 183 ✓
3
🔢 Convert to binary using nibbles
Convert each hex digit independently to its 4-bit nibble. What are the nibbles for B and 7?
▶ Click to reveal
B = 11 in denary = 1011 in binary (8+2+1) 7 = 7 in denary = 0111 in binary (4+2+1) Join the nibbles: B 7 1011 0111 B7 in 8-bit binary = 10110111 ✓
4
✅ Verify both answers
Do the denary and binary answers agree with each other?
▶ Click to reveal
Denary answer: 183 Binary answer: 10110111 Cross-check: 10110111 in denary = 128+32+16+4+2+1 = 183 ✓ Both methods agree — B7 = 183 = 10110111 [4 marks: digit identification ✓ | denary calc ✓ | nibble method ✓ | binary result ✓]

Cambridge-Style Practice

Show digit-by-digit working in every conversion question.

Question 1
2 marks
Convert the hexadecimal number 4E to denary. Show your working.
Working: (4 × 16) + (14 × 1) = 64 + 14 (E must be identified as 14)[1]
Denary value = 78[1]
Question 2
2 marks
Convert the hexadecimal number 9C to 8-bit binary using the nibble method. Show each nibble separately.
9 = 1001 and C = 12 = 1100[1]
Full 8-bit binary: 10011100 (= 156 in denary)[1]
Question 3
2 marks
State two reasons why hexadecimal is used by programmers and system developers instead of binary.
Hex is more compact / shorter than binary — a byte is 2 hex digits vs 8 binary digits, making it easier to read and write[1]
Hex is easy to convert to/from binary — each hex digit corresponds exactly to a 4-bit nibble, so no complex calculation is needed (accept: easy to understand for humans / reduces errors in reading memory addresses)[1]
Question 4
1 mark
A web page uses the colour code #FF8C00. How many bytes of data are used to store this colour?
3 bytes — FF is one byte (red), 8C is one byte (green), 00 is one byte (blue). Each pair of hex digits = 1 byte.[1]

5-Question Challenge

Hex digits, nibbles, conversions, and real-world uses. Complete all 5 to save your progress!

Score:
0 / 5
🟢
Topic 7 Complete — Hex Explorer Certified!
+50 XP · Chapter 1 · Data Representation
🏆
Lesson Complete! Score: · Saved ✅
Next Lesson →