How Binary Numbers Work: Addition, Subtraction, and Conversion Explained
How binary numbers work, explained from place value up: converting between binary and decimal by hand, and fully worked binary addition, subtraction and multiplication with every carry and borrow shown.
A computer never actually "sees" a letter, a color, or a number the way a person reads one. Underneath every file, every calculation, and every pixel on a screen, there is nothing but a long sequence of two-state switches, each one either off or on. Binary is simply the number system built to describe exactly that: two digits, 0 and 1, combined using the same positional place-value idea decimal uses, just with a much smaller alphabet.
This article explains how binary numbers work from the ground up: how place value makes a string of 0s and 1s mean a specific number, how a binary converter switches between binary and decimal by hand in both directions, and fully worked binary addition, subtraction, and multiplication examples with every carry and borrow column shown explicitly and checked against the equivalent decimal arithmetic. The binary calculator on this site, a calculator of binary numbers that also doubles as a binary addition calculator, does all of this instantly; the value in working through it by hand once is that the calculator's answers stop looking like magic afterward.
How binary numbers work: place value is the foundation
Decimal (base 10) assigns each digit position a place value that is a power of 10: ones, tens, hundreds, thousands, each one ten times the last, reading right to left. Binary (base 2) works on the identical idea, except each position is a power of 2 instead of a power of 10: ones, twos, fours, eights, sixteens, thirty-twos, each one exactly double the last. A binary number is nothing more than a compact instruction: add up the place value under every 1 digit, and ignore the place value under every 0.
Worked example. Take the byte 11001010. Lining the eight digits up under the place values 128, 64, 32, 16, 8, 4, 2, 1, reading left to right:
| Digit | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Contributes | 128 | 64 | 0 | 0 | 8 | 0 | 2 | 0 |
Adding only the contributions under the 1 digits: 128 + 64 + 8 + 2 = 202. So binary 11001010 is decimal 202. Skipping the 0 columns entirely, rather than adding a 0 for each one, is the single habit that makes this method fast; there is nothing to compute at those positions at all.
A smaller example makes the same point with less arithmetic. Binary 1010, read right to left, sits under place values 1, 2, 4, 8: the rightmost 0 contributes nothing, the next digit is a 1 worth 2, the next is a 0 worth nothing, and the leftmost digit is a 1 worth 8. Total: 8 + 2 = 10. Binary 1010 is decimal 10, so the binary value of 10 is 1010, and this is exactly the base 2 number system in miniature: every value is just a sum of distinct powers of two, chosen by which positions hold a 1.
Written as a formula, a binary number with n digits is worth the sum below, where each digit is 0 or 1 and the exponent counts positions from the right, starting at 0.
For 1010 the sum is one 8, no 4, one 2 and no 1:
Counting follows the same logic, and it is how to count binary numbers without converting anything: start at 0, and each time a column would reach 2, write 0 in it and add 1 to the column on its left. The sequence runs 0, 1, 10, 11, 100, 101, 110, 111, 1000. So 101 in binary is decimal 5, because 4 + 0 + 1 = 5.
Converting decimal to binary: repeated division
Turning a number into binary, the other direction, uses a different but equally mechanical method: repeatedly divide by 2, write down the remainder at each step, and read the remainders from last to first.
Worked example. Convert decimal 10 to binary. 10 ÷ 2 = 5 remainder 0. 5 ÷ 2 = 2 remainder 1. 2 ÷ 2 = 1 remainder 0. 1 ÷ 2 = 0 remainder 1, and the process stops once the quotient reaches 0. Reading the remainders from the last one calculated back to the first gives 1010, exactly matching the place-value answer from the previous section. This cross-check, converting a number one direction and then immediately converting the answer back, is a reliable way to catch a mistake in either method.
The same repeated-division method scales to any size of number: 25 in binary works out to 11001, the binary of 100 is 1100100, and 128 in binary, a clean power of two, is 10000000, a single 1 followed by seven 0s, since 128 is exactly 2 to the 7th power. Every exact power of two follows that identical one-followed-by-zeros pattern, which is why binary counting leans on powers of two so heavily and why memorizing the first several (1, 2, 4, 8, 16, 32, 64, 128) makes both conversion directions noticeably faster.
How to do binary addition, with every carry shown
Binary addition follows the identical carrying rule decimal addition does, just with a column that overflows at 2 instead of at 10. In decimal, adding 9 + 1 in one column overflows because 10 does not fit in a single digit, so a 1 carries into the next column. In binary, the same overflow happens the moment a column reaches 2, since binary only has the digits 0 and 1 to work with: 1 + 1 = 10 in binary (decimal 2), so the column writes a 0 and carries a 1 left, precisely mirroring how decimal 9 + 1 rolls over to 10.
Worked example. Add 1011 (11 in binary) and 1101 (13 in binary), column by column from the right. Each column is labeled with its place value, and the "Carry" row marks which column each carry lands in:
| Place value | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|
| Carry | 1 | 1 | 1 | 1 | |
| 1011 | 1 | 0 | 1 | 1 | |
| + 1101 | 1 | 1 | 0 | 1 | |
| = 11000 | 1 | 1 | 0 | 0 | 0 |
Working through it one column at a time, starting from the ones place on the right: the ones column is 1 + 1 = 10, write 0, carry 1 into the twos column. The twos column is 1 + 0 + the carried 1 = 10, write 0, carry 1 into the fours column. The fours column is 0 + 1 + the carried 1 = 10, write 0, carry 1 into the eights column. The eights column is 1 + 1 + the carried 1 = 11 (decimal 3), write 1, carry 1 into a brand new sixteens column. That final carry becomes the leading digit of the answer: 11000. Checking in decimal: 11 + 13 = 24, and 11000 is 16 + 8 = 24. Every single column happened to carry in this example, which is a useful case to see once since it shows a carry chain running the full width of the number, the binary equivalent of decimal 999 + 1 rolling all the way over.
A smaller case shows the rule at its barest. 101 + 101 in binary is 1010: the ones column is 1 + 1, which writes 0 and carries 1; the twos column receives that carry and writes 1; the fours column is 1 + 1, which writes 0 and carries 1 into a new eights column. In decimal that is 5 + 5 = 10.
Subtracting binary numbers, with every borrow shown
Subtracting in binary borrows in the same way decimal subtraction does: when the digit being subtracted is larger than the digit on top, a 1 is borrowed from the next column to the left, worth exactly 2 in the column that received it (rather than 10, the way a decimal borrow is worth). Binary minus binary works column by column, and a result that would fall below zero has no place in this system.
Worked example. Subtract 0110 (6 in binary) from 1101 (13 in binary) to subtract in binary the same way decimal subtraction works. The "Borrow" row marks which column has to lend a borrow to the column on its right:
| Place value | 8 | 4 | 2 | 1 |
|---|---|---|---|---|
| Borrow | 1 | 1 | ||
| 1101 | 1 | 1 | 0 | 1 |
| − 0110 | 0 | 1 | 1 | 0 |
| = 0111 | 0 | 1 | 1 | 1 |
Column by column, right to left: the ones column is 1 − 0 = 1, no borrow needed. The twos column is 0 − 1, which does not work without help, so it borrows from the fours column to its left, turning into (2 + 0) − 1 = 1, and leaving the fours column owing a borrow. The fours column, having just lent a borrow, starts at 1 − 1 (the amount it lent) = 0, then still has to subtract its own column value of 1, so it borrows in turn from the eights column to its left: (2 + 0) − 1 = 1. The eights column, having lent its own borrow, starts at 1 − 1 = 0, and then subtracts its own column value of 0, leaving 0. Reading the result top to bottom: 0111, which is decimal 7, exactly matching 13 − 6 = 7 done the ordinary decimal way.
This example needed two separate, chained borrows, the same way a decimal subtraction occasionally needs a borrow to cascade through more than one column before it reaches a column with enough left to lend.
Binary multiplication: shift and add
Binary multiplication reduces to the same idea as decimal long multiplication: multiply the top number by each digit of the bottom number in turn, shifting each partial result one place further left, then add all the partial results together. Because a binary digit is only ever 0 or 1, every partial product is either a copy of the top number (shifted) or a row of 0s, with no multiplication table to memorize at all beyond "anything times 0 is 0, anything times 1 is itself."
Worked example. Multiply 111 (7 in binary) by 011 (the binary of 3). The multiplier 011 has a 1 in its ones place and a 1 in its twos place, so there are two partial products to add: 111 shifted by 0 (unchanged, 00111), and 111 shifted left by 1 (01110). Adding those two partial products is then ordinary binary addition, with its own carry column exactly like the previous section:
| Place value | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|
| Carry | 1 | 1 | 1 | ||
| 00111 | 0 | 0 | 1 | 1 | 1 |
| + 01110 | 0 | 1 | 1 | 1 | 0 |
| = 10101 | 1 | 0 | 1 | 0 | 1 |
Adding those two partial products column by column, starting from the ones place: the ones column is 1 + 0 = 1, no carry. The twos column is 1 + 1 = 10, write 0, carry 1 into the fours column. The fours column is 1 + 1 + the carried 1 = 11 (decimal 3), write 1, carry 1 into the eights column. The eights column is 0 + 1 + the carried 1 = 10, write 0, carry 1 into the sixteens column. The sixteens column is 0 + 0 + the carried 1 = 1, with no further carry. Reading the columns from sixteens back down to ones gives 10101. Checking in decimal: 7 × 3 = 21, and 10101 is 16 + 4 + 1 = 21, confirming the shift-and-add result. Multiplying by a number with more 1 digits simply means more partial products to line up and add, following the exact same procedure each time.
Why binary underlies everything else in computing
Binary is not an arbitrary choice; it is the layer everything else in computing is built on top of. Eight binary digits grouped together form a byte, capable of representing any value from 0 to 255, and every letter, color value, and instruction a computer processes ultimately reduces to some number of these bytes. Hexadecimal, base 16, exists mainly as a compact shorthand for binary rather than a genuinely separate system: each hex digit represents exactly 4 binary digits, so a byte like 11001010 is written far more compactly as CA in hex, and the hex calculator on this site handles that conversion directly, following the same non-negative, whole-number scope as the binary calculator this article is about.
Networking, file sizes, color codes (a web color like #FF0000 is three bytes in hex, red at full intensity), and low-level programming all lean on the same base 2 number system explained above. None of it requires more than the place value, carrying, and borrowing rules already worked through here; a 64-bit number is handled by a computer's hardware using the identical column-by-column logic as the small examples above, just repeated far more times and far faster than any of it could be done by hand.
Common mistakes when working in binary
Four slips account for most wrong answers. Reading the remainders in the wrong order during repeated division is the first: the last remainder is the leftmost digit, so the list has to be read backward. Misaligned columns are the second, since adding 101 and 11 only works if the digits are lined up by place value, which is easiest to keep straight by padding the shorter number with leading zeros. Forgetting the final carry is the third: if the leftmost column carries, the answer is one digit longer than either input. The fourth is reading 10 as ten when in binary it means two; writing the base as a subscript, 10₂, removes the ambiguity.
Practicing the methods above
Now that you have seen how binary numbers work through each example above, a short binary chart or binary table, like the one on the binary calculator page, is the fastest way to check a hand conversion while these methods are still new; a calculator decimal to binary conversion should agree with the repeated-division method exactly every time, and a binary to dec calculator reading should agree with the place-value method exactly every time. The same is true of the arithmetic: work through how to add binary numbers or how to count in binary by hand on a few small examples, and confirm the answer against the calculator's Arithmetic tab before trusting a larger one.
One deliberate gap is worth restating plainly: none of the addition, subtraction, or multiplication above ever produces or accepts a negative binary number. Subtracting binary numbers where the second is larger than the first has no representation in the system used here; that case is the job of a dedicated two's complement tool or binary complement converter, which fixes a bit width in advance and reserves part of it to represent a sign, a different and more specialized tool than the plain place-value system this article covers.
For a sense of how that other system works: in 8-bit two's complement, negative 5 is built by writing 5 as 00000101, flipping every bit to get 11111010, and adding 1 to get 11111011. The leftmost bit then acts as the sign. The same eight bits read as plain binary would be 251, which is why a bit width has to be fixed before a negative number means anything.