Bitwise XOR


Bitwise XOR (Exclusive OR) is a Bitwise operation which is used in bit manipulation and on Bitmasks

Bitwise XORtake two equal-length bit patterns.

  • outputs a 1 whenever the inputs do NOT match (False as any non-zero value is considered false)
  • outputs a 0 ONLY WHEN the inputs do match (True)

Bitwise XOR Examples#

So in these examples

If both bits in the compared position of the bit patterns are 0 or 1, the bit in the resulting bit pattern is 0, otherwise 1.

Another slightly more complex example

10270010100111001011010100111010Bitwise XOR

More Information#

There might be more information for this subject on one of the following: