BitXor[n1,n2,…]
gives the bitwise XOR of the integers ni.


BitXor
BitXor[n1,n2,…]
gives the bitwise XOR of the integers ni.
Details

- Integer mathematical function, suitable for both symbolic and numerical manipulation.
- BitXor[n1,n2,…] yields the integer whose binary bit representation has ones at positions where an odd number of the binary bit representations of the ni have ones.
- For negative integers BitXor assumes a two's complement representation.
- BitXor automatically threads over lists.
Examples
open all close allBasic Examples (1)
Scope (3)
Applications (4)
Generate a Gray code sequence [more info]:
Properties & Relations (4)
Neat Examples (3)
See Also
BitAnd BitOr BitNot Xor IntegerDigits CellularAutomaton HammingDistance SequenceAlignment
Function Repository: BitStringNullSpace BitStringRowReduce BitBooleanFunction
Tech Notes
Related Guides
Related Links
History
Introduced in 1999 (4.0)
Text
Wolfram Research (1999), BitXor, Wolfram Language function, https://reference.wolfram.com/language/ref/BitXor.html.
CMS
Wolfram Language. 1999. "BitXor." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BitXor.html.
APA
Wolfram Language. (1999). BitXor. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BitXor.html
BibTeX
@misc{reference.wolfram_2025_bitxor, author="Wolfram Research", title="{BitXor}", year="1999", howpublished="\url{https://reference.wolfram.com/language/ref/BitXor.html}", note=[Accessed: 14-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_bitxor, organization={Wolfram Research}, title={BitXor}, year={1999}, url={https://reference.wolfram.com/language/ref/BitXor.html}, note=[Accessed: 14-August-2025]}