Esta página também existe em português: Português (Brasil) · Español
Number base converter
Decimal · binary · hex table
| Dec | Bin | Hex | Oct |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 5 | 101 | 5 | 5 |
| 10 | 1010 | A | 12 |
| 16 | 10000 | 10 | 20 |
| 42 | 101010 | 2A | 52 |
| 64 | 1000000 | 40 | 100 |
| 100 | 1100100 | 64 | 144 |
| 255 | 11111111 | FF | 377 |
| 1024 | 10000000000 | 400 | 2000 |
Why computers count in base 2
Each binary digit (bit) is a physical state: on or off. Eight bits make a byte (0 to 255, which is why 255 shows up everywhere: RGB colors, network masks). Hexadecimal exists because 1 hex digit = exactly 4 bits, so FF is human shorthand for 11111111. That is why web colors are #RRGGBB. To convert decimal → binary by hand: divide by 2 repeatedly and read the remainders from the bottom up (42 → 101010, yes, the answer to everything). Octal survives in Unix permissions (chmod 755).
Last updated: · Methodology and sources