
Every Developer Needs to Think in at Least Three Number Bases
Decimal is for humans. Binary is for hardware. Hexadecimal is for developers who need to read binary without going blind. Understanding base conversion is not academic. It is practical knowledge you use every time you work with colors, memory addresses, or bitwise operations. The three bases you need Decimal (base 10): How humans count. Digits 0-9. Binary (base 2): How computers store data. Digits 0 and 1. Hexadecimal (base 16): How developers read binary efficiently. Digits 0-9 and A-F. The relationship: every hex digit maps to exactly 4 binary digits. This is why hex is useful: it is a compact representation of binary. Hex Binary Decimal 0 0000 0 1 0001 1 ... 9 1001 9 A 1010 10 B 1011 11 C 1100 12 D 1101 13 E 1110 14 F 1111 15 Converting by hand Binary to hex: Group binary digits in fours from the right and convert each group. Binary: 1101 0110 1010 Hex: D 6 A Result: 0xD6A Hex to binary: Replace each hex digit with its 4-bit binary equivalent. Hex: 3F Binary: 0011 1111 Decimal to bi
Continue reading on Dev.to Tutorial
Opens in a new tab



