Counting in hex
- What is the hexadecimal number
0x2Ain decimal? - What is the largest number you can write with two hex digits, and why is that number so common in computing?
Show hint
Hex digits go 0 to 9, then A (10) to F (15). The place values are 1, 16, 256 and so on.
Show solution
- 42. 2 × 16 + 10 (A) = 42.
- 0xFF = 255. One hex digit is exactly 4 bits, so two hex digits are 8 bits, one byte, which holds 256 values from 0 to 255. That is why colours like
#1d4ed8use two hex digits per channel.
Want a problem like this every day? See today's problem and keep a streak going.