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