Binary Subtraction Calculator

Subtract one binary number from another and see the difference in both binary and decimal. Enter the two numbers as strings of 0s and 1s and this calculator converts them to decimal, subtracts, then converts the result back to base-2.

Formula

first₂ − second₂, computed in decimal then converted back to base-2
  • Each binary number is converted to decimal, subtracted, and the result is converted back to binary.
  • Binary subtraction follows the same borrowing rules as decimal, but each column holds only 0 or 1.
  • Inputs must contain only the digits 0 and 1. A leading '0b' prefix is accepted and ignored.
  • If the second number is larger, the result is negative and shown with a minus sign.
  • The decimal difference is shown alongside so you can check the result against ordinary arithmetic.

1010 − 11

Inputs
  • First number (binary): 1010
  • Second number (binary): 11

1010₂ = 10 and 11₂ = 3. 10 − 3 = 7, which is 111₂ in binary.

Frequently asked questions

How does binary subtraction work?
It uses the same column-by-column borrowing as decimal subtraction, but each column can only hold 0 or 1. Borrowing from the next column brings in a value of 2.
What happens if the result is negative?
If the second number is larger, the difference is negative. This calculator shows the magnitude in binary with a leading minus sign, plus the decimal value.
Can I subtract numbers of different lengths?
Yes. The shorter number is treated as if it has leading zeros, so any two valid binary strings can be subtracted.
Why show the decimal difference?
The decimal value makes it easy to verify the binary result and connect it to everyday arithmetic.
Can I enter a '0b' prefix?
Yes. A leading 0b is stripped automatically, so 0b1010 and 1010 are treated the same.