Quick guide
How to use the Binary Calculator
- Enter or choose first binary number, operation, second binary number.
- Select Calculate.
- Review the main result, supporting breakdown, and step-by-step calculation notes.
- 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.
Calculation method
- Verify both inputs contain only optional leading minus signs and binary digits 0 or 1.
- Parse each operand into an exact signed BigInt integer.
- Execute the chosen arithmetic (+, −, ×, integer ÷) or bitwise (&, |, ^) operation.
- 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 A | Bit B | A AND B | A OR B | A XOR B |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 |
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.