This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)


gives the bitwise XOR of the integers .
  • Integer mathematical function, suitable for both symbolic and numerical manipulation.
  • BitXor yields the integer whose binary bit representation has ones at positions where an odd number of the binary bit representations of the have ones.
  • For negative integers BitXor assumes a two's complement representation.
  • BitXor automatically threads over lists.
Click for copyable input
Click for copyable input
Use numbers of any size:
BitXor takes any number of arguments:
Use negative numbers:
Basic symbolic simplifications are done automatically:
Make a nested pattern:
Generate a Gray code sequence :
Bitwise version of rule 60 cellular automaton:
Truth table for Xor:
Even numbers of identical arguments give 0:
"Munching squares" :
New in 4