Hexadecimal
AQA GCSE Computer Science (8525), specification 3.3.1 Number bases and 3.3.2 Converting between number bases
Hexadecimal, or hex, is base 16. It uses the digits 0 to 9 and then the letters A to F for the values 10 to 15. One hex digit stands for exactly four bits, so any 8-bit binary number can be written as two hex digits.
What you need to know
- The hex digits are 0–9, then A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.
- Explain why hexadecimal is used: it's a shorter way for people to write and read binary. The computer itself still stores and processes everything in binary.
- Convert in both directions between binary and hex, and between denary and hex, for values from 0 to 255 (
00toFFin hex). - To go from binary to hex, split the 8 bits into two groups of four and turn each group into one hex digit.
- In a two-digit hex number, the left digit counts 16s and the right digit counts 1s.
What you don’t need
- Hex numbers longer than two digits: the largest you'll be asked to convert is
FF, which is 255. - The word “nibble” for a group of four bits is a common teaching term, but it isn't in AQA's specification — you won't be required to use it.
Worked examples
Explain why hexadecimal is often used in computer science. (2 marks)
Answer: One mark for saying hex is a shorter, more compact way of writing a binary value, so it's easier for people to read. One mark for saying the computer still stores and processes the data in binary — hex is only for people.
Convert the 8-bit binary number
1101 0110into hexadecimal.- Split it into two groups of four:
1101and0110. 1101= 8 + 4 + 1 = 13, which is the hex digit D.0110= 4 + 2 = 6.
Answer:
D6- Split it into two groups of four:
Convert the hexadecimal number
9Einto binary, and then into denary.- Turn each hex digit into four bits: 9 =
1001, and E (14) =1110. - So
9E=1001 1110. - Add up the place values with a 1: 128 + 16 + 8 + 4 + 2 = 158.
- Check: 9 × 16 + 14 = 158.
Answer:
1001 1110, which is 158- Turn each hex digit into four bits: 9 =
Convert the denary number 75 into hexadecimal.
- Convert to binary first: 75 = 64 + 8 + 2 + 1 =
0100 1011. - Split into two groups of four:
0100= 4 and1011= 11, which is B. - Check: 4 × 16 + 11 = 75.
Answer:
4B- Convert to binary first: 75 = 64 + 8 + 2 + 1 =
Common mistakes
- Writing a value from 10 to 15 as two digits — for example, writing
1010as “10” instead of A. - Splitting the bits before writing all eight. Pad to 8 bits first, then split into two groups of four, or every digit after a dropped zero shifts.
- Saying that computers use hexadecimal. They don't: hex is a shorthand for people, and the computer works in binary.
Practise it
Learn it
- The video lesson Data Representation: Numbers & Binary teaches this from 4:05, with checkpoint questions as it goes.
Not a subscriber? Watch a sample lesson or see pricing.
Revise next
Written to the published AQA specification. UpperGrades isn’t affiliated with or endorsed by AQA.
