Converting decimal to binary: the basic method

To convert a decimal number to binary, divide the decimal number by 2 repeatedly, keeping track of the remainder each time. The remainders, read from bottom to top, form your binary number. For example, to convert 13 to binary: divide 13 by 2 to get 6 remainder 1, divide 6 by 2 to get 3 remainder 0, divide 3 by 2 to get 1 remainder 1, and divide 1 by 2 to get 0 remainder 1. Reading the remainders from bottom to top gives you 1101, which is 13 in binary.

This method works for any whole number. The process stops when you reach 0, and the remainders you collected along the way become your answer. Each remainder is either 0 or 1, which is why binary only uses those two digits.

Key Takeaways

  • Divide your decimal number by 2 repeatedly and write down the remainder (0 or 1) each time until you reach 0.
  • Read the remainders from bottom to top to get your binary number.
  • The decimal number 10 converts to 1010 in binary, and 255 converts to 11111111.
  • You can check your work by converting the binary number back to decimal by multiplying each digit by powers of 2 and adding them together.

Step-by-step conversion with examples

Here is how to convert 25 to binary using the division method. Divide 25 by 2: you get 12 with remainder 1. Divide 12 by 2: you get 6 with remainder 0. Divide 6 by 2: you get 3 with remainder 0. Divide 3 by 2: you get 1 with remainder 1. Divide 1 by 2: you get 0 with remainder 1. Stop here because you have reached 0. Now read the remainders from bottom to top: 11001. That is 25 in binary.

Try converting 42. Divide 42 by 2 to get 21 remainder 0. Divide 21 by 2 to get 10 remainder 1. Divide 10 by 2 to get 5 remainder 0. Divide 5 by 2 to get 2 remainder 1. Divide 2 by 2 to get 1 remainder 0. Divide 1 by 2 to get 0 remainder 1. Reading from bottom to top: 101010. That is 42 in binary.

The pattern becomes clearer with practice. Smaller numbers like 5 convert quickly: 5 ÷ 2 = 2 remainder 1, then 2 ÷ 2 = 1 remainder 0, then 1 ÷ 2 = 0 remainder 1, giving you 101. Larger numbers like 100 take more steps but follow the same process: the result is 1100100.

Understanding what binary numbers mean

Binary numbers use only two digits: 0 and 1. Each position in a binary number represents a power of 2, starting from 2 to the power of 0 on the right. The rightmost digit represents 2⁰ (which equals 1), the next digit to the left represents 2¹ (which equals 2), then 2² (which equals 4), then 2³ (which equals 8), and so on.

To understand this, look at the binary number 1101. Reading from right to left, the digits represent: 1 × 2⁰ (1), 0 × 2¹ (0), 1 × 2² (4), and 1 × 2³ (8). Adding these together: 1 + 0 + 4 + 8 = 13. This is how you convert binary back to decimal to check your work.

Converting decimal to binary using the powers-of-2 method

Another way to convert decimal to binary is to find which powers of 2 add up to your number. Start with the largest power of 2 that does not exceed your decimal number, write down a 1, then subtract that power from your number. Repeat with the remainder until you reach 0, writing 0 for any powers of 2 you skip.

For example, convert 19 to binary this way. The largest power of 2 that does not exceed 19 is 16 (which is 2⁴). Write down 1 and subtract: 19 − 16 = 3. The next power of 2 is 8, which exceeds 3, so write 0. The next is 4, which also exceeds 3, so write another 0. The next is 2 (which is 2¹), which fits into 3, so write 1 and subtract: 3 − 2 = 1. The last power is 1 (which is 2⁰), which equals your remainder, so write 1. Your binary number is 10011.

This method is slower for most people but helps you understand why binary works the way it does. It also works well if you already know the powers of 2 by heart.

Common decimal to binary conversions

DecimalBinary
11
210
5101
101010
1610000
32100000
641000000
12810000000
25511111111

Notice that powers of 2 (1, 2, 4, 8, 16, 32, 64, 128, 256) always convert to a 1 followed by zeros. The number 255 is special because it is the largest number that fits in 8 binary digits, and every digit is 1.

Checking your work

After you convert a decimal number to binary, verify your answer by converting the binary number back to decimal. Multiply each binary digit by its corresponding power of 2, then add all the results together. If you get your original decimal number, your conversion is correct.

For example, you converted 25 to 11001. Check it: (1 × 16) + (1 × 8) + (0 × 4) + (0 × 2) + (1 × 1) = 16 + 8 + 0 + 0 + 1 = 25. The answer matches, so your conversion was right. This method catches mistakes and builds confidence in your result.

Frequently Asked Questions

Why do computers use binary instead of decimal?

Computers use binary because electronic circuits can easily represent two states: on (1) and off (0). Decimal would require circuits to represent ten different states, which is more complex and less reliable. Binary is simpler to build and faster to process.

What is the binary number for 0?

The binary number for 0 is simply 0. It does not change when you convert it because 0 divided by 2 is always 0 with remainder 0.

Can you convert negative decimal numbers to binary?

Yes, but the method is different. Computers use a system called two's complement to represent negative numbers in binary. For basic conversion purposes, you can convert the positive version of the number and then note that it is negative. The actual binary representation depends on how many bits your system uses.

How do I convert decimal numbers with decimals (like 5.5) to binary?

Converting the decimal part requires a different method: multiply the decimal portion by 2 repeatedly and record whether the result is greater than 1. This is more complex than converting whole numbers. For most purposes, you convert only the whole number part and handle the fractional part separately.

What is the fastest way to convert large numbers?

For large numbers, the division-by-2 method is usually fastest because it is mechanical and does not require you to know all the powers of 2. Write the divisions in a column and read the remainders from bottom to top. A calculator speeds this up significantly.