🔢 Chapter 1 · Topic 9 · Paper 1 & 2

Hex ↔ Binary Conversion

The fastest conversion in computing — no arithmetic needed, just nibble by nibble

🔥 01 · Did You Know?

Of all the number system conversions you'll learn, hex ↔ binary is by far the fastest — and the one professionals use most. When a security researcher opens a hex dump of a suspicious file, they can mentally convert every two-character hex code to its 8-bit binary pattern in under a second. No calculator, no division. It's pure pattern recognition. The reason this works so cleanly is mathematical elegance: 16 = 2⁴, so each hex digit maps to exactly 4 binary bits, no more, no less, with perfect boundaries. Assembly language programmers, embedded systems engineers, and cryptographers use this relationship dozens of times per day. In your Cambridge exam, this conversion can be done faster and more reliably than any other — if you know the 16 nibble patterns cold.

The Nibble Bridge — No Arithmetic Required

Because 16 = 2⁴, one hex digit always equals exactly 4 binary bits. This means hex ↔ binary conversion requires no division, no multiplication — just a direct digit-to-nibble lookup. Every hex digit has one and only one 4-bit equivalent.

⚡ The golden rule: split at nibble boundaries. One hex digit = one nibble (4 bits). Two hex digits = one byte (8 bits). Convert each digit independently — then join.
Each hex digit ↔ its 4-bit nibble — shown for A and E:
A
1
0
1
0
   (A=10 = 8+2)
E
1
1
1
0
   (E=14 = 8+4+2)
A
E
1
0
1
0
1
1
1
0
   AE = 10101110
🔡 → 🔢
Hex → Binary
Each hex digit → 4-bit nibble
Look up (or calculate) the 4-bit binary value for each hex digit. Write the nibbles side by side. No padding needed — each digit is always exactly 4 bits.
🔢 → 🔡
Binary → Hex
Every 4 bits → 1 hex digit
Group bits into nibbles of 4, starting from the right. If bits don't divide evenly, pad with leading zeros on the left. Convert each group to its hex digit.

Hex → Binary: Step by Step

1

Take each hex digit one at a time, left to right.

2

Convert each digit to its 4-bit binary equivalent. Always use exactly 4 bits — pad with leading zeros if needed (e.g. hex 3 → 0011, not 11).

3

Write the nibbles side by side in order. The result is the full binary number.

Binary → Hex: Step by Step

1

If the number of bits is not a multiple of 4, pad with leading zeros on the left until it is.

2

Split the bits into groups of 4, from the right. Each group is one nibble.

3

Convert each 4-bit group to its hex digit. Write the digits in order from left to right.

⚠️ Common Exam Mistakes

Not padding nibbles to exactly 4 bits — hex digit 3 must become 0011, not 11. Missing the leading zeros shifts all the bits and produces the wrong answer.

Grouping bits from the left instead of the right — when converting binary to hex, always group from the right. If you have 6 bits like 101011, group as (00)10 · 1011, not 1010 · 11.

Mixing up the nibble order — the leftmost hex digit always represents the leftmost nibble (most significant bits). Don't reverse them.

🏆
Cambridge Exam Tip: In hex↔binary questions, always show your nibble groupings explicitly — draw a bracket or line separating each group of 4. This earns the method mark even if you misread one nibble. These questions are typically 2 marks: [1] correct method shown, [1] correct result.
Nibble Converter — Hex ↔ Binary
// Switch between directions · See every nibble animate into place · Purple = high nibble · Teal = low nibble
Quick examples:
AE
3F
C9
B7
FF
1A
0D
80
Select which digit to set, then click the keypad:
High digit
0
Low digit
0
← click to select which digit the keypad controls
⚠ Select a value for both digits first.
Each hex digit expands to its 4-bit nibble:
8-bit binary result:

Two Directions — One Exam Question

Cambridge often tests both directions in a single question. Work each part before revealing.

📋 Question: (a) Convert hex D4 to 8-bit binary. (b) Convert binary 01100111 to hex. Show all working. [4]
1
Part (a) — D4 to binary
What are the 4-bit equivalents of D and 4 individually?
▶ Click to reveal
D = 13 in denary = 1101 in binary (8+4+1) 4 = 4 in denary = 0100 in binary (4) Note: 4 must be written as 0100 — four bits. Writing just 100 would be wrong.
2
Part (a) — Assemble the byte
Join the two nibbles. What is the final 8-bit binary result?
▶ Click to reveal
D 4 1101 0100 ↓ join nibbles 11010100 D4 in binary = 11010100 ✓ Verify: 128+64+16+4 = 212. D4 = (13×16)+4 = 208+4 = 212 ✓
3
Part (b) — 01100111 to hex
Group 01100111 into two nibbles of 4. Which groups do you get?
▶ Click to reveal
01100111 Split from right into groups of 4: 0110 | 0111 High nibble: 0110 = 6 (4+2) Low nibble: 0111 = 7 (4+2+1)
4
Part (b) — Write the hex result
What is the final hex answer, and how do you verify both parts?
▶ Click to reveal
0110 = 6 → hex digit 6 0111 = 7 → hex digit 7 01100111 in hex = 67 Verify: (6×16)+7 = 96+7 = 103 Binary check: 64+32+4+2+1 = 103 ✓ [4 marks: D nibble ✓ | 4 nibble ✓ | 0110→6 ✓ | 0111→7 / 67 ✓]

Cambridge-Style Practice

Show each nibble separately — never jump straight to the answer without grouping.

Question 1
2 marks
Convert the hexadecimal number 7B to 8-bit binary. Show each nibble separately.
7 = 0111 and B = 11 = 1011 shown separately[1]
Full 8-bit result: 01111011 (= 123 in denary)[1]
Question 2
2 marks
Convert the binary number 11110010 to hexadecimal. Show your nibble groupings.
High nibble: 1111 = 15 = F. Low nibble: 0010 = 2 = 2. Groupings shown.[1]
Hex result: F2 (verify: 15×16+2=240+2=242 ✓)[1]
Question 3
2 marks
A student converts the binary number 101011 (6 bits) to hex and gets the answer AB. State the correct answer and explain the error made.
Correct: pad to 8 bits → 00101011. Split: 0010|1011 = 2 and B → 2B (= 43 in denary)[1]
The student grouped from the left without padding, getting 1010|11 — treating the unequal right group (11=3 bits) as if it were a full nibble. They should have padded with leading zeros first.[1]
Question 4
1 mark
State why hexadecimal can be converted to binary (and back) without any arithmetic, unlike converting between denary and binary.
Because 16 = 2⁴ — each hex digit corresponds exactly to 4 binary bits (one nibble). There are no remainders or quotients to calculate; it is a direct one-to-one substitution between digit and 4-bit pattern.[1]

5-Question Challenge

Nibble conversions, grouping errors, and the maths behind the method. Complete all 5 to save progress!

Score:
0 / 5
🔀
Topic 9 Complete — Hex ↔ Binary Fluency Unlocked!
+50 XP · Chapter 1 · Data Representation
🏆
Lesson Complete! Score: · Saved ✅
Next Lesson →