Binary Calculator

Perform arithmetic directly on binary numbers and see the carries, borrows and partial products written out in full — the way you would work it on paper.

Numeric data visualisation on a dark screen

Photo by Growtika on Unsplash

Binary arithmetic calculator

Binary result
Decimal
Hex
Octal
Updated: 2 August 2026Read: 7 minMethod: Column arithmetic in base 2Runs: 100% in your browser

Key takeaways

  • Binary addition has only four column rules, and 1 + 1 = 10 is the only one that generates a carry.
  • Hardware never borrows: subtraction is implemented as addition of the two's complement.
  • Fixed word sizes make overflow silent, which is why range checks matter more in binary arithmetic than the arithmetic itself.

Binary addition

Binary addition follows the same column procedure as decimal, with only four rules to remember instead of a hundred:

  • 0 + 0 = 0
  • 0 + 1 = 1
  • 1 + 0 = 1
  • 1 + 1 = 10 — write 0, carry 1

A fifth case appears once carries are involved: 1 + 1 + 1 = 11, write 1 and carry 1. Work right to left, propagating carries, and stop when both operands and the carry are exhausted.

   111     <- carries
   10110    (22)
 +  1101    (13)
 -------
  100011    (35)

In hardware this is a chain of full adders, each taking two data bits and a carry in, producing a sum bit and a carry out. The carry has to ripple through every stage, which is why processors use carry-lookahead designs to compute the carries in parallel.

Subtraction and two’s complement

Borrowing works like decimal: when you subtract 1 from 0, borrow from the column to the left, which turns the 0 into binary 10 (decimal 2).

   10110    (22)
 -  1101    (13)
 -------
    1001     (9)

Real processors do not implement borrowing. They negate the second operand using two’s complement — invert every bit and add one — then add. In eight bits, 13 is 00001101, its inverse is 11110010, plus one gives 11110011. Adding that to 00010110 produces 00001001 with the ninth bit discarded: 9, the correct answer.

You can experiment with the inversion step in the bitwise calculator.

Multiplication and division

Binary multiplication is genuinely easier than decimal because each digit of the multiplier is either 0 or 1. Every 1 contributes a shifted copy of the multiplicand; every 0 contributes nothing. Sum the partial products and you are done.

    1011      (11)
  x  110       (6)
  -------
    0000       (1011 x 0)
   1011.       (1011 x 1, shifted 1)
  1011..       (1011 x 1, shifted 2)
  -------
  1000010      (66)

Division is long division with the same shift-and-subtract loop: compare the current remainder with the divisor, write 1 and subtract when it fits, write 0 otherwise, then bring down the next bit. Because the quotient digit can only be 0 or 1, there is no guessing involved.

Overflow, word size and precision

Every real machine has a fixed word size, and arithmetic that exceeds it wraps around silently. In eight unsigned bits, 11111111 + 1 gives 00000000 because the ninth bit has nowhere to go. Signed overflow is worse: adding 1 to the largest positive value produces the most negative one.

This is not an academic problem. The Ariane 5 Flight 501 failure in 1996 was traced to a 64-bit float being converted into a 16-bit signed integer that could not hold the value. Boeing 787s once required a periodic reboot because a counter overflowed after 248 days.

This calculator works with JavaScript numbers, which hold integers exactly up to 253 − 1. Inputs longer than 53 bits are rejected rather than silently rounded. For arbitrary precision use the number system converter, which uses BigInt.

Frequently Asked Questions

How do you add binary numbers?

Align the numbers right, then work column by column from the right: 0+0=0, 0+1=1, 1+0=1 and 1+1=0 with a carry of 1. Propagate carries into the next column, exactly as you would in decimal.

What is 1 + 1 in binary?

It is 10, which is decimal 2. The column sum exceeds the largest digit available (1), so you write 0 and carry 1 into the next column.

How do computers subtract without borrowing?

They add the two's complement of the subtrahend. Inverting every bit and adding one produces the negative of a number, so a - b becomes a + (-b) and a single adder circuit handles both operations.

Why is binary multiplication easier than decimal?

Because each multiplier digit is 0 or 1, so every partial product is either zero or a shifted copy of the multiplicand. There are no multiplication tables to memorise.

What happens when a binary result is too large?

It overflows. On fixed-width hardware the extra bits are discarded, so the value wraps around: in eight unsigned bits, 255 + 1 becomes 0. Language runtimes differ in whether they warn about this.

Can this calculator handle negative numbers?

It works with non-negative binary literals and reports an error when a subtraction would go below zero, because the sign convention depends on the word size you choose. Use the bitwise calculator's 8- and 16-bit modes to explore two's complement representations directly.

Sources & further reading

  1. Wikipedia: Binary number — positional notation and arithmetic in base 2
  2. Adder circuits — how half adders and full adders implement binary addition in hardware
  3. Ariane flight V88 — the best-documented consequence of an integer conversion overflow
  4. MDN: MAX_SAFE_INTEGER — the exact-integer limit that bounds this calculator