kasim-lone.dev — data-representation / hexadecimal
← All topics

GCSE · Data Representation

Topic 3
Hexadecimal

Scroll to begin ↓

By the end you'll be able to…

  • Explain what hexadecimal is and why it's used.
  • Convert between denary and hexadecimal (both directions).
  • Convert between binary and hexadecimal using nibbles.
  • Recognise hex in real life — MAC addresses and colour codes.

Hexadecimal — Base-16

Hexadecimal is a number system with 16 digits. Since we only have 10 numerical digits (0–9), the letters A–F are used to represent 10–15.

Denary0123456789101112131415
Hex0123456789ABCDEF

Each column's place value is a power of 16. At GCSE you'll work with up to 2 hex digits:

16s (161)1s (160)= Denary
13(1 × 16) + (3 × 1) = 19
💡 One hex digit = one nibble

A single hex digit represents exactly 4 bits (one nibble). Two hex digits represent 8 bits (one byte). This is the trick that makes binary ↔ hex conversion easy.

Flip cards — quick recall

Why do we use hexadecimal?

Computers store and process everything in binary — but binary is painful for humans to read and copy.

Hex is a much more compact way to write down the same information:

  • Binary numbers are long and hard to read — one wrong 1 or 0 among 32 of them is easy to miss.
  • Hex uses fewer digits to represent the same value. 8 bits become 2 hex digits.
  • Because one hex digit maps exactly to one nibble, converting binary ↔ hex is fast.

Where you'll see hex in real life

  • MAC addresses — the unique address of a network device, e.g. 2C-F0-7C-A7-98
  • Colour codes — every colour on a web page is a hex code like #FF3366
  • Memory addresses and error codes in operating systems.

Converting denary to hexadecimal

Method 1 — via binary (recommended)

Because 1 hex digit = 4 bits, you can go denary → binary → hex:

  1. Convert the denary number to 8-bit binary.
  2. Split into two nibbles (4 bits each).
  3. Convert each nibble to its denary value (0–15).
  4. Use the hex table to write A–F for values 10–15.
✏️ Example — convert denary 28

28 in binary = 00011100. Split into nibbles: 0001 | 1100.

0001 = 1 → hex digit 1. 1100 = 12 → hex digit C.

28 = 1C in hex ✅

Method 2 — divide by 16

Divide the denary number by 16. The whole number is the first hex digit, the remainder is the second.

✏️ Example — convert denary 163

163 ÷ 16 = 10 remainder 3. So digit 1 = 10 (A), digit 2 = 3.

163 = A3 in hex ✅

💡 Non-calculator paper

The exam is non-calculator. If dividing by 16 in your head is hard, use Method 1 — most students find it more reliable.

Converting hexadecimal to denary

Method 1 — via binary

Reverse of before: convert each hex digit to a 4-bit binary nibble, join them, then convert the 8-bit number to denary.

✏️ Example — convert B9 to denary

B = 11 = 1011. 9 = 1001. Joined: 10111001.

Read the place values: 128 + 32 + 16 + 8 + 1 = 185 ✅

Method 2 — multiply by 16

Multiply the first digit by 16, then add the second digit.

✏️ Example — convert 79 to denary

7 × 16 = 112. Add 9: 112 + 9 = 121 ✅

🖱️ Try it — hex → denary + binary

Converting binary ↔ hexadecimal directly

Because 1 hex digit = 4 bits, direct conversion is quick.

Binary → Hex

  1. Split the 8-bit binary into two nibbles.
  2. Convert each nibble to its denary value (0–15).
  3. Write the hex digit (A–F for 10–15).
✏️ Example — 10110111 → hex

Split: 1011 | 0111.

1011 = 8 + 2 + 1 = 11 = B. 0111 = 4 + 2 + 1 = 7.

10110111 = B7 in hex ✅

Hex → Binary

  1. Split the two hex digits.
  2. Convert each to a 4-bit binary nibble.
  3. Join the nibbles to make an 8-bit binary number.
✏️ Example — 5F → binary

5 = 0101. F = 15 = 1111.

5F = 01011111 in binary ✅

DenaryBinaryHex
000000
100011
200102
300113
401004
501015
601106
701117
810008
910019
101010A
111011B
121100C
131101D
141110E
151111F
💡 Exam start-up

The most common mistake is muddling A–F with 10–15. Write the 16-row table out first thing in the exam and you'll never mix them up.

Hex in the wild — colour codes

Every colour on a web page can be written as a 6-digit hex code: two digits each for red, green and blue (0–255 per channel).

#82AAFF

Try changing the values above. Every colour on this page uses a hex code just like this one.

Exam-style practice

Q1. Convert denary 90 to hexadecimal.

Q2. Convert hex 2D to denary.

Q3. Convert binary 11101010 to hex.

Q4. Give two reasons why programmers prefer hex over binary.

// end of topic 3 — hexadecimal