Open the app
  1. Home
  2. Lessons
  3. GCSE & IGCSE Computer Science
  4. Hexadecimal

Hexadecimal

🎬 The doodle video for this lesson is coming soon. Subscribe on YouTube to see it first.

Hexadecimal is a shorthand for binary that is much easier for humans to read and write.

Base 16

Hex uses 16 digits: 0 to 9, then A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
One hex digit represents exactly 4 bits (a nibble).

Hex to denary

The left digit is worth 16s, the right digit is worth 1s.
B4 = (11 × 16) + 4 = 176 + 4 = 180
FF = (15 × 16) + 15 = 255

Hex and binary

Split binary into nibbles and convert each one.
1011 0100 → 1011 = B, 0100 = 4 → B4
Hex is used for colour codes and memory addresses because it is shorter and less error-prone than binary.
Worked example

Convert 2A from hex to denary.

  1. 2 is in the 16s column: 2 × 16 = 32.
  2. A = 10 is in the 1s column.
  3. 32 + 10 = 42

Answer: 42

Key idea

Hex digits 0 to F, where A is 10 and F is 15. Left digit × 16 plus right digit. Each hex digit is one nibble of binary.

Check you have got it

Answer 6 quick questions with instant marking. If you get one wrong, GCSE-ready shows you why and gives you another go. It is free, and you do not need an account.