Bitwise AND OR XOR Calculator
Work out bitwise and or xor instantly with clear inputs, formula shown and shareable results.
About Bitwise AND OR XOR Calculator
Bitwise operators act on each bit position independently: AND keeps bits set in both, OR keeps bits set in either, and XOR keeps bits set in exactly one. AND is used to mask, OR to set, XOR to toggle.
Formula
Truth per bit
AND: 1 only if both are 1; OR: 1 if either is 1; XOR: 1 if exactly one is 1
Worked example
With the default values below, Bitwise AND OR XOR Calculator returns a AND b of 74. Change any input above and every figure here is recalculated in your browser.
Inputs used
- First valueminimum 0
- 202
- Second valueminimum 0
- 91
- Display width in bitsaccepts 1–32
- 8
Results
- a AND b
- 74
- a OR b
- 219
- a XOR b
- 145
- Bit patterns
- 11001010 AND 01011011 = 01001010
Step by step
- 1Values used
- 2Truth per bit
- 3a AND b= 74
- 4a OR b= 219
- 5a XOR b= 145
- 6Bit patterns= 11001010 AND 01011011 = 01001010
Assumptions and limits
- The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
For 202 and 91 in 8 bits?
11001010 AND 01011011 = 01001010 = 74, OR = 11011011 = 219, XOR = 10010001 = 145.
Why is XOR useful?
It is its own inverse, so applying the same XOR twice restores the original — the basis of simple ciphers and of swapping without a temporary variable.
Related Calculators
You might also need
- Discrete Logarithm CalculatorAlso in Discrete Math, Logic & Number Theory
- Set Union And Intersection CalculatorAlso in Discrete Math, Logic & Number Theory
- Tree Height And Nodes CalculatorAlso in Discrete Math, Logic & Number Theory
- Adjacency Matrix CalculatorAlso in Discrete Math, Logic & Number Theory
- Base 64 Value CalculatorAlso in Discrete Math, Logic & Number Theory
- Bell Number CalculatorAlso in Discrete Math, Logic & Number Theory
