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
Truth table (4 rows)
| # | A | B | inclusive_or | exclusive_or |
|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE |
| 1 | FALSE | TRUE | TRUE | TRUE |
| 2 | TRUE | FALSE | TRUE | TRUE |
| 3 | TRUE | TRUE | TRUE | FALSE |
Logic diagram
Karnaugh map
- cells m2, m3
A - cells m1, m3
B
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 B1 clauses, 2 literals · complete
Disjunctive normal form (DNF)
A OR B2 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
- OR gate: truth table for 2, 3 and 4 inputs, inclusive or explained
- XOR gate: truth table for 2, 3 and 4 inputs (odd parity, not “exactly one”)
- Inclusive vs exclusive or (OR vs XOR), with truth table
- XOR of three inputs is odd parity, not “exactly one”
- XOR identities: A XOR FALSE = A, A XOR TRUE = NOT A, A XOR A = FALSE
- Absorption law: A OR (A AND B) = A, with proof
- Lesson 2: XOR: exclusive OR and parity (beginner, 10 min)
- XOR built from AND, OR and NOT
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.