Binary Calculator

Add, subtract, multiply and divide binary, octal or hex numbers and run AND, OR, XOR, NOT and bit shifts — any size.

Runs instantly in your browser — results update as you type.

How do I calculate with binary numbers?

Enter two numbers in binary, octal, decimal or hexadecimal, choose an operation — +, −, ×, ÷, remainder, AND, OR, XOR, NOT, left or right shift — and get the exact result in all four bases, including the two’s complement form of negative results. Numbers of any length are supported.

Binary arithmetic in brief

  • Addition: 1 + 1 = 10 (write 0, carry 1).
  • AND keeps bits set in both numbers; OR in either; XOR in exactly one.
  • Shift left by n multiplies by 2ⁿ; shift right divides by 2ⁿ.
  • NOT flips every bit within the chosen bit width (e.g. 8-bit).

Frequently asked questions

Can I use prefixes like 0b or 0x?

Yes, they are removed automatically.

How big can the numbers be?

Up to 4,096 digits — calculations use exact BigInt arithmetic.

Is division exact?

Integer division is used and the remainder is shown separately.