An interactive lesson and quiz on Number Base Conversions.
Please enter your name to begin.
Computers only understand Binary (0s and 1s). As humans, we use Denary (0-9). Hexadecimal (0-9, A-F) is a "middle-ground" that is easy for both humans and computers.
Binary numbers get very long, very quickly. This is hard for humans to read and copy without making mistakes.
10001111100101111011
Hexadecimal is much shorter ("less susceptible to error") and easier for programmers to read and write.
8F97B
A common mistake is to think hex "takes up less storage space". This is incorrect. All data is *always* stored in binary. Hex is just a simpler way for *humans* to represent that binary.
Please answer all 2 questions on this page before proceeding.
This is the trickiest conversion. It involves place values, but with powers of 16.
You multiply the first digit by 16 and add the second digit. (Remember: A=10, B=11, C=12, D=13, E=14, F=15)
Place Value: [16s] [1s]
Hex Number: A 3
Step 1: 'A' is 10. (10 * 16) = 160
Step 2: '3' is 3. (3 * 1) = 3
Step 3: Add them: 160 + 3 = 163
You use division and remainders (DIV and MOD). Divide the number by 16.
Step 1: 62 DIV 16 = 3
(How many 16s fit in 62? 3)
Step 2: 62 MOD 16 = 14
(What is the remainder? 14)
Step 3: Convert to Hex:
Digit 1: 3 -> '3'
Digit 2: 14 -> 'E'
Answer: 3E
Please answer all 5 questions on this page before proceeding.
This is the easiest conversion! A 2-digit hex number is *exactly* 8 bits (one byte). The trick is to split the 8-bit binary into two 4-bit "nibbles".
1. Split the byte into two 4-bit nibbles:
1100 0111
2. Convert each nibble to its denary/hex equivalent:
3. Combine them: C7. That's it!
1. Split the hex digits:
B 0
2. Convert each digit to a 4-bit nibble:
3. Combine them: 1011 0000. Done!
Answer =
Answer =
Please answer all 3 questions on this page before proceeding.
You now have all the skills. You can convert between all three number bases. The questions in the exam paper often ask you to fill in a table with all three values.
| Denary | 8-bit Binary | 2-digit Hex |
|---|---|---|
| 38 | 00100110 | 26 |
| 78 | 01001110 | 4E |
| 156 | 10011100 | 9C |
| Denary | 8-bit Binary | Hex |
|---|---|---|
| 00000111 | 7 | |
| 49 | 31 | |
| 01100110 | 66 | |
| 244 | 11110100 |
Please answer all 4 parts of the question before proceeding.
Binary: 1000 1111 1001 0111 1011
Hex: 8 F
This confirms the 4-bit nibble method works for binary of any length.
Please answer all 3 parts of the question before proceeding.
Time to test your understanding of the *methods* themselves.
num 16.
num 16.
Please answer both questions on this page before proceeding.
This is your 1st attempt.