Converting decimal to binary requires repeated division by 2 and taking the remainder to determine whether a given placeholder of the digit is 0 or 1. If there is a binary converter online, it's possible to simply enter the decimal number and let the program do the work. Knowing how to do it manually is useful to computer programmers.
- Divide the decimal number by 2
For example, assume the decimal number to be converted is 35. Divide it by 2 to get 17 with a remainder of 1. This determines the rightmost digit of the binary number, which represents 1, or 2 to the power of 0. Each digit to the left is a power of 2 higher.
- Divide the result of this number by 2 and repeat
When 17 is divided by 2, the answer is 8R1, or 8 with a remainder of 1. This result indicates that the second binary digit is 1. The next division, 8 by 2, is 4R0. When 4 is divided by 2, the answer is 2R0, and 2 divided by 2 leaves 1R0. Then, 1 divided by 2 leaves 0R1.
- Write the binary digits right to left using the results of the division
The calculations yield the binary number 100011.
- Multiply the 1s by the appropriate power of 2, and add them up
To confirm the calculation, convert the binary number back to decimal by multiplying the 1s on the number by the appropriate power of 2. Doing this yields 2^5 + 2^1 + 2^0, or 32 + 2 + 1, or 35, which is the original decimal number.