What is hexadecimal, why is it used in computing, and how do you convert between hexadecimal, binary and denary?
The hexadecimal number system, why hexadecimal is used as a shorthand for binary, and converting between hexadecimal, binary and denary.
A focused answer to the WJEC GCSE Computer Science Unit 1 content on hexadecimal, covering the base 16 number system, why hexadecimal is a convenient shorthand for binary, and converting between hexadecimal, binary and denary in both directions with worked examples.
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 topic is asking
WJEC wants you to know the hexadecimal (base 16) number system, why it is a useful shorthand for binary, and how to convert between hexadecimal, binary and denary. This is part of the Data representation and data types content in Unit 1 of WJEC GCSE Computer Science (3500).
The hexadecimal number system
Why hexadecimal is used
It is important to remember that the computer never actually stores hexadecimal; it always stores binary. Hexadecimal is only a human-friendly way of writing binary down.
Converting hexadecimal to binary
The neat trick is that each hex digit is exactly four bits, so you convert one digit at a time.
Converting binary to hexadecimal
To go the other way, split the binary number into groups of four bits starting from the right (add leading zeros to the left group if needed), then convert each group of four bits into its hex digit. For example, splits into and ; and , so the answer is . If a binary number has a number of bits that is not a multiple of four, pad the left-hand group with zeros: becomes . Grouping from the right is essential, because grouping from the left would change the place values and give the wrong answer.
Converting hexadecimal to denary
Multiply each hex digit by its column value ( for the left digit, for the right digit) and add the results, remembering to convert any letter to its value first ( up to ). For a single hex digit the value is just the digit itself, so . For two digits such as , the calculation is . A quick way to check a two-digit answer is that the largest possible value, , is , so any valid two-digit hex number must come out between and .
Try this
Q1. Convert the binary number to hexadecimal. [2 marks]
- Cue. Split into and ; and , so the answer is .
Q2. Convert the hexadecimal number to denary. [2 marks]
- Cue. .
Exam-style practice questions
Practice questions written in the style of WJEC exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
WJEC-style Unit 12 marksConvert the hexadecimal number into denary. Show your working.Show worked answer →
A Unit 1 conversion question. Hexadecimal has two columns worth and . The digit is in the column and (which is ) is in the column (1 mark for the place values). Calculate (1 mark for the total). Markers reward converting to and the correct arithmetic. A common error is to treat as , or to forget to multiply the first digit by .
WJEC-style Unit 13 marksState what is meant by the hexadecimal number system and give one reason why hexadecimal is used in computing.Show worked answer →
A Unit 1 explain question. Hexadecimal is a base number system that uses sixteen symbols: the digits to and the letters to to represent the values ten to fifteen (1 mark for base 16, 1 mark for the use of A to F). One reason it is used is that it is a shorter, more convenient way to write long binary numbers, because each hexadecimal digit represents exactly four bits, so an -bit byte becomes just two hexadecimal digits, which is easier for people to read and less error-prone (1 mark). Markers reward any valid reason, such as easier to read or fewer digits. A common error is to say hexadecimal is what the computer actually stores, when computers store binary and hexadecimal is only a human shorthand.
Related dot points
- The binary and denary number systems, why computers store data in binary, the units of data capacity, and converting whole numbers between binary and denary.
A focused answer to the WJEC GCSE Computer Science Unit 1 content on binary and denary numbers, covering why computers use binary, bits bytes and the units of data capacity, place value in base 2, and converting whole numbers between binary and denary in both directions.
- Adding two binary numbers using the carry rules, the meaning of overflow, and using arithmetic (binary) shifts to multiply and divide by powers of two.
A focused answer to the WJEC GCSE Computer Science Unit 1 content on binary arithmetic, covering adding two binary numbers with the carry rules, the meaning and cause of overflow, and using left and right arithmetic shifts to multiply and divide a binary number by powers of two.
- Representing signed (negative and positive) integers in binary using the sign and magnitude method and the two's complement method, and converting between them.
A focused answer to the WJEC GCSE Computer Science Unit 1 content on representing signed integers in binary, covering the sign and magnitude method, the two's complement method, how to find a two's complement number, and the advantages of two's complement for arithmetic.
- Representing characters in binary using character sets, the ASCII and Unicode character sets, and the relationship between a character, its character code and the number of bits needed.
A focused answer to the WJEC GCSE Computer Science Unit 1 content on representing text, covering character sets, the ASCII character set and its size, the Unicode character set and why it was introduced, character codes, and how the number of bits limits the number of characters.
- Representing bitmap images as pixels, the meaning of resolution and colour depth, calculating the file size of an image, and the role of metadata.
A focused answer to the WJEC GCSE Computer Science Unit 1 content on representing images, covering bitmap images and pixels, resolution, colour depth and the number of colours, calculating image file size from dimensions and colour depth, and the role of metadata.