Skip to content
ENExplore Calculators

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

  1. 1Values used
  2. 2Truth per bit
  3. 3a AND b= 74
  4. 4a OR b= 219
  5. 5a XOR b= 145
  6. 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.

Bitwise AND OR XOR Calculator – Calculate a AND b & a OR b