Hexadecimal
What hex is
Hexadecimal (hex) is base 16 — a human-friendly shorthand for binary.
| Denary | Binary | Hex |
|---|---|---|
| 10 | 1010 | A |
| 11 | 1011 | B |
| 12 | 1100 | C |
| 13 | 1101 | D |
| 14 | 1110 | E |
| 15 | 1111 | F |
The key idea
One hex digit = exactly 4 bits (one nibble). One byte = two hex digits.
Binary → hex
Split into nibbles, convert each:
1111 1010 → F A → FA
Hex → binary
Convert each digit to 4 bits:
2 D → 0010 1101
Hex → denary
Multiply the first digit by 16, add the second.
2D = (2 × 16) + 13 = 45
Why it's used
- Shorter and less error-prone than long binary strings.
- Colour codes (
#FF0000= red), memory addresses, MAC addresses.
Exam tip
Memorise A=10 … F=15. Most hex questions are two separate nibble conversions joined together.