5 in binary = 101
In other bases: hexadecimal 5, octal 5. The binary number has 3 bits.
Divide by 2 repeatedly and note each remainder. Read the remainders from bottom to top.
| Division | Quotient | Remainder |
|---|---|---|
| 5 ÷ 2 | 2 | 1 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Remainders bottom to top: 101.
| Power of 2 | 4 | 2 | 1 |
|---|---|---|---|
| Bit | 1 | 0 | 1 |
Add the powers of 2 where the bit is 1: 4 + 1 = 5.
Need another number or the reverse direction? Use the binary to decimal converter or the text to binary converter.
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 8 | 10 |
| 9 | 1001 | 9 | 11 |