## Decimal to binary conversion

Decimal to binary number converter and how to convert.

## Decimal to binary converter

Enter a decimal number and press the

Convertbutton:Binary to Decimal conversion ►

## How to convert decimal to binary

In order to convert decimal number x to binary number:

For decimal number x:

- Get the highest power of 2 that is less than the decimal number x:
2

<^{n}x, (n=1,2,3,...)- The high binary digit is equal 1:

d= 1_{n}- Calculate the difference Δ of the number x and he power of 2, 2
^{n}:Δ =

x- 2^{n}- Repeat step #1 with the difference until the result is 0.
## Example

Convert x=13 to binary.

## Solution

n=3, 2^{3}=8 < 13

n=4, 2^{4}=16 > 13So

n= 3

d_{3}= 1Δ = 13 - 2

^{3}= 5

n= 2,x= Δ = 5

d_{2}= 1Δ = 5 - 2

^{2}= 1

n= 1,x= Δ = 1

d_{2}= 0

n= 0,x= Δ = 1

d_{0}= 1Δ = 1 - 1 = 0

(

d_{3}d_{2}d_{1}d_{0}) = 1101So 13 in decimal is equal to 1101 in binary:

x= 13_{10}= 1101_{2}

## See also