Bitwise Calculator

Use the bitwise calculator to execute bitwise AND, OR, and XOR on inputs from different numeral systems.

Binary digits, or use the base select.
Clear
AND00102 in decimal
OR111115
XOR110113
NOR0000
a101111
b01106

All operations at 4 bits

OperationBinaryDecimal
AND (a & b)00102
OR (a | b)111115
XOR (a ^ b)110113
NAND110113
NOR00000
XNOR00102
NOT a01004

The rule

AND, OR, XOR, NOR and NOT, bit by bit

What each gate does

  • AND — 1 only where both bits are 1. Used to mask bits off.
  • OR — 1 where either is 1. Used to set bits.
  • XOR — 1 where the bits differ. Self-inverse, which makes it the basis of simple ciphers and of swapping without a temporary.
  • NOT — flips every bit, within a fixed width.
  • NOR and NAND — the negations. Either one alone can build every other gate, which is why chips are made from them.