Long strings of 0s and 1s are hard for people to read and easy to copy wrongly. Hexadecimal writes the same binary four bits at a time, so a 16-bit value becomes just four characters.
Hexadecimal is base 16. It uses the digits 0 to 9 and the letters A to F for 10 to 15. One hex digit stands for exactly 4 bits (a nibble), so binary converts to hex by splitting it into groups of 4 from the right. Hex is used because it is shorter and easier for humans to read and write than binary, with fewer mistakes, yet converts to binary simply. The computer itself still stores binary.
Fig. 1: each group of four bits becomes one hexadecimal digit
Section 01
Sixteen digits.
In the lab, flip the bits and watch each group of four turn into a single hex digit. Click a hex digit to count it up from 0 to F.
Denary
0 to 9
10
11
12
13
14
15
Hex
0 to 9
A
B
C
D
E
F
Binary
0000 to 1001
1010
1011
1100
1101
1110
1111
Place values: in hex they are 1, 16, 256, 4096 ... (each is 16 times the one to its right).
Examiner trap
Do not write 12 as the hex digit for twelve. Each place holds a single character, so twelve is C; 12 in hex means 1 × 16 + 2 = 18.
Section 02
Converting with nibbles.
Binary and hex convert directly, four bits at a time. To or from denary, go through binary or use the hex place values.
Worked example Binary to hex
Convert 1101 0111 1010 to hexadecimal.
Split into nibbles from the right: 1101, 0111, 1010.
1101 = 13 = D; 0111 = 7; 1010 = 10 = A.
Answer: D7A
Worked example Hex to denary
Convert 2F to denary.
Place values: 16 and 1.
2 × 16 = 32 and F = 15, so 15 × 1 = 15.
32 + 15 = 47.
Answer: 47
Worked example Denary to hex
Convert 200 to hexadecimal.
200 in binary is 1100 1000.
1100 = 12 = C; 1000 = 8.
Answer: C8
Your turn
Convert the hex number 3E to binary and to denary.
3 = 0011, E = 1110, so 0011 1110; 3 × 16 + 14 = 62
Stage 1 · Learn
Check what the sim just showed you
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Quick check+10 XP
Which hex digit stands for the denary value 11?
Quick check+10 XP
How many bits does one hexadecimal digit represent?
Quick check+10 XP
In the lab's colour mode, what colour is #00FF00?
Quick check+10 XP
What is 1111 0000 in hexadecimal?
Section 03
Where hex is used.
The lab's colour code mode builds an HTML colour from three bytes, and its last mode lists other places hex appears.
HTML colour codes: #FF8C00 is 3 bytes: red FF (255), green 8C (140), blue 00 (0).
MAC addresses: 48 bits written as 12 hex digits, e.g. 00-1A-2B-3C-4D-5E.
Error codes and memory dumps: technicians and programmers read stored values in hex.
IPv6 addresses: 128 bits written as 8 groups of 4 hex digits.
Examiner trap
Say that hex is easier for humans. Computers do not store or process hex: they convert it to binary.
Stage 2 · Exam
Exam-style questions
Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.
Finish the four checks above to unlock the exam questions
Exam style+20 XP
Convert the hexadecimal number 9C to denary.
Exam style+20 XP
Why is hexadecimal used for MAC addresses?
Exam style+20 XP
What is the denary value 255 in hexadecimal?
Exam style+20 XP
A 16-bit binary number is written in hex. How many hex digits are needed?
Skill unlocked
Hexadecimal, mastered.
This skill is now recorded on your profile. Keep the chain going.