Hex to binary
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |
| 65535 | 1111111111111111 | 177777 | FFFF |
Hex to binary needs no arithmetic at all — just substitution. Each digit becomes its own four bits: 2 is 0010, A is 1010, F is 1111, so 2AF is 0010 1010 1111. Going back is the same in reverse: group the bits into fours from the right and read each group as one hex digit.
Each hexadecimal digit becomes exactly four binary digits, so no arithmetic is needed — just substitution. 2AF becomes 0010 1010 1111. The mapping is exact because 16 is 2 to the fourth power.
How to convert hex to binary
This exact four-to-one mapping is the whole reason hexadecimal exists in computing. It gives a compact notation that a person can translate to and from binary without calculation, which matters when reading a register value or a memory dump. Octal has the same property with three bits, which is why it was common on machines with 12, 24 or 36-bit words — and why it faded once eight-bit bytes won.
Questions
1010. Each hex digit is exactly four bits.