An interactive lesson and quiz on Hexadecimal.
Please enter your name to begin.
Computers speak binary, but it's very hard for humans to read.
Imagine trying to read this binary code for a colour:
11100101 10011011 00101111
It's too long! It's easy to make a mistake. We need a shorthand.
Programmers use Hexadecimal (Hex). The same code above in Hex is:
E5 9B 2F
Much easier, right? Today you'll learn how this conversion works.
Hex is "Base 16". It needs 16 symbols to count.
0, 1, 2, 3, 4, 5, 6, 7, 8, 90, 1| Decimal | 0-9 | 10 | 11 | 12 | 13 | 14 | 15 |
|---|---|---|---|---|---|---|---|
| Hex | 0-9 | A | B | C | D | E | F |
This is the most important part! Why Hex? Why not Base 10?
Let's look at a 4-bit binary number (a "nibble").
Smallest 4-bit number: 0000 = 0
Biggest 4-bit number: 1111 = (8+4+2+1) = 15
Wait... the range of a 4-bit number (0-15) is the exact same range as one Hex digit (0-F)!
This is the "magic link". It's why Hex is the perfect shorthand for Binary. (Base 10 doesn't have this link!)
Please answer all 6 questions on this page before proceeding.
Please answer all 6 questions on this page before proceeding.
Please answer all 4 questions on this page before proceeding.
Please answer all 4 questions on this page before proceeding.
1001|1110Drag from here:
B|4Drag from here:
Drag from here:
Please answer all 3 questions on this page before proceeding.
1001 = 9 (Correct) 1100 = 12 = C (Mistake! They wrote D)
What is the correct Hex value?
F = 1111 (Correct) 2 = 0010 (Mistake! They wrote 0001)
What is the correct 8-bit binary value?
0010 = 2 (Correct) 1010 = 10 = A (Mistake! They wrote 5)
What is the correct Hex value?
Please answer all 3 questions on this page before proceeding.
255 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
Please answer all 2 questions on this page before proceeding.
This is your 1st attempt.