Math

Binary Calculator

Add, subtract, multiply, divide, AND, OR, or XOR two binary integers.

Quick guide

How to use the Binary Calculator

  1. Enter or choose first binary number, operation, second binary number.
  2. Select Calculate.
  3. Review the main result, supporting breakdown, and step-by-step calculation notes.
  4. Copy the output or download the generated file when available.

What this tool does

Perform exact base-2 arithmetic and bitwise logic on arbitrary-precision signed binary integers. Because the engine converts inputs directly into JavaScript BigInt integers, you can add, subtract, multiply, divide, or run bitwise AND, OR, and XOR on 64-bit or larger bit strings without floating-point rounding.

1010₂ (10) + 11₂ (3) = 1101₂ (13) · Bitwise AND: 1010 & 0011 = 0010

Calculation method

  1. Verify both inputs contain only optional leading minus signs and binary digits 0 or 1.
  2. Parse each operand into an exact signed BigInt integer.
  3. Execute the chosen arithmetic (+, −, ×, integer ÷) or bitwise (&, |, ^) operation.
  4. Format the integer result back to base-2 alongside its exact base-10 equivalent.

Example: binary addition and bitwise comparison

Input: First binary: 1010; Operation: Add; Second binary: 11

Result: 1101 (Decimal: 13)

1010 in binary equals 8 + 2 = 10, and 11 equals 2 + 1 = 3. Adding them yields 13, which is 8 + 4 + 1 = 1101 in binary.

Bitwise truth table (per bit position)

Bit ABit BA AND BA OR BA XOR B
00000
01011
10011
11110

Practical uses

  • Subnet mask and bitflag verification
  • Computer architecture coursework
  • Checking large 64-bit binary arithmetic
  • Debugging embedded register masks

Accuracy tips and common mistakes

  • Binary division uses integer truncation toward zero (for example, 101 ÷ 10 returns 10, which is 5 ÷ 2 = 2).
  • Negative inputs use signed-magnitude notation with a minus sign rather than fixed-width two’s complement.
  • Remove spaces or 0b prefixes before submitting binary strings.
Frequently Asked

Binary Calculator – Frequently Asked Questions

Common questions, edge-cases, and mathematical explanations.

Does binary division return a decimal fraction or whole quotient?

It performs exact integer division truncated toward zero, matching standard integer CPU and BigInt semantics.

How does bitwise XOR differ from bitwise OR?

OR outputs 1 whenever at least one input bit is 1, while XOR outputs 1 only when the two input bits are different.

Can this binary calculator handle numbers larger than 32 bits?

Yes. Because it uses BigInt integers internally, it handles 64-bit, 128-bit, and wider binary values accurately.

Analytics preferences

Optional Google Analytics cookies help us understand visits and improve our tools. Analytics is off until you allow it. Your tool inputs and files are never included in our analytics events. Read our privacy policy.

Analytics is off.