How it counts
After 9 comes A (ten), B (eleven) up to F (fifteen). 10 in hex is sixteen, and FF is 255, the largest value of one byte. Each hex digit stands for four bits, so a byte is always two digits.
Where you see it
- Colours: #3B82F6 is red 3B (59), green 82 (130) and blue F6 (246), the same colour as rgb(59, 130, 246). Convert any colour with the Color Converter.
- IP addresses: 192.168.1.1 is C0.A8.01.01 in hex. The IP Address Converter shows all the forms.
- Character codes, hashes and memory addresses are also written in hex because it is compact.
Converting by hand
Multiply the first digit by 16 and add the second: 3B = 3 × 16 + 11 = 59.
Common misunderstanding
Hex is not a different kind of number, only a different way of writing the same value. 0x1F, 1F and 31 all mean thirty-one in the right base.