Math
Binary Subtraction Calculator
Enter the two binary numbers and the calculator subtracts them column by column using the borrow method.
The borrow row shows which digits changed, each column is explained, and a negative result is shown with a minus sign. The decimal check confirms the answer.
Digits 0 and 1 only. A leading minus sign is allowed; spaces or underscores can group bits (1011 0110).
Digits 0 and 1 only.
Try an example
Result
Binary result
—
- Decimal check
- —
- Hexadecimal
- —
- Octal
- —
Student quick launch
Grade planning, algebra checks, and formulas students reach for most.
Study path
Use this calculator with
Follow these when you want the formula behind the answer, a short lesson, or nearby tools in the same topic.
What the binary subtraction calculator solves
Binary subtraction uses the same borrow idea as decimal subtraction, but a borrow is worth 2 instead of 10. The only tricky column is 0 − 1, which needs a borrow from the left. This page shows every borrow, handles inputs of different lengths, and gives a signed answer when the second number is larger.
Binary subtraction rules
| Column | Result | Borrow? |
|---|---|---|
| 0 − 0 | 0 | no |
| 1 − 0 | 1 | no |
| 1 − 1 | 0 | no |
| 0 − 1 | 1 (after borrowing: 10 − 1 = 1) | yes, from the nearest 1 to the left |
How to use it
- Enter the number you are subtracting from (the minuend) first.
- Enter the number to subtract (the subtrahend) second.
- Read the amber borrow row: a 2 marks a column that became 10 after borrowing, a 0 marks the digit that lent the borrow, and 1s mark zeros that were passed over.
- Check the difference against the decimal line.
How to read the answer
A positive difference means the first number was larger. If the second number is larger, the calculator swaps the magnitudes for the column work and puts a minus sign on the answer, which is how you would do it by hand. Computers instead represent the negative answer in two's complement, so use the two's complement calculator to see that form.
Common mistakes and edge cases
- Borrowing from a 0 does not work; keep moving left until you reach a 1.
- Every 0 you pass while borrowing becomes 1 (because 10 − 1 = 1 leaves a 1 behind).
- Do not drop leading zeros of the answer until the subtraction is finished; the calculator trims them for you.
- Subtracting a negative number is addition: 101 − (−11) = 101 + 11.
- Equal inputs give 0 with no borrows.
Worked examples
Subtraction with borrows
110010 − 1011
Binary result
100111
Borrow across zeros
1000 − 1
Binary result
111
Equal numbers
1101 − 1101
Binary result
0
Negative result
101 − 1101
Binary result
-1000
Subtracting a negative
101 − (−11)
Binary result
1000
Invalid digit
10a − 1
Binary result
—
Frequently asked questions
What is 0 − 1 in binary?+
By itself it needs a borrow. Borrow 1 from the next column to the left so the current column becomes 10 (two); then 10 − 1 = 1.
How do you borrow across several zeros?+
Move left until you find a 1. Turn it into 0. Every 0 you passed becomes 1, and the column you started in becomes 10. Then subtract normally.
What if the second number is bigger?+
The answer is negative. The calculator subtracts the smaller magnitude from the larger and shows a minus sign. In fixed-width hardware the result would wrap around in two's complement.
Is binary subtraction the same as adding the two's complement?+
Yes. A − B equals A + (two's complement of B) with the final carry discarded. Hardware uses that trick so it only needs an adder.
Can the inputs have different lengths?+
Yes. The shorter one is padded with leading zeros so the columns align; the value does not change.
About this calculator
- Written by
- mathcheck editorial team
- Last reviewed
- September 4, 2026
Method
- Uses the values entered by the user and stable formulas documented on the page.
Related calculators
Binary Calculator
Add, subtract, multiply, or divide binary numbers with the column method shown: carries, borrows, partial products, and a long-division tableau, plus decimal, hex, and octal equivalents.
Binary Addition Calculator
Add two binary numbers with every carry shown in an aligned column grid, plus the decimal check and the hex and octal equivalents of the sum.
Two's Complement Calculator
Convert decimal to two's complement and back at 4, 8, 16, 32, or 64 bits with the invert-and-add-1 steps, the sign bit highlighted, overflow detection, and the unsigned reading of the same bits.
Binary to Decimal Converter
Convert binary to decimal with the positional-weight table (bit × 2^n), fractional bits after the binary point, and an option to read the bits as a signed two's complement number.
Binary Division Calculator
Divide binary numbers with the long-division tableau drawn out, the remainder shown, optional fraction bits past the binary point, and a decimal check.
Decimal to Binary Converter
Convert decimal to binary with the repeated-division steps, fractional parts by repeated multiplication (0.625 → 0.101), repeating-fraction detection, and negatives as a sign or two's complement.
Last updated: September 4, 2026