wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are cowritten by multiple authors. To create this article, 50 people, some anonymous, worked to edit and improve it over time.
This article has been viewed 1,082,260 times.
Learn more...
Subtracting binary numbers is a bit different than subtracting decimal numbers, but by following the steps below, it can be just as easy or even easier.
Steps
Method 1
Method 1 of 2:Using the Borrow Method

1Align the numbers as an ordinary subtraction problem. Write the larger number above the smaller number. If the smaller number has fewer digits, line them up on the right, as you would in a decimal (base ten) subtraction problem.^{[1] X Research source }

2Try some basic problems. Some binary subtraction problems are no different than base ten subtraction. Line up the columns and, starting from the right, find the result for each digit. Here are a few easy examples:
 1  0 = 1
 11  10 = 1
 1011  10 = 1001
Advertisement 
3Set up a more complicated problem. You only need to know one special "rule" to complete any binary subtraction problem. This rule tells you how to "borrow" from the digit to the left so you can solve a "0  1" column.^{[2] X Research source } For the rest of this section, we'll set up a couple example problems and solve them using the borrow method. Here's the first:
 110  101 = ?

4"Borrow" from the second digit. Starting from the right column (the ones place), we need to solve the problem "0  1." In order to do this, we need to "borrow" from the digit to the left (the twos place). This has two steps to it:
 First, cross out the 1 and replace it with a 0, to get this: 1^{0}
10  101 = ?  You've subtracted 10 from the first number, so you can add this "borrowed" number to the ones place: 1^{0}
1^{10}0 101 = ?
 First, cross out the 1 and replace it with a 0, to get this: 1^{0}

5Solve the rightmost column. Now each column can be solved as usual. Here's how to solve the rightmost column (the ones place) in this problem:^{[3] X Research source }
 1^{0}
1^{10}0 101 = ?  The rightmost column is now: ^{10}  1 = 1. If you can't figure out how to reach this answer, here's how to convert the problem back to decimal:
 10_{2} = (1 x 2) + (0 x 1) = 2_{10}. (The _{sub} numbers indicate which base the number is written in.)
 1_{2} = (1x1) = 1_{10}.
 Therefore, in decimal form this problem is 2  1 = ?, so the answer is 1.
 1^{0}

6Finish the problem. The rest of the problem can now be solved easily. Solve it column by column, moving from right to left:
 1^{0}
1^{10}0 101 = __1 = _01 = 001 = 1.
 1^{0}

7Try a difficult problem. Borrowing comes up a lot in binary multiplication, and sometimes you'll need to borrow multiple times just to solve one column. For example, here's how to solve 11000  111. We can't "borrow" from a 0, so we need to keep borrowing from the left until we turn it into something we can borrow from:^{[4] X Research source }
 1^{0}
1^{10}000  111 = 
1^{0}
1^{110}0^{10}00  111 = (remember, 10  1 = 1)  1^{0}
1^{110}0^{110}0^{10}0 111 =  Here it is written more tidily: 1011^{10}
0 111 =  Solve column by column: _ _ _ _ 1 = _ _ _ 0 1 = _ _ 0 0 1 = _ 0 0 0 1 = 1 0 0 0 1
 1^{0}

8Check your answer. There are three ways to check your answer.^{[5] X Research source } One quick way is to find a binary calculator online and plug in the problem. The other two methods are still useful, since you may need to check by hand on a test, and they will make you more familiar and comfortable with binary numbers:
 Add in binary to check your work. Add the answer together with the smaller number, and you should get the larger number. Using our last example (11000  111 = 10001), we get 10001 + 111 = 11000, which is the larger number we started with.
 Alternatively, convert each number from binary to decimal and see whether it is true. Using the same example (11000  111 = 10001), we can convert each number into decimal and get 24  7 = 17. This is a true statement, so our solution is correct.
Advertisement
Method 2
Method 2 of 2:Using the Complement Method

1Align the two numbers as you would in decimal subtraction. This method is used by computers to subtract binary numbers, since it uses a more efficient program. For a human used to ordinary decimal subtraction problems, this is probably the more difficult method to use, but could be useful to understand as a programmer.^{[6] X Research source }
 We'll use the example 101  11 = ?

2Append leading zeros if necessary to represent both numbers with the same number of digits. For example, convert 10111 to 101011 so that both have three digits.
 101  011 = ?

3Switch the digits in the second term. Change all the 0s to 1s and all the 1s to 0s in the second term. In our example, the second term becomes:
011→ 100. What we're actually doing is "taking the one's complement," or subtracting each digit in the term from one. The "switching" shortcut works in binary, since the only two possibilities result in switching the term: 1  0 = 1 and 1  1 = 0.

4Add one to the new second term. Once you have the "reversed" term, add one to the result. In our example, we get 100 + 1 = 101.

5Solve the new problem as a binary addition problem. Use binary adding techniques to add the new term to the original term, instead of subtracting:
 101 + 101 = 1010
 If this does not make sense to you, review how to add binary numbers.

6Discard the first digit. This method should always end up with an answer one digit too long. For example, our example problem involved threedigit numbers (101 + 101), but we ended up with a four digit solution (1010). Simply cross out the first digit, and you'll have the answer to the original subtraction problem:^{[7] X Research source }

1010 = 10  Therefore, 101  011 = 10
 If you don't have an extra digit, you tried to subtract a larger number from a smaller one. See the tips section for how to solve problems like that, and start again.


7Try this method in base ten. This method is called the "two's complement" method, since the "reverse the digits" steps results in the "one's complement," and then the number 1 is added.^{[8] X Research source } If you'd like a more intuitive understanding of why this method works, try it in base ten:
 56  17
 Since we're using base ten, we'll take the "nine's complement" of the second term (17) by subtracting each digit from nine. 99  17 = 82.
 Change this into an addition problem: 56 + 82. If you compare this to the original problem (56  17), you can see that we've added 99.
 56+82=138. But since our changes added 99 to the original problem, we'll need to subtract 99 from the answer. Again, we'll use a shortcut, just like in the binary method above: add 1 to the total number, then delete the digit on the left (which represents 100):

138 + 1 = 139 →
139 → 39 This is finally the solution to our original problem, 5617.
Advertisement
Community Q&A

QuestionHow can I make it easier to remember how to subtract binary numbers on an exam?Community AnswerThis isn't a memorization technique, but you could try doing binary subtraction, then afterwards check whether you have got the correct answer by converting the numbers to decimal and then subtracting normally. This might help solidify your understanding and confidence in this topic.

QuestionHow do I calculate binary numbers?Asad NaeemCommunity AnswerYou can calculate by dividing with 2 and storing the remainder. For example: 12 dec binary = 12/2 = 6 (rem) 0. Now, 6/2 = 3 (rem) 0. Similarly, 3/2 = 1 (rem) 1, so binary will be 1100.

QuestionIs 99 binary or decimal?WaleedAlbakerCommunity AnswerIt's a decimal number because 9 is included with the decimal digits which are (0,1,2,3,4,5,6,7,8,9) and you can not find the number 9 in binary because it contains only (0,1) digits.

QuestionWhat are the steps to convert binary numbers to decimal numbers?DonaganTop Answerer

QuestionWhat if the question has a letter such as x101112?Community AnswerA letterprefix means which base is being used, where b is binary, d is decimal and x is hexadecimal. Before you an calculate these questions you must first convert them into binary. x10 = b1000.

QuestionWhat is a binary number?DonaganTop AnswererIt is a number expressed in the base 2 (rather than the usual base 10). It is expressed using only ones and zeros.

QuestionHow do I solve the binary formula 11011.0011011.11?Community AnswerRemove the "." Calculate normally and then add the "." back where it was. In your case it was the first 3 digits from the left.

QuestionHow do I solve 10010  1011?Community Answer10010 = 18, 1011 = 11. 18  11 = 7, which in binary is 0111.

QuestionCan someone explain (011110  110010)?Community AnswerWork from right to left: 00 is zero, record. Then 11 is zero, record. 10 is one, record.10 is one, record, 10 is one, record. Then 01 is difficult, in binary one borrows an imaginary one, when borrowed has 2 in the next field, then now 21 is one. Your final answer is 111100.
Video
Tips
 To subtract a larger number from a smaller one, switch the order of the numbers, do the subtraction, then add a negative sign to the answer. For example, to solve the binary problem 11  100, solve for 100  11 instead, then add a negative sign to the answer. (This rule applies to subtraction in any base, not just binary.)Thanks!
 Mathematically, the complements method makes use of the identity a  b = a + (2^{n}  b)  2^{n} When n is the number of digits in b, 2^{n}  b is one more than the result of negating.Thanks!
References
 ↑ http://www.math.ucla.edu/~radko/circles/lib/data/Handout602720.pdf
 ↑ http://www.math.ucla.edu/~radko/circles/lib/data/Handout602720.pdf
 ↑ http://www.math.ucla.edu/~radko/circles/lib/data/Handout602720.pdf
 ↑ http://www.math.ucla.edu/~radko/circles/lib/data/Handout602720.pdf
 ↑ http://www.exploringbinary.com/binarysubtraction/
 ↑ http://www.exploringbinary.com/binarysubtraction/
 ↑ http://courses.cs.vt.edu/csonline/NumberSystems/Lessons/SubtractionWithTwosComplement/index.html
 ↑ http://courses.cs.vt.edu/csonline/NumberSystems/Lessons/SubtractionWithTwosComplement/index.html
About This Article
To subtract binary numbers, simply align the 2 numbers and subtract as you would a regular problem. To subtract with the complement method, align the numbers and, if necessary, add zeros to the front of the second number to give it has an equal amount of digits. Change all the digits in the second term to their opposites, making the 0s into 1s and the 1s into 0s. Add 1 to the second term and add the 2 numbers as a binary addition problem. Then, remove the first digit to get the answer to your subtraction problem. For more help and examples, read on!