Skip to main content
WalesComputer ScienceSyllabus dot point

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.

Generated by Claude Opus 4.88 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this topic is asking
  2. The hexadecimal number system
  3. Why hexadecimal is used
  4. Converting hexadecimal to binary
  5. Converting binary to hexadecimal
  6. Converting hexadecimal to denary
  7. Try this

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, 1101011011010110 splits into 11011101 and 01100110; 1101=13=D1101 = 13 = \text{D} and 0110=60110 = 6, so the answer is D6\text{D6}. If a binary number has a number of bits that is not a multiple of four, pad the left-hand group with zeros: 110110110110 becomes 00110110=360011\,0110 = \text{36}. 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 (1616 for the left digit, 11 for the right digit) and add the results, remembering to convert any letter to its value first (A=10\text{A} = 10 up to F=15\text{F} = 15). For a single hex digit the value is just the digit itself, so C=12\text{C} = 12. For two digits such as 7E\text{7E}, the calculation is 7×16+14=112+14=1267 \times 16 + 14 = 112 + 14 = 126. A quick way to check a two-digit answer is that the largest possible value, FF\text{FF}, is 15×16+15=25515 \times 16 + 15 = 255, so any valid two-digit hex number must come out between 00 and 255255.

Try this

Q1. Convert the binary number 1110101011101010 to hexadecimal. [2 marks]

  • Cue. Split into 11101110 and 10101010; 1110=E1110 = \text{E} and 1010=A1010 = \text{A}, so the answer is EA\text{EA}.

Q2. Convert the hexadecimal number 4C\text{4C} to denary. [2 marks]

  • Cue. 4×16+12=64+12=764 \times 16 + 12 = 64 + 12 = 76.

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 2F\text{2F} into denary. Show your working.
Show worked answer →

A Unit 1 conversion question. Hexadecimal has two columns worth 1616 and 11. The digit 22 is in the 1616 column and F\text{F} (which is 1515) is in the 11 column (1 mark for the place values). Calculate 2×16+15×1=32+15=472 \times 16 + 15 \times 1 = 32 + 15 = 47 (1 mark for the total). Markers reward converting F\text{F} to 1515 and the correct arithmetic. A common error is to treat F\text{F} as 1616, or to forget to multiply the first digit by 1616.

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 1616 number system that uses sixteen symbols: the digits 00 to 99 and the letters A\text{A} to F\text{F} 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 88-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

Sources & how we know this