Free Binary Calculator - Add, Subtract, Multiply, Divide

Free binary calculator: add, subtract, multiply and divide binary numbers with carries shown, run AND, OR, XOR, NOT and shifts, and convert two's complement.

  • No upload, 100% private
  • Instant, in your browser
  • 100% free, no signup
Loading tool…
Read the complete guideBinary Arithmetic and Two's Complement: Add, Subtract, Multiply →

About the Binary Calculator tool

Binary is the base-2 number system computers use internally: every digit is 0 or 1 and each position is worth twice the one to its right. Doing arithmetic in binary by hand is a standard exercise in computer science and digital electronics courses, and bitwise operations such as AND, OR, XOR and shifts are everyday tools for programmers working with flags, masks, permissions and network addresses.

This binary calculator covers three jobs. The Arithmetic tab adds, subtracts, multiplies and divides binary numbers of any length, returning the result in binary, decimal, hex and octal. For addition it draws the column method with the carry row; for multiplication it lists the shifted partial products, exactly as you would write them on paper. Division gives the quotient and remainder with a check line.

The Bitwise tab applies AND, OR, XOR, NOT, NAND, NOR, left shift and logical or arithmetic right shift within a fixed 8-, 16-, 32- or 64-bit width, aligning the bits so you can follow each column. The Two's complement tab converts signed decimal integers to their bit patterns and back, showing the invert-and-add-one method.

How to use Binary Calculator

  1. Choose “Arithmetic”, “Bitwise” or “Two's complement”.
  2. Arithmetic: type two binary numbers, pick an operation and read the binary result plus its decimal, hex and octal forms.
  3. Bitwise: pick an operation and a bit width, then enter A and B (or a shift amount); negative numbers are converted to two's complement.
  4. Two's complement: choose a direction and bit width, then enter a decimal number or a bit pattern.
  5. Open the working box or “Show steps” to see the carries, partial products or bit-by-bit logic.

Features

Unlimited-length arithmetic

Uses exact big integers, so long binary numbers never lose precision.

Paper-style working

Column addition with carries and long multiplication with partial products.

Full set of bitwise operators

AND, OR, XOR, NOT, NAND, NOR, left shift and logical and arithmetic right shifts.

Two's complement both ways

Signed decimal to bit pattern and back for 4- to 64-bit widths, with range checks.

Multi-base output

Every result is also shown in decimal, hexadecimal and octal with copy buttons.

When to use it

  • Check binary addition and subtraction exercises from a computer science class.
  • Work out a bit mask with AND or combine flags with OR.
  • Find the 8-bit two's complement representation of −42 for an assembly assignment.
  • See what an arithmetic right shift does to a negative number.
  • Verify a hand-calculated binary multiplication.

Frequently asked questions

How do you add binary numbers?

Add column by column from the right: 0+0 = 0, 0+1 = 1, 1+1 = 10 (write 0, carry 1) and 1+1+1 = 11 (write 1, carry 1). The calculator shows the carry row for every addition of positive numbers.

What is two's complement?

It is the standard way computers store signed integers. To negate a number, invert all its bits and add 1. In 8 bits, −42 is 11010110, and the top bit acts as the sign.

What is the difference between logical and arithmetic right shift?

A logical shift fills the vacated left bits with zeros, while an arithmetic shift copies the sign bit, so negative numbers stay negative. For non-negative numbers they give the same result.

How does binary division handle remainders?

The calculator returns an integer quotient truncated toward zero and a remainder, with a check that quotient × divisor + remainder equals the dividend.

Why does NOT depend on the bit width?

NOT flips every bit, including the leading zeros. NOT 00000101 is 11111010 in 8 bits but a different number in 16 bits, so a width is required.

Related tools