Xor
✖
Xor
Details

- Xor[e1,e2,…] can be input in StandardForm and InputForm as
. The character ⊻ can be entered as
xor
or \[Xor].
- Xor gives symbolic results when necessary, applying various simplification rules to them.
- Unlike And, Nand, Or, and Nor, Xor must always test all its arguments, and so is not a control structure, and does not have attribute HoldAll.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (4)Survey of the scope of standard use cases
Xor is associative and commutative:

https://wolfram.com/xid/02c7m-e12p2h


https://wolfram.com/xid/02c7m-eily5h


https://wolfram.com/xid/02c7m-b4vw74


https://wolfram.com/xid/02c7m-bzysuh

Expand in terms of And, Or, and Not:

https://wolfram.com/xid/02c7m-bnrg9g

TraditionalForm formatting:

https://wolfram.com/xid/02c7m-4vzw0

Applications (3)Sample problems that can be solved with this function
Find the Xor of two regions in 2D:

https://wolfram.com/xid/02c7m-p4rn8i

Find the Xor of three regions in 3D:

https://wolfram.com/xid/02c7m-cor3n

A cellular automaton based on Xor:

https://wolfram.com/xid/02c7m-gddzdp

Find the area of the symmetric difference of sets given by algebraic conditions:

https://wolfram.com/xid/02c7m-fe4ca9


https://wolfram.com/xid/02c7m-c14dt7

Properties & Relations (3)Properties of the function, and connections to other functions
Truth table for binary Xor:

https://wolfram.com/xid/02c7m-ib02ro

Ternary Xor:

https://wolfram.com/xid/02c7m-cwl4xo

Use BooleanConvert to expand in terms of And, Or, and Not:

https://wolfram.com/xid/02c7m-cz4euq

Xor of conditions in Boole functions:

https://wolfram.com/xid/02c7m-efrdg


https://wolfram.com/xid/02c7m-hzp6na

Neat Examples (2)Surprising or curious use cases
The Xor of disks on a circle:

https://wolfram.com/xid/02c7m-d221dv

https://wolfram.com/xid/02c7m-lusa3y
Generate three disks on a circle:

https://wolfram.com/xid/02c7m-kslt4


https://wolfram.com/xid/02c7m-mfkrzw

A truth table for a 12-variable Xor function:

https://wolfram.com/xid/02c7m-hdw292

Wolfram Research (1988), Xor, Wolfram Language function, https://reference.wolfram.com/language/ref/Xor.html (updated 2003).
Text
Wolfram Research (1988), Xor, Wolfram Language function, https://reference.wolfram.com/language/ref/Xor.html (updated 2003).
Wolfram Research (1988), Xor, Wolfram Language function, https://reference.wolfram.com/language/ref/Xor.html (updated 2003).
CMS
Wolfram Language. 1988. "Xor." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2003. https://reference.wolfram.com/language/ref/Xor.html.
Wolfram Language. 1988. "Xor." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2003. https://reference.wolfram.com/language/ref/Xor.html.
APA
Wolfram Language. (1988). Xor. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Xor.html
Wolfram Language. (1988). Xor. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Xor.html
BibTeX
@misc{reference.wolfram_2025_xor, author="Wolfram Research", title="{Xor}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/Xor.html}", note=[Accessed: 06-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_xor, organization={Wolfram Research}, title={Xor}, year={2003}, url={https://reference.wolfram.com/language/ref/Xor.html}, note=[Accessed: 06-June-2025
]}