How do you convert a number between binary, denary and hexadecimal?
Number systems: binary, denary and hexadecimal, and how to convert between all three, including why hexadecimal is used as a shorthand for binary.
An Eduqas GCSE Computer Science answer on the binary, denary and hexadecimal number systems and how to convert between all three, with worked place-value methods and the reason hexadecimal is a useful shorthand for binary.
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
Eduqas wants you to convert numbers between the three number systems used in computing: binary (base 2), denary (base 10, our everyday numbers) and hexadecimal (base 16). You must be able to go in every direction, show clear working, and explain why hexadecimal is used as a shorthand for binary. These conversions appear on almost every Component 1 paper.
The three number systems
In an 8-bit binary number the place values are powers of two: . In hexadecimal the place values are powers of sixteen: . In denary they are powers of ten: .
Converting denary to binary
Converting binary to denary
To convert binary to denary, add up the place values wherever there is a . For example, has s in the and columns, so it equals .
Converting with hexadecimal
Why hexadecimal is used
Hexadecimal is a shorthand for binary. A single byte takes eight binary digits but only two hex digits, so hex is far shorter to write, read and copy, and people make fewer mistakes with it. Because each hex digit maps cleanly to four bits, converting between hex and binary is quick. This is why memory addresses, colour codes (such as #FF0000 for red) and error codes are usually written in hexadecimal.
Try this
Q1. Convert the denary number to 8-bit binary. [2 marks]
- Cue. (that is ).
Q2. Convert the binary number to denary. [2 marks]
- Cue. .
Q3. State why hexadecimal is used instead of long binary numbers. [1 mark]
- Cue. It is much shorter and easier for people to read and copy, and each hex digit maps to exactly four bits.
Exam-style practice questions
Practice questions written in the style of WJEC Eduqas exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Eduqas Component 1, 20223 marksConvert the denary number 214 into an 8-bit binary number. Show your working.Show worked answer →
Write the place values for 8 bits: 128, 64, 32, 16, 8, 4, 2, 1.
Work left to right, subtracting each place value that fits: 214 minus 128 leaves 86 (so 128 is a 1); 86 minus 64 leaves 22 (64 is a 1); 32 does not fit (0); 22 minus 16 leaves 6 (16 is a 1); 8 does not fit (0); 6 minus 4 leaves 2 (4 is a 1); 2 minus 2 leaves 0 (2 is a 1); 1 does not fit (0).
Answer: 11010110. Markers award method marks for the place values and the subtraction even if a single bit is wrong, so always show the working.
Eduqas Component 1, 20232 marksConvert the hexadecimal number 2F into denary. Show your working.Show worked answer →
Hexadecimal has two place values for two digits: 16 and 1. The digit 2 is in the 16s column and F is 15 in the 1s column.
So the value is (2 times 16) plus (15 times 1) = 32 + 15 = 47.
Answer: 47. One mark for the correct method (2 times 16 plus 15), one for the answer. A common error is treating F as 16 rather than 15.
Related dot points
- Binary addition of two 8-bit numbers including carrying and overflow, and binary shifts (left and right) and their effect of multiplying or dividing by powers of two.
An Eduqas GCSE Computer Science answer on adding two 8-bit binary numbers (with carrying and overflow) and performing left and right binary shifts, including how a shift multiplies or divides by powers of two.
- Signed and unsigned binary, and the use of two's complement to represent negative integers, including converting between two's complement and denary for 8-bit numbers.
An Eduqas GCSE Computer Science answer on signed versus unsigned binary and how two's complement represents negative integers, with worked conversions between 8-bit two's complement and denary in both directions.
- How text is represented using character sets, the ASCII character set, the need for and nature of Unicode, and how a character maps to a binary code.
An Eduqas GCSE Computer Science answer on how text is stored in binary using character sets, the 7-bit ASCII set, why Unicode was needed to support many languages, and how a character maps to a binary code.
- The units of data (bit, nibble, byte, kilobyte, megabyte, gigabyte, terabyte), how images are stored as pixels (resolution and colour depth), how sound is sampled (sample rate and bit depth), and calculating file sizes.
An Eduqas GCSE Computer Science answer on the units of data, how images (resolution and colour depth) and sound (sample rate and bit depth) are represented in binary, and full worked calculations of image and sound file sizes.
- The logic operators AND, OR and NOT, their logic gates and truth tables, and combining them in simple logic circuits and Boolean expressions of up to three inputs.
An Eduqas GCSE Computer Science answer on the AND, OR and NOT logic gates and their truth tables, and how to build and evaluate simple logic circuits and Boolean expressions of up to three inputs.
Sources & how we know this
- WJEC Eduqas GCSE Computer Science specification (from 2016) — Eduqas (2020)