Why is hexadecimal useful, and how do we convert to and from it?
Understand hexadecimal, convert between binary, denary and hexadecimal, and explain why hexadecimal is used.
A focused answer to AQA GCSE Computer Science 3.3.3, covering hexadecimal, converting between binary, denary and hexadecimal, and why hexadecimal is used.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
AQA wants you to understand hexadecimal (base 16), convert between binary, denary and hexadecimal in any direction, and explain why hexadecimal is used in computing.
What hexadecimal is
The neat property that makes hex so useful is that , so one hex digit corresponds to exactly four binary digits with no overlap. That is why a byte (8 bits) is always exactly two hex digits, and why you can convert between binary and hex by handling each nibble separately rather than working out the whole value. Programmers see hex constantly: colour codes like #FF8800, memory addresses, MAC addresses, and machine-code dumps are all written in hex.
Binary to hexadecimal
Split the binary into groups of four bits from the right, then convert each group to one hex digit.
Denary to hexadecimal
Divide the denary number by 16: the whole-number part of the division is the first hex digit, and the remainder is the second.
Hexadecimal to denary
Multiply the first digit by 16, then add the value of the second digit. For DA this is , the reverse of the conversion above.
Why hexadecimal is used
Denary to hexadecimal the other way
Some students prefer to convert denary to hex by going via binary, which avoids dividing by 16. Convert the denary number to 8-bit binary first, then split into two nibbles and convert each nibble to a hex digit. For 218: in binary, which splits into (D) and (A), giving DA. Both methods (dividing by 16, or going via binary) give the same answer, so use whichever you find more reliable, but show your working either way so method marks are available if an arithmetic slip creeps in.
A worked colour code
A common real use of hex is colour. A colour is often written as six hex digits, two each for red, green and blue, where each pair is one byte from 00 (none) to FF (255, maximum). For example FF0000 is full red, 00FF00 is full green, and FFFFFF is white (all channels at maximum). Reading FF as denary, , shows why FF is the largest value one byte can hold. This is exactly why hex is convenient: two readable digits stand in for the eight bits of each colour channel, so a designer can write a colour compactly instead of as a long binary string.
Try this
Q1. Convert the hexadecimal number 2F to denary. [2 marks]
- Cue. .
Q2. Give one reason hexadecimal is used instead of binary. [1 mark]
- Cue. It is shorter and easier for people to read and write, with fewer transcription errors than long binary.
Exam-style practice questions
Practice questions written in the style of AQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
AQA 20203 marksConvert the 8-bit binary number 10110110 into hexadecimal. Show your working.Show worked answer →
Split the byte into two nibbles from the right: and .
Convert each nibble to denary then to a hex digit. B. 6.
So the answer is B6. Markers reward splitting into groups of four from the right, converting each nibble correctly, and using B (not the number 11) for the high nibble.
AQA 20234 marksConvert the hexadecimal number 3E into denary, then explain one reason why hexadecimal is preferred to binary when writing memory addresses.Show worked answer →
For the conversion, multiply the first digit by 16 and add the second: , and E , so .
For the explanation, hexadecimal is far shorter and easier for people to read and write than long binary, because two hex digits replace eight binary bits. This reduces transcription errors when writing or comparing long addresses, and the conversion to and from binary is quick (one hex digit per nibble).
Markers reward the correct denary value (62) and a reason that focuses on human readability and fewer errors, not the false claim that computers work in base 16.
Related dot points
- Understand the binary, denary and hexadecimal number bases, why computers use binary, and convert between binary and denary.
A focused answer to AQA GCSE Computer Science 3.3.1, covering the binary, denary and hexadecimal number bases, why computers use binary, and how to convert between binary and denary.
- Add binary numbers up to and including three 8-bit numbers, recognise overflow, and apply logical and arithmetic binary shifts.
A focused answer to AQA GCSE Computer Science 3.3.2, covering binary addition of up to three 8-bit numbers, overflow, and logical and arithmetic binary shifts.
- Know that data is stored in bits and bytes, the units from bit to terabyte, and calculate file sizes and storage requirements.
A focused answer to AQA GCSE Computer Science 3.3.4, covering bits and bytes, the units from bit to terabyte, and calculating file sizes and storage requirements.
- Understand how a bitmap image is represented using pixels and colour depth, the effect of resolution and colour depth on quality and file size, and the role of metadata.
A focused answer to AQA GCSE Computer Science 3.3.6, covering how bitmap images are represented using pixels and colour depth, the effect of resolution and colour depth on quality and file size, and metadata.
Sources & how we know this
- AQA GCSE Computer Science (8525) specification — AQA (2020)