4 in binary = 100
In other bases: hexadecimal 4, octal 4. The binary number has 3 bits.
Divide by 2 repeatedly and note each remainder. Read the remainders from bottom to top.
| Division | Quotient | Remainder |
|---|---|---|
| 4 ÷ 2 | 2 | 0 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Remainders bottom to top: 100.
| Power of 2 | 4 | 2 | 1 |
|---|---|---|---|
| Bit | 1 | 0 | 0 |
Add the powers of 2 where the bit is 1: 4 = 4.
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 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 8 | 10 |