Decimal to Binary Converter With Steps

Enter an ordinary number to see it in binary, with the division steps laid out.

Binary

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 rightPowerValue
0201
1212
2224
3238
42416
52532
62664
727128
828256
929512
102101,024
112112,048
122124,096
132138,192
1421416,384
1521532,768
1621665,536

Decimal, binary, octal and hex from 0 to 15

DecimalBinaryOctalHex
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

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.

Related tools