0x Component 1 · 1.2 Data Representation
1.2.4d Hexadecimal
OCR J277 · GCSE Computer Science · ~11 min read
Notes
──
Video
──
Slides
──
Worksheet
──
Quiz

What is Hexadecimal?

Hexadecimal (hex) is a base-16 number system. It uses 16 different digits: 0–9, then the letters A–F to represent values 10–15. One hex digit represents exactly 4 bits (one nibble), so two hex digits represent one byte (8 bits).

DenaryBinary (4-bit)HexDenaryBinary (4-bit)Hex
000000810008
100011910019
200102101010A
300113111011B
401004121100C
501015131101D
601106141110E
701117151111F

Why is Hexadecimal Used?

Long binary strings are hard for humans to read and prone to error. Hex provides a compact, human-readable representation of binary. Key uses include:

  • Memory addresses — e.g. 0x7FFE4C2A
  • Colour codes in web/CSS — e.g. #FF5733 (R=FF, G=57, B=33)
  • Error codes and debugging — e.g. Windows BSoD codes like 0x0000007B
  • MAC addresses — e.g. A4:C3:F0:85:2B:E5
  • Assembly/machine code — instructions written in hex

Binary to Hexadecimal

Method: Split the 8-bit binary number into two 4-bit nibbles. Convert each nibble independently to a hex digit using the table above.

Example: Convert 10110101 to hex

  • Split: 1011 | 0101
  • 1011 = 11 = B
  • 0101 = 5
  • Result: B5

Example: Convert 11001110 to hex

  • Split: 1100 | 1110
  • 1100 = 12 = C
  • 1110 = 14 = E
  • Result: CE

Hexadecimal to Binary

Method: Convert each hex digit to its 4-bit binary equivalent. Join the nibbles.

Example: Convert 3F to binary

  • 3 → 0011
  • F → 1111
  • Result: 00111111

Hex to Denary

Method: Use column values. For a 2-digit hex number, the left digit is ×16 and the right digit is ×1.

Example: Convert A7 to denary

  • A = 10 → 10 × 16 = 160
  • 7 = 7 → 7 × 1 = 7
  • Result: 160 + 7 = 167

Example: Convert FF to denary

  • F = 15 → 15 × 16 = 240
  • F = 15 → 15 × 1 = 15
  • Result: 240 + 15 = 255

Denary to Hex

Method: Divide by 16. The quotient gives the first digit; the remainder gives the second.

Example: Convert 200 to hex

  • 200 ÷ 16 = 12 remainder 8
  • 12 = C, 8 = 8
  • Result: C8

Worked Examples Summary

BinaryHexDenary
00000000000
000011110F15
11111111FF255
10101010AA170
0111000070112
001111003C60
Exam tip: The quickest hex route in an exam is always binary ↔ hex (nibble method), not hex ↔ denary (which requires multiplication). If asked to convert between denary and hex, go denary → binary (using the column method) → hex (nibble method). Memorise: A=10, B=11, C=12, D=13, E=14, F=15.
⚠️ Common Mistakes
  • Forgetting that hex digits go up to F (15), not 9 — 10 in hex is not "ten", it's the letter A
  • Splitting 8-bit binary incorrectly — always split into two equal 4-bit nibbles from the centre
  • Writing hex values as decimal — e.g. writing "14" when the answer should be "E"
  • When converting hex FF to denary getting 99 instead of 255 — F is not 9, it is 15
  • Not writing leading zeros when converting to binary — 3 should be 0011, not 11
✅ Notes completed!
Video coming soon

What's in this video

  • • The hex digit table (0–9, A–F) and why hex uses letters
  • • Binary to hex: split into nibbles, convert each independently
  • • Hex to denary: multiply each digit by its column value (16¹, 16⁰)
  • • Real-world uses: colour codes, memory addresses, error codes
Click slide or press arrow keys to navigate

Worksheet — 1.2.4d Hexadecimal

8 questions · 20 marks · Show all conversion working

Q1What is hexadecimal? State the base and the digits it uses.[2]
✅ Mark scheme
Hexadecimal is base 16 [1]; it uses digits 0–9 and letters A–F (where A=10, B=11, C=12, D=13, E=14, F=15) [1].
Q2Convert binary 11110000 to hexadecimal. Show your nibble split.[2]
✅ Mark scheme
Split: 1111 | 0000 [1]; 1111=F, 0000=0 → F0 [1].
Q3Convert hex 4B to binary. Show working for each nibble.[2]
✅ Mark scheme
4 → 0100; B → 1011 [1 for each]; result 01001011 [1 if combined correctly].
Q4Convert hex 2C to denary.[2]
✅ Mark scheme
2 × 16 = 32; C = 12, 12 × 1 = 12 [1]; 32 + 12 = 44 [1].
Q5Convert denary 175 to hexadecimal. Show your working.[3]
✅ Mark scheme
175 ÷ 16 = 10 remainder 15 [1]; 10 = A, 15 = F [1]; result: AF [1].
Q6Give three real-world uses of hexadecimal in computing.[3]
✅ Mark scheme
Any 3 from: memory addresses / colour codes in HTML/CSS (#RRGGBB) / error/debug codes / MAC addresses / machine code / assembly language [1 each].
Q7Explain why hexadecimal is preferred over binary when representing memory addresses.[2]
✅ Mark scheme
Hex is more compact/shorter than binary [1]; it is easier for humans to read and less likely to cause errors — two hex digits represent 8 bits [1].
Q8A web designer uses colour code #FF3A00. Convert each pair to denary and state what colour information each pair represents.[4]
✅ Mark scheme
FF = 255 — red value [1]; 3A: 3×16+10 = 58 — green value [1]; 00 = 0 — blue value [1]; the colour is a bright red/orange [1 for any correct interpretation of the colour].
?
out of 20 — self-mark above
Topic Quiz
Question 1 of 15
You scored
out of 15
Card 1 of 15
Click to reveal definition
🎉
Complete!
TermDefinition
🎯

Mini Test — 1.2.4d Hexadecimal

10 questions · 10 marks · 10 minutes

← 1.2.4c Binary Shifts 1.2 Data Representation 1.2.4e Character Encoding →
🔒
Unlock Everything
Subscribe to access all OCR J277 lessons.
£7.99/month
or £59/year
Subscribe now →