Hex to Decimal

Hex to decimal practice questions

Answer random questions, get marked straight away and see the working for every answer.

Score 0 / 0Streak 0

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.

QuestionWorkingAnswer
1F1 × 16 + 1531
3A3 × 16 + 1058
4D4 × 16 + 1377
808 × 16 + 0128
B411 × 16 + 4180
C912 × 16 + 9201
E714 × 16 + 7231
FE15 × 16 + 14254

Level 2: three-digit hex to decimal

Three hex digits use the place values 256, 16 and 1.

QuestionWorkingAnswer
10A1 × 256 + 0 × 16 + 10266
1C81 × 256 + 12 × 16 + 8456
2FF2 × 256 + 15 × 16 + 15767
3E83 × 256 + 14 × 16 + 81,000
7D07 × 256 + 13 × 16 + 02,000
ABC10 × 256 + 11 × 16 + 122,748

Level 3: decimal to hex

Divide by 16 repeatedly, and read the remainders from the last division to the first.

QuestionWorkingAnswer
4747 ÷ 16 = 2 remainder 15 (F)2F
100100 ÷ 16 = 6 remainder 464
200200 ÷ 16 = 12 (C) remainder 8C8
255255 ÷ 16 = 15 (F) remainder 15 (F)FF
1,0001,000 ÷ 16 = 62 remainder 8; 62 ÷ 16 = 3 remainder 14 (E)3E8
4,0954,095 ÷ 16 = 255 remainder 15; 255 ÷ 16 = 15 remainder 15FFF

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.

QuestionWorkingAnswer
Colour #FF8000: give the red, green and blue valuesFF = 255, 80 = 128, 00 = 0Red 255, green 128, blue 0
ASCII bytes 48 65 6C 6C 6F: give each decimal code72, 101, 108, 108, 111The text "Hello"
Port 1F90: give the decimal port number1 × 4,096 + 15 × 256 + 9 × 16 + 08,080
9C as a signed 8-bit value156 − 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 answerThe errorCorrect answer
3B = 3 × 16 + 10 = 58B was read as 10, but B is 1159
1F = 1 + 15 = 16The first digit was added without multiplying by 1631
Hex 10 equals 10Hex 10 means 1 × 16 + 016

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?
Start with two-digit values, write the place values 16 and 1 above the digits, and check each answer. Move to three digits (256, 16 and 1) when two-digit answers come without errors.
How many hex to decimal questions should you do?
Ten per level is enough to learn the pattern. Repeat any level where more than 2 answers were wrong.
What are the most common mistakes in hex to decimal questions?
Reading B as 10, adding digits without multiplying, and counting positions from 1. The letter values A to F run from 10 to 15, and the right-hand digit sits at position 0.
Is hex to decimal on the GCSE computer science exam?
Yes. GCSE computer science courses test conversion between binary, denary and hex. Questions use values up to 8 bits, so 2 hex digits, and reward the working as well as the answer.