Computer & IT

Binary Arithmetic Calculator

Add, subtract, multiply or divide two binary numbers, with results in binary and decimal.

Inputs

Only the digits 0 and 1. A minus sign and spaces between groups are allowed.

Result

Result in binary
1100 0011
Result in decimal
195
Working in decimal
182 + 13 = 195

The result is 1100 0011 in binary (195 in decimal).

Educational estimate — check the assumptions below.

About this calculator

Binary arithmetic follows the same rules as ordinary arithmetic, but each column can only hold 0 or 1, so 1 + 1 = 10 (one carried to the next column). This calculator adds, subtracts, multiplies and divides whole binary numbers exactly, of any length, and shows the result in both binary and decimal so you can check your hand working.

Formula

0 + 0 = 0    0 + 1 = 1    1 + 1 = 10 (write 0, carry 1)    1 + 1 + 1 = 11

A ÷ B = quotient, with A = quotient × B + remainder

Multiplication is shift-and-add: for every 1 in B, add A shifted left by that position. Division here is integer division: the quotient is truncated toward zero and the remainder has the same sign as A.

Worked example

  • 1011 0110 (182) + 1101 (13) = 1100 0011 (195)
  • 1011 0110 − 1101 = 1010 1001 (169)
  • 1011 0110 × 1101 = 1001 0011 1110 (2366)
  • 1011 0110 ÷ 1101 = 1110 (14), remainder 0 — because 182 = 14 × 13.
  • 1 1001 (25) ÷ 100 (4) = 110 (6) remainder 1.

Assumptions and limitations

  • Whole numbers of any length, with an optional minus sign. Results are exact and are not limited to 8, 16, 32 or 64 bits — there is no overflow.
  • Division gives the integer quotient and remainder, not a fractional binary result.
  • To see how a result is stored in a fixed number of bits (two’s complement), use the number base converter.

References

  • Binary arithmetic (e.g. Patterson and Hennessy, Computer Organization and Design, chapter on arithmetic for computers).