How to use this calculator
- Enter or choose first binary number.
- Enter or choose operation.
- Enter or choose second binary number.
- The result (binary) updates as you type. Use Copy result or Share to keep it.
Method
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
- dᵢ
- the binary digit (bit) in position i
Worked example
- 1011 = 8 + 2 + 1 = 11 and 110 = 4 + 2 = 6.
- 11 + 6 = 17 = 16 + 1, which is 10001 in binary.
- In hexadecimal 17 = 1 × 16 + 1 = 0x11.
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.