Binary arithmetic calculator
Run arithmetic and bitwise operations on two binary numbers: add, subtract, multiply, divide (integer quotient), plus the bitwise AND, OR and XOR. Every result is shown at once in binary, decimal and hexadecimal — useful for learning binary maths or debugging bit flags.
How it works
Each operand is validated to contain only 0 and 1, then parsed into an
arbitrary-precision integer (BigInt) by accumulating value × 2 + bit. The
selected operation is applied directly to those integers — +, −, ×, integer
÷, or the bitwise &, |, ^. The result is then formatted back into binary,
decimal and hex. Because BigInt is used, even long strings compute exactly with no
overflow.
Example
With A = 1010 (10) and B = 0110 (6):
| Operation | Binary | Decimal | Hex |
|---|---|---|---|
| Add | 10000 | 16 | 0x10 |
| Subtract | 100 | 4 | 0x4 |
| Multiply | 111100 | 60 | 0x3C |
| Divide | 1 | 1 | 0x1 |
| AND | 10 | 2 | 0x2 |
| OR | 1110 | 14 | 0xE |
| XOR | 1100 | 12 | 0xC |
Everything runs locally in your browser — nothing is uploaded.