Decimal to Binary Converter
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
- Divide the number by 2. Write down the remainder: 0 if it was even, 1 if odd.
- Divide the quotient by 2 again, and keep going until the quotient is 0.
- 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
Other Number System Conversions
Related numeral systems converters for number conversion between binary, decimal, hexadecimal, octal, and ASCII text.