Decimal to Binary Converter With Steps
Enter an ordinary number to see it in binary, with the division steps laid out.
How it works
The standard method is repeated division by 2. Divide your number by 2 and write down the remainder, which will be 0 or 1. Divide the result by 2 again and note that remainder. Keep going until you reach 0. The binary number is the list of remainders read from the last one to the first.
It works because each division peels off one binary digit, starting from the right hand end. An odd number leaves a remainder of 1, so its last binary digit is 1. An even number ends in 0.
For small numbers, subtraction can be quicker. Find the largest power of 2 that fits, write a 1, subtract it, and carry on down through the smaller powers, writing 1 where a power fits and 0 where it does not.
Worked example
45: 45 ÷ 2 = 22 r 1, 22 ÷ 2 = 11 r 0, 11 ÷ 2 = 5 r 1, 5 ÷ 2 = 2 r 1, 2 ÷ 2 = 1 r 0, 1 ÷ 2 = 0 r 1. Read upward: 101101.
Powers of 2
| Position from right | Power | Value |
|---|---|---|
| 0 | 20 | 1 |
| 1 | 21 | 2 |
| 2 | 22 | 4 |
| 3 | 23 | 8 |
| 4 | 24 | 16 |
| 5 | 25 | 32 |
| 6 | 26 | 64 |
| 7 | 27 | 128 |
| 8 | 28 | 256 |
| 9 | 29 | 512 |
| 10 | 210 | 1,024 |
| 11 | 211 | 2,048 |
| 12 | 212 | 4,096 |
| 13 | 213 | 8,192 |
| 14 | 214 | 16,384 |
| 15 | 215 | 32,768 |
| 16 | 216 | 65,536 |
Decimal, binary, octal and hex from 0 to 15
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Common questions
What is 10 in binary?
1010. That is one 8 and one 2.
How do I know how many bits a number needs?
Find the smallest power of 2 that is larger than the number. The exponent is the bit count. 45 is less than 64, which is 2 to the 6th, so it needs 6 bits.