Skip to Content
Binary Calculator — Add, Subtract, Multiply, Divide, Bitwise & Base Converter

Compute binary operations

Global, unit‑agnostic

Enter values in your preferred base, choose bit width and signedness, then run arithmetic or bitwise operations. Converts and formats automatically.

Allowed characters auto‑adjust by base (bin/dec/hex/oct).
Use B for operations that need two inputs (A op B).
Signed interprets values in two’s complement.
Left/right shift uses selected bit width; right shift type as chosen.

Division shows quotient and remainder; all results wrapped to selected bit width.

Results

Operation
Binary
Decimal
Hex
Octal
Notes

What is a binary calculator?

A binary calculator performs arithmetic and bitwise operations directly in base‑2. It also converts numbers between binary, decimal, hexadecimal, and octal, respecting bit width and two’s complement for signed values. This tool streamlines low‑level work for students, developers, network engineers, embedded programmers, and anyone learning digital logic.

Why bit width and signedness matter

  • Bit width: Determines the range and wrap behavior. For n bits, values wrap modulo 2^n.
  • Unsigned: Represents 0 to 2^n − 1.
  • Signed (two’s complement): Represents −2^(n−1) to 2^(n−1) − 1. Negative numbers are encoded by inverting bits and adding one.

Supported operations

  • Arithmetic: Addition, subtraction, multiplication, and integer division (quotient and remainder), all wrapped to the chosen bit width.
  • Bitwise: AND, OR, XOR, NOT, left shift, and right shift (logical or arithmetic).
  • Conversions: Instant formats in binary, decimal, hex, and octal for any input.

Rules and examples

  • Wraparound: 8‑bit 255 + 1 = 0 (unsigned); 8‑bit 127 + 1 = −128 (signed), due to two’s complement wrap.
  • Shifts: Left shift inserts zeros; logical right shift inserts zeros; arithmetic right shift preserves the sign bit.
  • Masks: Results are masked with (2^n − 1) to keep n‑bit range.

Who benefits from this tool?

  • Students: Understand binary arithmetic, two’s complement, and base conversions.
  • Professionals: Debug bit flags, registers, and protocols with precise control.
  • Educators: Demonstrate overflow, wrap, and signed vs unsigned interpretation.
  • Developers: Verify bit masks, shifting behavior, and integer boundaries across widths.

Frequently asked questions

HOW TO add two binary numbers?
Enter A and B, choose bit width/signedness, and click Add. The calculator shows the result in binary, decimal, hex, and octal with wrap applied.
HOW TO do binary subtraction with borrow?
Use Subtract (A − B). The tool handles borrows under the hood and masks the result to the selected bit width.
HOW TO multiply or divide in binary?
Click Multiply or Divide. Division returns the integer quotient and remainder using the chosen signedness and bit width.
HOW TO use bitwise AND, OR, XOR, and NOT?
Open the Bitwise tab and pick an operation. For NOT, choose NOT A or NOT B; shifts use the shift amount and right shift type you set.
HOW TO switch between logical and arithmetic right shift?
Select the desired right shift type. Logical inserts zeros; arithmetic preserves the sign bit in signed mode.
HOW TO convert between binary, decimal, hex, and octal?
Use the Converters tab. Click Convert A or Convert B to view all bases at once, honoring bit width and signedness.
HOW TO handle overflow and negative numbers?
Choose the correct bit width and signedness. Overflow wraps modulo 2^n; signed mode interprets results in two’s complement.

Search Topic: Binary Calculator

Trending keywords (SEO optimized): binary calculator online, bitwise calculator AND OR XOR, binary addition subtraction, two’s complement calculator, left shift right shift calculator, binary to decimal converter, decimal to binary converter, hex to binary converter, octal to binary converter, signed vs unsigned calculator, n‑bit wrap calculator, register bit mask calculator, network subnet binary math