Powers of 2 Reference
| Power | Decimal | Binary | Hex | Use |
|---|---|---|---|---|
| 2⁰ | 1 | 1 | 1 | — |
| 2⁴ | 16 | 10000 | 10 | Hex digit |
| 2⁸ | 256 | 100000000 | 100 | 1 Byte max+1 |
| 2¹⁰ | 1,024 | 10000000000 | 400 | 1 KB |
| 2¹⁶ | 65,536 | — | 10000 | Port range |
| 2²⁰ | 1,048,576 | — | 100000 | 1 MB |
| 2³² | 4,294,967,296 | — | — | IPv4 addresses |
How Binary Works
Each digit in binary represents a power of 2, reading right to left: 2⁰=1, 2¹=2, 2²=4, 2³=8. The binary number 1011 means: 1×8 + 0×4 + 1×2 + 1×1 = 11 decimal.
To convert decimal to binary: Repeatedly divide by 2 and record the remainders bottom-to-top. 13 ÷ 2 = 6 R1, 6 ÷ 2 = 3 R0, 3 ÷ 2 = 1 R1, 1 ÷ 2 = 0 R1 → 1101.
Hexadecimal and Binary
Each hex digit maps to exactly 4 binary digits: F = 1111, A = 1010, 0 = 0000. This makes conversion trivial. The hex color #FF8000 in binary is 11111111 10000000 00000000 — pure orange in RGB.