Decimal to binary (division method)
Divide by 2 repeatedly and read the remainders from bottom to top. 13 โ 13รท2 = 6 r1, 6รท2 = 3 r0, 3รท2 = 1 r1, 1รท2 = 0 r1 โ 1101.
Binary to decimal
Multiply each bit by its place value (1, 2, 4, 8, โฆ) from the right and add: 1101 = 8 + 4 + 0 + 1 = 13.
Hexadecimal
Hex uses 0โ9 and AโF (10โ15). Each hex digit is exactly 4 bits, which is why colours (#FF5733) and memory addresses use it. FF = 255; 1A = 26.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 1024 | 10000000000 | 2000 | 400 |
Want to encode words? Use text to binary.