Skip to content

XOR of three inputs is odd parity, not “exactly one”

A XOR B XOR C is TRUE when an odd number of inputs are TRUE, so it is TRUE when all three are. “Exactly one of three” is a different function, and the two differ on exactly one row.

The table compares the XOR chain with the written-out “exactly one” formula, (A AND NOT B AND NOT C) OR (NOT A AND B AND NOT C) OR (NOT A AND NOT B AND C). They agree on seven rows and differ on the row A = TRUE, B = TRUE, C = TRUE, where three is odd and the chain is TRUE while exactly-one is FALSE. The equivalence check reports that row as the counterexample.

Two-input XOR does mean “exactly one of two”, which is where the intuition comes from. But XOR is associative, so A XOR B XOR C is (A XOR B) XOR C: the first XOR is TRUE when one of A and B holds, and XOR with C then flips it, giving TRUE for one input or for three. The same holds for longer chains: a chain is TRUE for any odd count, which is why it computes parity and why the three-way light switch works.

When a rule needs exactly one of several options, write the cases out, as the worked example does, or combine “at least one” with “at most one”: (A OR B OR C) AND NOT ((A AND B) OR (A AND C) OR (B AND C)). Both forms are checked equivalent to the written-out version by the engine. The engine also has the count itself, EXACTLY(1; A, B, C): one gate, read as “exactly 1 of A, B, C”, which the counting-constraint expansion law rewrites as the written-out form.

xor_chain := A XOR B XOR C · outputexactly_one := (A AND NOT B AND NOT C) OR (NOT A AND B AND NOT C) OR (NOT A AND NOT B AND C) · output
Are xor_chain and exactly_one equivalent? No Counterexample: A = T, B = T, C = T · Exhaustively checked and solver cross-checked · 8 rows

Truth table

They differ on this row: #7

XOR of three inputs is odd parity, not “exactly one”
#ABCxor_chainexactly_one
0FALSEFALSEFALSEFALSEFALSE
1FALSEFALSETRUETRUETRUE
2FALSETRUEFALSETRUETRUE
3FALSETRUETRUEFALSEFALSE
4TRUEFALSEFALSETRUETRUE
5TRUEFALSETRUEFALSEFALSE
6TRUETRUEFALSEFALSEFALSE
7TRUETRUETRUETRUEFALSE

Plain-language reading

Beginnerxor_chain is true exactly when an odd number of A, B, and C are true (1 or 3 of them).
In every other case, xor_chain is false.
About the operators:
- A chain of XORs is true when an odd number of its parts are true. With three parts, all three being true also counts: it does not mean “exactly one”.
Intermediatexor_chain is true exactly when an odd number of A, B, and C are true (1 or 3 of them).
In every other case, xor_chain is false.
Advancedxor_chain is true exactly when an odd number of A, B, and C are true (1 or 3 of them) [parity: n-ary exclusive disjunction ⊕].
In every other case, xor_chain is false.
Formal notation: A ⊕ B ⊕ C
XOR of three inputs is odd parity, not “exactly one” XOR of three inputs is odd parity, not “exactly one” A B C xor_chainPRIMARY exactly_one XOR OR AND NOT NOT AND NOT NOT AND NOT NOT
XOR of three inputs is odd parity, not “exactly one” XOR of three inputs is odd parity, not “exactly one” A B C xor_chainPRIMARY exactly_one XOR OR AND NOT NOT AND NOT NOT AND NOT NOT

The common slip

Modelling a choice between three payment methods, or three mutually exclusive roles, as A XOR B XOR C. The rule accepts the case where all three are selected. The test that catches it is the all-TRUE row, which is the one row people rarely try.

Questions

Does =XOR() in Excel have the same reading?

Yes: with several arguments it returns TRUE when an odd number are TRUE, the same parity reading as the engine, so it has the same trap.

What is XOR of four inputs TRUE on?

On the rows with one or three TRUE inputs, eight of the sixteen. The XOR operator page shows the four-input table.

Related

Worked examples

Tools

See also

Pitfalls

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.