18 in binary = 10010 (1 0010)
In other bases: hexadecimal 12, octal 22. The binary number has 5 bits.
Divide by 2 repeatedly and note each remainder. Read the remainders from bottom to top.
| Division | Quotient | Remainder |
|---|---|---|
| 18 ÷ 2 | 9 | 0 |
| 9 ÷ 2 | 4 | 1 |
| 4 ÷ 2 | 2 | 0 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Remainders bottom to top: 10010.
| Power of 2 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|
| Bit | 1 | 0 | 0 | 1 | 0 |
Add the powers of 2 where the bit is 1: 16 + 2 = 18.
Need another number or the reverse direction? Use the binary to decimal converter or the text to binary converter.
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 14 | 1110 | E | 16 |
| 15 | 1111 | F | 17 |
| 16 | 10000 | 10 | 20 |
| 17 | 10001 | 11 | 21 |
| 19 | 10011 | 13 | 23 |
| 20 | 10100 | 14 | 24 |
| 21 | 10101 | 15 | 25 |
| 22 | 10110 | 16 | 26 |