# Binary Calculator

> Do arithmetic and bitwise operations on binary numbers of any length, with the answer in binary, decimal and hexadecimal.

Category: Algebra, geometry & advanced math · Applies to: Worldwide · Last updated: 2026-10-29
Interactive calculator: https://calculators.geekmidst.com/calculators/binary-calculator

Enter two binary numbers and an operation. Arithmetic is exact for numbers up to 256 bits, and every answer is also shown in decimal and hex.

Also called: Base-2 calculator.

## Inputs
- First binary number (default 1011)
- Operation (options: Add (+), Subtract (−), Multiply (×), Divide (÷, whole-number), AND, OR, XOR; default +)
- Second binary number (default 110)

## Results
- Result (binary)
- Result in decimal
- Result in hexadecimal
- Remainder (division only)
- First number in decimal
- Second number in decimal

## Formula

```
Value = Σ dᵢ × 2ⁱ (digits dᵢ = 0 or 1, i counted from 0 at the right);  the operation is done on the exact integers and converted back to base 2
```

Where:
- dᵢ: the binary digit (bit) in position i

## Worked example
1. 1011 = 8 + 2 + 1 = 11 and 110 = 4 + 2 = 6.
2. 11 + 6 = 17 = 16 + 1, which is 10001 in binary.
3. In hexadecimal 17 = 1 × 16 + 1 = 0x11.

**Result:** 1011 + 110 = 10001 in binary, which is 11 + 6 = 17 in decimal.

## What the result means

Bitwise AND keeps a 1 only where both numbers have one, OR where either has one, and XOR where exactly one has one: the basis of masks and flags in programming.

## Assumptions and limits
- Inputs are unsigned (non-negative) binary integers; a 0b prefix is accepted.
- Negative results are shown with a minus sign, not in two’s complement.
- Division gives a whole-number quotient and a remainder; binary fractions are not supported.

## Questions

### How do I convert binary to decimal by hand?

Write the powers of 2 under the digits from the right (1, 2, 4, 8, …) and add the ones under a 1. For 1011: 8 + 0 + 2 + 1 = 11.

### Why does a computer use binary?

Electronic circuits reliably distinguish two states, on and off, so every number is stored as a pattern of bits.

## Related calculators
- [Hex Calculator](https://calculators.geekmidst.com/calculators/hex-calculator)
- [Exponent Calculator](https://calculators.geekmidst.com/calculators/exponent-calculator)
- [Log Calculator](https://calculators.geekmidst.com/calculators/log-calculator)

Source: GM¹X CalcVerse — https://calculators.geekmidst.com/calculators/binary-calculator
