Binary Calculator

Perform arithmetic and bitwise operations on numbers.

Binary math

Input as:

Enter numbers in decimal format (e.g., 42, 255)

Decimal examples:
About

About the Binary Calculator

The Binary Calculator takes two numbers — entered in decimal or directly in binary — and computes everything at once: addition, subtraction, multiplication, integer division with remainder, modulo, and the bitwise operations AND, OR, and XOR. Every result is displayed in decimal, binary, and hexadecimal side by side. The engine runs on BigInt, so arithmetic is exact beyond 2^53 and bitwise operations are arbitrary-width — none of the 32-bit truncation JavaScript's own operators inflict. Negative numbers are supported and shown in sign-magnitude form, the way humans read them.

How to use the Binary Calculator

  1. 1Choose your input mode — type the two operands in decimal or in binary.
  2. 2Enter operand A and operand B (a leading minus sign is allowed).
  3. 3Read the full results table: +, −, ×, integer ÷ (with remainder), modulo, AND, OR, XOR.
  4. 4Each result is shown in decimal, binary, and hex — copy whichever form you need.
  5. 5Try the built-in example pairs to see how the operations behave.

Common use cases

  • Checking bitwise AND/OR/XOR results while debugging flags and masks
  • Verifying arithmetic on values past 2^53, where ordinary calculators lose precision
  • Learning binary arithmetic with instant dec/bin/hex cross-reference
  • Working out subnet and mask logic by hand
  • Sanity-checking integer division and modulo edge cases

Frequently asked questions

Why do results differ from JavaScript's own bitwise operators?

JavaScript's &, |, and ^ coerce numbers to 32-bit signed integers, silently mangling anything larger. This calculator uses BigInt operators, which are arbitrary-width — a bitwise AND of two 64-bit values is computed exactly, with no truncation or sign surprises.

How is division handled?

As integer division truncated toward zero, with the remainder shown alongside — so 100 ÷ 7 reports 14 remainder 2. Division or modulo by zero shows no result rather than an error page.

How are negative numbers displayed in binary?

In sign-magnitude form — -26 appears as -11010 — because that's the readable convention for a calculator. It deliberately does not show two's-complement bit patterns, which depend on a fixed width.

Does anything leave my browser?

No — all computation is local. Nothing you enter is uploaded, stored, or tracked.