Decimal to Binary Converter

10

Whole numbers of any size, including negatives. Calculated exactly in your browser.

Binary result
1001 1100 2
Repeated division, shown

Type a whole number to see its binary form and the divide-by-2 remainders that build it, read from bottom to top.

The repeated division method

  1. Divide the number by 2. Write down the remainder: 0 if it was even, 1 if odd.
  2. Divide the quotient by 2 again, and keep going until the quotient is 0.
  3. Read the remainders from the last one to the first. That is the binary number.

For 156: 156 → 78 r 0, 78 → 39 r 0, 39 → 19 r 1, 19 → 9 r 1, 9 → 4 r 1, 4 → 2 r 0, 2 → 1 r 0, 1 → 0 r 1. Reading upward gives 10011100. Check it by adding place values: 128 + 16 + 8 + 4 = 156.

For a negative input, divide its magnitude and put the minus sign back at the end. For example, 5 gives 101, so −5 displays as -0101, with a leading zero to complete the four-bit group.

The subtraction method

Alternatively, subtract the largest power of 2 that fits and mark a 1 in that position: 156 − 128 = 28 (bit 7), 28 − 16 = 12 (bit 4), 12 − 8 = 4 (bit 3), 4 − 4 = 0 (bit 2). Every other position is 0. This method is quicker when you know the powers of two by heart.

To go the other way, the binary to decimal converter and the step-by-step solver show each place value.

Related guides

FAQ

Frequently Asked Questions

How do you convert decimal to binary?
Divide the number by 2, write down the remainder (0 or 1), and repeat with the quotient until it reaches 0. Reading the remainders from last to first gives the binary number. 13 → remainders 1, 0, 1, 1 → 1101.
What is 255 in binary?
11111111: eight ones, because 255 = 2⁸ − 1.
Does the converter use two’s complement for negative numbers?
The result shows a minus sign followed by the binary magnitude. Two’s complement is a fixed-width encoding used to store signed integers.
Copied to clipboard!