This calculator can be used to convert a number from the decimal system to the binary system (or vice versa). The result is displayed including the calculation path.
convert binary to decimal
To convert a number from the binary system to the decimal system, the last digit must be multiplied by 20, the second last digit by 21, the third from last by 22 and so on. After that the results are summed up.
For example, if 1101012 is to be converted from the binary system to the decimal system, then calculate:
1101012 | ≙ | 1 ∙ 25 + 1 ∙ 24 + 0 ∙ 23 + 1 ∙ 22 + 0 ∙ 21 + 1 ∙ 20 |
= | 32 + 16 + 4 + 1 | |
= | 53 |
convert binary number with binary point:
To convert a number with binary point from the binary system to the decimal system, the calculation is done with the digits before the decimal point as described above. For the digits to the right of the point, the first digit behind the point is multiplied by 2-1 = 0.5 , the second by 2-2 = 0.25, the third by 2-3 = 0.125 and so on.
For example, if 1.0112 is to be converted to the decimal system, calculate:
1.0112 | ≙ | 1 ∙ 20 + 0 ∙ 2-1 + 1 ∙ 2-2 + 1 ∙ 2-3 |
= | 1 + 0.25 + 0.125 | |
= | 1.375 |
convert decimal to binary
To convert a number from the decimal system to the binary system, you can either divide the number repeatedly by 2 with remainder or use powers of 2.
divide by 2:
With this method you divide the number with remainder by 2. Note the remainder for the result and divide the integer part of the quotient again with remainder by 2. Do this until the integer part is 0. The result is then built from the remainders read from bottom to top.
As an example 2210 is to be converted into the binary system. The calculation looks as follows:
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 |
So it applies: 2210 ≙ 101102
decimal number with point:
To convert numbers with a decimal point from the decimal system to the binary system, the number must be split into an integer part and a fractional part. For example, if the number 22.375 is to be converted to the binary system, then the number is divided into 22 and 0.375. The 22 can be converted as described above. So, for the integer part you will receive 2210 ≙ 101102.
To convert the decimal part, the fractional part is multiplied repeatedly by 2. If the product is not an integer, the fractional part of the product is multiplied by 2 again. This is done until either the product is an integer or until enough decimal places have been calculated. The result is built by the integer parts of the products, read from top to bottom.
So to convert 0.375 to binary you calculate:
0.375 | ∙ | 2 | = | 0.750 |
0.75 | ∙ | 2 | = | 1.50 |
0.5 | ∙ | 2 | = | 1.0 |
It applies: 0.37510 ≙ 0.0112
Now the integer part and the fractional part have to be reassembled:
22.37510 ≙ 10110.0112
with powers of 2:
Again, as an example, the number 22 is to be converted into the binary system.
To convert a number from decimal to binary using powers of 2, first find the largest power of 2 that is less than or equal to the number you want to convert. The largest power of 2 that is less than or equal to 22 is 24 = 16.
Next, starting with the determined power of 2, all powers of 2 up to and including 20 are compared in descending order with what is left of the number to be converted in the respective iteration. If the power of 2 is greater, a 0 is appended to the result. Otherwise, a 1 is appended to the result and the number to be converted is reduced by the power.
So first the 24 = 16 is compared with the 22. The 16 is smaller and therefore a 1 is written into the solution and 16 is subtracted from the 22. So there are 6 left.
Next, the 6 is compared witch 23 = 8. Since the 8 is larger, a 0 is appended to the result.
Then the 6 is compared with 22 = 4. 4 is smaller and therefore a 1 is added to the solution and 4 is subtracted from 6. What remains is 2.
Then the 2 is compared with 21 = 2. Since both numbers are the equal, a 1 is added to the solution and 2 is subtracted from the 2.
20 = 1 is greater than 0 and therefore a 0 is appended to the result.
It applies 2210 ≙ 101102.
with powers of 2 and numbers with decimal places:
As an example, the number 22.375 is to be converted to a binary number.
First, the number must be split into an integer part and a fractional part. The number is thus divided into 22 and 0.375. The 22 is converted as described above.
To convert the decimal part, the procedure is very similar to that for the integer part. This time, however, the number to be converted or what is left of it is first compared with 2-1, then with 2-2, then with 2-3 and so on. If the power of 2 is greater, a 0 is appended to the solution. Otherwise, a 1 is appended and the power of 2 is subtracted from the number.
So first 0.375 is compared with 2-1 = 0.5. 0.5 is larger and therefore a 0 is appended to the result.
Then the 0.375 is compared with 2-2 = 0.25. 0.25 is smaller and thus a 1 is added to the solution and 0.375 is reduced by 0.25. This gives 0.125.
Next, the 0.125 is compared with 2-3 = 0.125. A 1 is added to the solution and since 0,125 - 0,125 = 0, the calculation of the decimal places is finished.
So it applies: 0.37510 ≙ 0.0112
Putting the integer part and the fractional part together again, we get:
22.37510 ≙ 10110.0112