Hexadecimal is a number system with base 16, which means it uses sixteen different digits: 0–9 for values zero to nine, and A–F for values ten to fifteen. It’s used in computing because it is a shorter, easier way to represent binary values. For example, a single hex digit can represent four binary digits. This makes hex very useful for things like memory addresses, colours in web design, and machine code instructions.
This page will teach you how to convert numbers between denary (normal base-10 numbers) and hexadecimal (base-16). It includes clear, step-by-step instructions for both directions: converting denary to hexadecimal and hexadecimal back to denary. You’ll learn how to divide and multiply by 16, how to use letters A–F for values above 9, and how to check your answers.
Hexadecimal is base-16. It uses these digits:
0 1 2 3 4 5 6 7 8 9 A B C D E F
(A = 10, B = 11, C = 12, D = 13, E = 14, F = 15)
Step-by-step: Denary to Hexadecimal
Divide your number by 16.
Write down the whole number answer. This is your first hex digit.
Write down the remainder. This is your second hex digit.
If your answer is 10 or more, change it to a letter:
10 = A, 11 = B, 12 = C, 13 = D, 14 = E, 15 = F.
Example: Convert 200
200 ÷ 16 = 12 remainder 8
12 becomes C, 8 stays 8
Final hex value = C8
Practice Questions
Convert the following denary numbers to 2-digit hexadecimal:
10
15
16
31
45
63
100
127
200
255
After you have finished you can check your answers here.
Hexadecimal numbers usually have two digits. Each digit can be a number or a letter.
Step-by-step: Hexadecimal to Denary
Change each hex digit into a number.
For example: A = 10, B = 11, C = 12, up to F = 15.
Multiply the first digit by 16.
Add the second digit.
The answer is your denary value.
Example: Convert 1A
1 = 1, A = 10
(1 × 16) + 10 = 16 + 10 = 26
Example: Convert 3F
3 = 3, F = 15
(3 × 16) + 15 = 48 + 15 = 63
Practice Questions
Convert the following hexadecimal values to denary:
0A
0F
10
1F
2D
3F
64
7F
C8
FF
After you have finished you can check your answers here.