CS Unplugged activity
Secret Messages in Hex
Computers also write numbers in base 16, called hex. You will see it in web colors and error codes. Hex uses 16 digits instead of 10, so after 9 it keeps counting with letters: A, B, C, D, E, F.
Hex digit helper
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 8 | 9 | A | B | C | D | E | F |
A two-digit hex code means (first digit × 16) + second digit. So
48 is 4 × 16 + 8 = 72.
Your chart
| A | B | C | D | E | F | G | H | I | |
|---|---|---|---|---|---|---|---|---|---|
| Decimal | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 |
| Hex | |||||||||
| J | K | L | M | N | O | P | Q | R | |
| Decimal | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |
| Hex | 4D | ||||||||
| S | T | U | V | W | X | Y | Z | space | |
| Decimal | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 32 |
| Hex |
One is done for you. Count forward or back from it.
What to do
- Turn each hex code into a decimal number: first digit times 16, plus the second digit.
- Find that number in the chart and write the letter in the box under the code.
- Write the hex code in the chart’s empty box, so next time you can just look it up.
- Read your finished answer to check it makes sense.
Now decode these
1. Web colors and error codes often use ___ instead of decimal.
2. Fixing a mistake in code is called doing this.
Now go the other way
Now go the other way. Find each letter's decimal code in the chart, divide it by 16, and write the answer then the remainder as two hex digits.
Want the whole table, including lowercase letters and punctuation? See the full ASCII / Hex table.
Answer key
- HEX
- DEBUG
Now go the other way: BOT → 42 4F 54
Version history
- Loading commit history…