Binary to Decimal (and Decimal to Binary): How to Convert
Computers store everything in binary: ones and zeros. Each binary digit (bit) stands for a power of 2, so converting between binary and our everyday decimal numbers is a matter of adding or dividing by 2.
Quick answer
- Binary to decimal: multiply each bit by its power of 2 (1, 2, 4, 8, 16…, from the right) and add them up.
- Decimal to binary: divide by 2 repeatedly and read the remainders from bottom to top.
- Example: 1011 = 8 + 0 + 2 + 1 = 11.
Binary to decimal, step by step
Convert 101101:
| Bit | 1 | 0 | 1 | 1 | 0 | 1 |
|---|---|---|---|---|---|---|
| Place value | 32 | 16 | 8 | 4 | 2 | 1 |
| Bit × value | 32 | 0 | 8 | 4 | 0 | 1 |
Add the bottom row: 32 + 8 + 4 + 1 = 45.
Decimal to binary, step by step
Convert 45: divide by 2 and note each remainder.
| Division | Result | Remainder |
|---|---|---|
| 45 ÷ 2 | 22 | 1 |
| 22 ÷ 2 | 11 | 0 |
| 11 ÷ 2 | 5 | 1 |
| 5 ÷ 2 | 2 | 1 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Read the remainders from bottom to top: 101101.
Binary to decimal chart
| Decimal | Binary | Decimal | Binary |
|---|---|---|---|
| 0 | 0 | 11 | 1011 |
| 1 | 1 | 12 | 1100 |
| 2 | 10 | 13 | 1101 |
| 3 | 11 | 14 | 1110 |
| 4 | 100 | 15 | 1111 |
| 5 | 101 | 16 | 10000 |
| 6 | 110 | 17 | 10001 |
| 7 | 111 | 18 | 10010 |
| 8 | 1000 | 19 | 10011 |
| 9 | 1001 | 20 | 10100 |
| 10 | 1010 | 21 | 10101 |
Bits and bytes
- A byte is 8 bits, so it can hold 28 = 256 values: 0 to 255 (11111111).
- Two bytes (16 bits) hold 0 to 65,535.
- Each extra bit doubles the number of values.
Programmers often write binary in hexadecimal because it’s shorter; see hex to decimal. For storage units, see KB to MB.
Frequently asked questions
How do you convert binary to decimal?
Multiply each bit by its power of 2 and add the results.
What is 1010 in decimal?
10.
What is 255 in binary?
11111111.
What is 100 in binary?
1100100.
