Learn binary › Converter
Binary to decimal converter
Type a number in binary or in decimal, or turn on the lights. The sum shows underneath.
Convert a number
128 + 32 + 16 + 2 + 1
From 0 to 65,535.
From binary to decimal
- Write the value of each place under the digits, from right to left: 1, 2, 4, 8, 16, and so on.
- Keep only the values that sit under a 1.
- Add them up.
Example: 101101 has a 1 in the places of 32, 8, 4 and 1. So 32 + 8 + 4 + 1 = 45.
From decimal to binary
Find the largest place that fits in the number and turn its light on. Take that value away and repeat with what is left, until you reach zero.
Example with 45: 32 fits and 13 is left; 8 fits and 5 is left; 4 fits and 1 is left; 1 fits. The lights of 32, 8, 4 and 1 are on: 101101.
Another way is to divide by 2 until you reach zero and read the remainders from the bottom up. Both ways give the same result.
Table from 0 to 15
| Decimal | Binary | Decimal | Binary |
|---|---|---|---|
| 0 | 0000 | 8 | 1000 |
| 1 | 0001 | 9 | 1001 |
| 2 | 0010 | 10 | 1010 |
| 3 | 0011 | 11 | 1011 |
| 4 | 0100 | 12 | 1100 |
| 5 | 0101 | 13 | 1101 |
| 6 | 0110 | 14 | 1110 |
| 7 | 0111 | 15 | 1111 |
How far it goes
This converter goes up to 65,535, the largest number 16 lights can hold. With 8 lights, one byte, the maximum is 255.