Skip to content

XOR and OR in Boolean algebra: which laws each one obeys

XOR and OR obey different laws: OR is idempotent, so A OR A is A, while XOR cancels, so A XOR A is FALSE. As truth tables they differ on a single row, A = TRUE, B = TRUE, where OR is TRUE and XOR is FALSE; the engine's comparison marks that row, and the rest of the page shows how far the algebra separates them beyond it.

A OR B is TRUE on rows 1, 2 and 3, Σm(1, 2, 3), FALSE only on row 0; its single maxterm is ΠM(0), which is the formula itself as a one-clause CNF. A XOR B is TRUE on rows 1 and 2 only. The equivalence check reports the two not equivalent with the witness A = TRUE, B = TRUE, and the table marks that row. On the three rows where at most one input is TRUE, nobody can tell them apart, which is why the slip survives small examples.

The algebra differs more than the tables suggest. OR absorbs (A OR (A AND B) is A), and XOR has no absorption law. OR distributes with AND both ways; AND distributes over XOR but XOR does not distribute over AND. A chain of OR means “at least one”; a chain of XOR means “an odd number”, which is why XOR builds parity and OR builds eligibility.

In hardware both are two-input gates, OR cheap on either universal basis (three gates NAND or NOR here) and XOR the classic four-NAND circuit. In rules, OR is the default reading of “or”, and XOR is the operator to reach for only when “but not both” was said. The pitfall page on inclusive vs exclusive or, which compares the two readings of “or”, and the XOR lesson cover the translation.

Example

inclusive_or := A OR B · outputexclusive_or := A XOR B · output

Exact checks

Always true (tautology)? No Counterexample: A = F, B = F · Exhaustively checked and solver cross-checked · 1 rows
Always false (contradiction)? No Counterexample: A = F, B = T · Exhaustively checked and solver cross-checked · 2 rows
Can be true? Yes Example assignment: A = F, B = T · Exhaustively checked and solver cross-checked · 2 rows
Are inclusive_or and exclusive_or equivalent? No Counterexample: A = T, B = T · Exhaustively checked and solver cross-checked · 4 rows

Truth table (4 rows)

XOR and OR in Boolean algebra: which laws each one obeys
#ABinclusive_orexclusive_or
0FALSEFALSEFALSEFALSE
1FALSETRUETRUETRUE
2TRUEFALSETRUETRUE
3TRUETRUETRUEFALSE

Logic diagram

XOR and OR in Boolean algebra: which laws each one obeys XOR and OR in Boolean algebra: which laws each one obeys A B inclusive_orPRIMARY exclusive_or OR XOR
XOR and OR in Boolean algebra: which laws each one obeys XOR and OR in Boolean algebra: which laws each one obeys A B inclusive_orPRIMARY exclusive_or OR XOR

Karnaugh map

A \ B
0
1
0
0m0
1m1
1
1m2
1m3
  1. cells m2, m3A
  2. cells m1, m3B
A OR B · Derived A OR B. Exactly equivalent on every assignment.

Minterms and maxterms

inclusive_or(A, B) = Σm(1, 2, 3)inclusive_or(A, B) = ΠM(0)

Variable order: A, B · 4 rows

Normal forms

Conjunctive normal form (CNF)

A OR B

1 clauses, 2 literals · complete

Disjunctive normal form (DNF)

A OR B

2 terms, 2 literals · complete

NAND-only and NOR-only

NAND-only form

NAND(NAND(A, A), NAND(B, B))

3 gates · verified equivalent on every row

NOR-only form

NOR(NOR(A, B), NOR(A, B))

3 gates · verified equivalent on every row

The common slip

Testing a rule with OR and with XOR on examples where only one condition holds and concluding they are the same. They are, on those rows; the one row that differs is the one with both conditions TRUE, and it is the row to try first.

Questions

Is OR “at least one” or “one or more”?

Both phrasings mean the same thing: inclusive. The exclusive reading, “exactly one”, is XOR for two inputs and a written-out formula for more.

How do I get XOR from OR?

(A OR B) AND NOT (A AND B): at least one, and not both. The equivalence checker confirms it against A XOR B on all four rows.

Related

See also

Compare

Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.