The method in brief
Multiply each digit by 16 raised to its position, counting from 0 on the right, then add the products. Use A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. For decimal to hex, divide by 16, note each remainder, and read the remainders from last to first. The full method with worked examples is in how to convert hex to decimal by hand.
Level 1: two-digit hex to decimal
Two hex digits hold the values 00 to FF (0 to 255), the range of 1 byte.
| Question | Working | Answer |
|---|---|---|
1F | 1 × 16 + 15 | 31 |
3A | 3 × 16 + 10 | 58 |
4D | 4 × 16 + 13 | 77 |
80 | 8 × 16 + 0 | 128 |
B4 | 11 × 16 + 4 | 180 |
C9 | 12 × 16 + 9 | 201 |
E7 | 14 × 16 + 7 | 231 |
FE | 15 × 16 + 14 | 254 |
Level 2: three-digit hex to decimal
Three hex digits use the place values 256, 16 and 1.
| Question | Working | Answer |
|---|---|---|
10A | 1 × 256 + 0 × 16 + 10 | 266 |
1C8 | 1 × 256 + 12 × 16 + 8 | 456 |
2FF | 2 × 256 + 15 × 16 + 15 | 767 |
3E8 | 3 × 256 + 14 × 16 + 8 | 1,000 |
7D0 | 7 × 256 + 13 × 16 + 0 | 2,000 |
ABC | 10 × 256 + 11 × 16 + 12 | 2,748 |
Level 3: decimal to hex
Divide by 16 repeatedly, and read the remainders from the last division to the first.
| Question | Working | Answer |
|---|---|---|
47 | 47 ÷ 16 = 2 remainder 15 (F) | 2F |
100 | 100 ÷ 16 = 6 remainder 4 | 64 |
200 | 200 ÷ 16 = 12 (C) remainder 8 | C8 |
255 | 255 ÷ 16 = 15 (F) remainder 15 (F) | FF |
1,000 | 1,000 ÷ 16 = 62 remainder 8; 62 ÷ 16 = 3 remainder 14 (E) | 3E8 |
4,095 | 4,095 ÷ 16 = 255 remainder 15; 255 ÷ 16 = 15 remainder 15 | FFF |
Level 4: real-world values
Hex values appear as colours, character codes, network ports and signed bytes, and each one converts with the same method.
| Question | Working | Answer |
|---|---|---|
Colour #FF8000: give the red, green and blue values | FF = 255, 80 = 128, 00 = 0 | Red 255, green 128, blue 0 |
ASCII bytes 48 65 6C 6C 6F: give each decimal code | 72, 101, 108, 108, 111 | The text "Hello" |
Port 1F90: give the decimal port number | 1 × 4,096 + 15 × 256 + 9 × 16 + 0 | 8,080 |
9C as a signed 8-bit value | 156 − 256 | −100 |
For signed values, subtract 256 when the first hex digit is 8 or higher, which means the top bit is 1. The signed hex to decimal converter covers 16, 32 and 64 bits.
Level 5: spot the mistake
Each answer below contains one error. Find it and give the correct answer.
| Student answer | The error | Correct answer |
|---|---|---|
| 3B = 3 × 16 + 10 = 58 | B was read as 10, but B is 11 | 59 |
| 1F = 1 + 15 = 16 | The first digit was added without multiplying by 16 | 31 |
| Hex 10 equals 10 | Hex 10 means 1 × 16 + 0 | 16 |
Hex in GCSE computer science
GCSE computer science courses ask students to convert between binary, denary (decimal) and hex, usually for values up to 8 bits, which is 00 to FF. Three question styles appear most often:
- Convert a hex value to denary. Show the multiplication for each digit, since method marks reward the working.
- Convert a denary value to hex. Divide by 16, or split the value into two groups of four bits and convert each group.
- Explain why programmers use hex. Hex is shorter than binary, each hex digit stands for exactly 4 bits, and people read and copy it with fewer errors.
For the 8-bit range, the hex to decimal table lists every value from 00 to FF.
Frequently asked questions
How do you practise hex to decimal conversion?
How many hex to decimal questions should you do?
What are the most common mistakes in hex to decimal questions?
Is hex to decimal on the GCSE computer science exam?
Related tools
- Hex to Decimal Converter — check any answer with digit-by-digit steps
- How to Convert Hex to Decimal by Hand — the method with a step-through tool
- Hex to Decimal Table — all 256 byte values
- Decimal to Hex Converter — the reverse conversion with divide-by-16 steps