← All code tables / Numbers & science
Binary-Coded Decimal (BCD)
BCD 8421 reference table: each decimal digit 0–9 is encoded separately with exactly four binary bits.
| Decimal digit | 8421 BCD nibble | Bit weights |
|---|---|---|
| 0 | 0000 | 8 4 2 1 |
| 1 | 0001 | 8 4 2 1 |
| 2 | 0010 | 8 4 2 1 |
| 3 | 0011 | 8 4 2 1 |
| 4 | 0100 | 8 4 2 1 |
| 5 | 0101 | 8 4 2 1 |
| 6 | 0110 | 8 4 2 1 |
| 7 | 0111 | 8 4 2 1 |
| 8 | 1000 | 8 4 2 1 |
| 9 | 1001 | 8 4 2 1 |
BCD is not the same as converting a whole number to binary. For example, decimal 42 is BCD 0100 0010, but ordinary binary 101010.
Geocaching tip: If binary is separated into four-bit groups and every nibble has a value from 0 to 9, try BCD.