Or 
Details
- Or[e1,e2,…] can be input in StandardForm and InputForm as
. The character
can be entered as
||
,
or
, or \[Or]. - Or has attribute HoldAll, and explicitly controls the evaluation of its arguments. In
the
are evaluated in order, stopping if any of them are found to be True. - Or gives symbolic results when necessary, removing initial arguments that are False.
Examples
open all close allBasic Examples (4)
Scope (5)
Or works with any number of arguments:
Or[x, y, z]Or is associative:
Or[x, Or[y, z]]//FullFormOr with explicit True or False arguments will simplify:
Or[x, False, z]Or[x, True, z]Or evaluates its arguments in order, stopping when an argument evaluates to True:
Or[Print[1];True, Print[2];False]Or[Print[1];False, Print[2];False]The order of arguments may be important:
x == 0 || y == 1 / x /. x -> 0y == 1 / x || x == 0 /. x -> 0Symbolic transformations will not preserve argument ordering:
z || y || y || xSimplify[%]TraditionalForm formatting:
x || y || z//TraditionalFormApplications (6)
Combine conditions in a Wolfram Language program:
NotRealNegativeQ[x_ ? NumberQ] := Head[x] === Complex || x ≥ 0NotRealNegativeQ[-2]If an argument of Or evaluates to True, any subsequent arguments are not evaluated:
NotRealNegativeQ[I]The argument order in Or matters; if the last two arguments are reversed, I≥0 is evaluated:
NotRealNegativeQ2[x_ ? NumberQ] := x ≥ 0 || Head[x] === ComplexNotRealNegativeQ2[I]Refine[Sqrt[(x ^ 2 - 1) ^ 2], x ≤ -1 || x ≥ 1]Combine equations and inequalities; Or is used both in the input and the output:
Reduce[x ^ 2 == 1 || x ^ 3 ≤ 1 / 8, x, Reals]RegionPlot[x ^ 2 + y ^ 2 < 1 || x + y > 0, {x, -2, 2}, {y, -2, 2}]RegionPlot3D[x ^ 2 + y ^ 2 + z ^ 2 < 1 || (x - 1) ^ 2 + y ^ 2 + z ^ 2 < 1, {x, -1, 2}, {y, -1, 1}, {z, -1, 1}]A cellular automaton based on Or:
ArrayPlot[Boole[CellularAutomaton[{Or@@#&, {}}, {{True}, False}, 20]]]Find the area of the union of sets given by algebraic conditions:
Integrate[Boole[x ^ 2 + y ^ 2 < 1 || (x - 1) ^ 2 + y ^ 2 < 2], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]RegionPlot[x ^ 2 + y ^ 2 < 1 || (x - 1) ^ 2 + y ^ 2 < 2, {x, -1.5, 2.5}, {y, -2, 2}]Properties & Relations (7)
Truth table for binary Or:
BooleanTable[{x, y, Or[x, y]}, {x, y}]//GridTernary Or:
BooleanTable[{x, y, z, Or[x, y, z]}, {x, y, z}]//GridOr[]Or with a single argument will return the evaluated argument regardless of value:
Or[2 + 2]&& has higher precedence than ||:
p || q && r//FullFormUse BooleanConvert to expand And with respect to Or:
(a || b) && (c || d || e)BooleanConvert[%]De Morgan's laws relate And, Or, and Not:
BooleanConvert[!(a && b)]BooleanConvert[!(a || b || c)]Disjunction of conditions corresponds to the Max of Boole functions:
Max[Boole[a], Boole[b]] - Boole[a || b]Simplify[%]See Also
Xor BooleanConvert LogicalExpand BitOr Nor And Not Disjunction Union BooleanCountingFunction AnyTrue
Characters: \[Or]
Function Repository: VennDiagram
Related Guides
History
Introduced in 1988 (1.0) | Updated in 1996 (3.0)
Text
Wolfram Research (1988), Or, Wolfram Language function, https://reference.wolfram.com/language/ref/Or.html (updated 1996).
CMS
Wolfram Language. 1988. "Or." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/Or.html.
APA
Wolfram Language. (1988). Or. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Or.html
BibTeX
@misc{reference.wolfram_2026_or, author="Wolfram Research", title="{Or}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/Or.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_or, organization={Wolfram Research}, title={Or}, year={1996}, url={https://reference.wolfram.com/language/ref/Or.html}, note=[Accessed: 12-June-2026]}