Binary Translator

Decimal to Binary Converter

To convert decimal to binary, divide the number by 2 again and again, record each remainder, and read the remainders from last to first. Enter a whole number below to see the full division table and the binary result.

Binary result

11001010

Working

  1. 202 ÷ 2 = 101, remainder 0
  2. 101 ÷ 2 = 50, remainder 1
  3. 50 ÷ 2 = 25, remainder 0
  4. 25 ÷ 2 = 12, remainder 1
  5. 12 ÷ 2 = 6, remainder 0
  6. 6 ÷ 2 = 3, remainder 0
  7. 3 ÷ 2 = 1, remainder 1
  8. 1 ÷ 2 = 0, remainder 1
  9. Read the remainders from the last division up to the first: 11001010.

Example: 202 to binary

  • 202 ÷ 2 = 101, remainder 0
  • 101 ÷ 2 = 50, remainder 1
  • 50 ÷ 2 = 25, remainder 0
  • 25 ÷ 2 = 12, remainder 1
  • 12 ÷ 2 = 6, remainder 0
  • 6 ÷ 2 = 3, remainder 0
  • 3 ÷ 2 = 1, remainder 1
  • 1 ÷ 2 = 0, remainder 1
  • Read the remainders from the last division up to the first: 11001010.
  • Result: 11001010

Repeated division by 2

Each division by 2 peels off the lowest bit: the remainder is 1 if the number is odd and 0 if it is even. The quotient carries the remaining bits to the next step. When the quotient reaches 0 you stop. Because the first remainder is the lowest bit, the answer is written in reverse order, from the last remainder to the first.

The working below the converter prints every division line, such as "13 ÷ 2 = 6, remainder 1", followed by the binary reading. The method gives the minimal representation with no leading zeros, except for 0 itself, which is 0.

Padding to a fixed width

Computers often store numbers in 8, 16, 32 or 64 bits. To fit a result to a width, add zeros on the left until it reaches that length; a value that needs more digits than the width does not fit. Leading zeros in the input, such as 000255, are ignored because they do not change the value.

Alternative: subtract powers of 2

You can also work from the top: find the largest power of 2 not greater than the number, write 1 in that position, subtract, and repeat with the remainder. Both methods give the same bits. Division is easier to automate, which is why the tool uses it.

Frequently asked questions

How do you convert 10 to binary?
Divide by 2 repeatedly: 10 gives remainder 0, 5 gives 1, 2 gives 0, 1 gives 1. Reading the remainders from the bottom gives 1010.
Why read the remainders backwards?
The first remainder is the lowest-value bit, and binary is written with the highest-value bit on the left.
Can I convert numbers with decimals or negatives?
Not here. The tool converts non-negative whole numbers only.
How many bits does a number need?
The count of divisions needed to reach zero, which is the length of the binary result.