Decimal to Binary converter
To use this decimal to binary converter tool, you should type a decimal value like 308 into the left field below, and then hit the Convert button. This way you can convert up to 19 decimal characters (max. value of 9223372036854775807) to binary value.
Binary to Decimal conversion ►
How to convert decimal to binary
To convert decimal number x to binary number:
- Get the highest power of 2 that is less than the decimal number x:
max(2n) < x, (n = 1,2,3,...)
- The high binary digit is equal 1:
dn = 1
- Calculate the difference Δ of the number x and he power of 2, 2n:
Δ = x - 2n
- Repeat step #1 with the difference until the result is 0:
x = Δ
Example
Convert x=13 to binary.
Solution
n=3, 23=8 < 13
n=4, 24=16 > 13
So
n = 3
d3 = 1
Δ = 13 - 23 = 5
n = 2, x = Δ = 5
d2 = 1
Δ = 5 - 22 = 1
n = 1, x = Δ = 1
d2 = 0
n = 0, x = Δ = 1
d0 = 1
Δ = 1 - 1 = 0
(d3d2d1d0) = 1101
So 13 in decimal is equal to 1101 in binary:
x = 1310 = 11012
Decimal to binary conversion table
Decimal | Binary |
---|---|
0 | 0 |
1 | 1 |
2 | 10 |
3 | 11 |
4 | 100 |
5 | 101 |
6 | 110 |
7 | 111 |
8 | 1000 |
9 | 1001 |
10 | 1010 |
11 | 1011 |
12 | 1100 |
13 | 1101 |
14 | 1110 |
15 | 1111 |
16 | 10000 |
17 | 10001 |
18 | 10010 |
19 | 10011 |
20 | 10100 |
21 | 10101 |
22 | 10110 |
23 | 10111 |
24 | 11000 |
25 | 11001 |
26 | 11010 |
27 | 11011 |
28 | 11100 |
29 | 11101 |
30 | 11110 |
31 | 11111 |
32 | 100000 |
64 | 1000000 |
128 | 10000000 |
256 | 100000000 |