Skip to content

XOR identities: A XOR FALSE = A, A XOR TRUE = NOT A, A XOR A = FALSE

The XOR identities: XOR with FALSE leaves a value unchanged, XOR with TRUE negates it, and a value XOR itself is FALSE.

Engine name: XOR identitiesFR: Identités du XORDE: XOR-Identitäten

XOR with FALSE leaves a value unchanged, XOR with TRUE negates it, and a value XOR itself is FALSE.

XOR is true exactly when its operands differ. Against FALSE, that means “true when A is true”, so A XOR FALSE = A. Against TRUE, it means “true when A is false”, so A XOR TRUE = NOT A, which makes XOR a controllable inverter: the second input decides whether the first is passed through or flipped. And a value never differs from itself, so A XOR A = FALSE.

These three identities are why XOR chains compute parity: every pair of equal inputs cancels, and what remains is whether an odd number of inputs are true. They are also why XOR is used to toggle bits and to build the sum of a half adder.

The truth tables below prove each identity on its rows, and the XOR operator page shows the three- and four-input tables that the parity reading relies on.

Statement

A XOR FALSE = AA XOR TRUE = NOT AA XOR A = FALSE

Proof by truth table: A XOR FALSE = A

A XOR FALSE = A
#Alhsrhs
0FALSEFALSEFALSE
1TRUETRUETRUE
lhs ≡ rhs holds · lhs and rhs agree on every assignment. · Exhaustively checked and solver cross-checked · 2 rows

The same law in four notations

WordsA XOR FALSE
ProgrammingA XOR FALSE
MathematicalA ⊕ 0
AlgebraA ⊕ 0
LaTeXA \oplus 0
WordsA
ProgrammingA
MathematicalA
AlgebraA
LaTeXA
A XOR FALSE = A A XOR FALSE = A A lhsPRIMARY rhs XOR FALSE
A XOR FALSE = A A XOR FALSE = A A lhsPRIMARY rhs XOR FALSE

Proof by truth table: A XOR TRUE = NOT A

A XOR TRUE = NOT A
#Alhsrhs
0FALSETRUETRUE
1TRUEFALSEFALSE
lhs ≡ rhs holds · lhs and rhs agree on every assignment. · Exhaustively checked and solver cross-checked · 2 rows

The same law in four notations

WordsA XOR TRUE
ProgrammingA XOR TRUE
MathematicalA ⊕ 1
AlgebraA ⊕ 1
LaTeXA \oplus 1
WordsNOT A
Programming!A
Mathematical¬A
AlgebraA'
LaTeX\overline{A}
A XOR TRUE = NOT A A XOR TRUE = NOT A A lhsPRIMARY rhs XOR TRUE NOT
A XOR TRUE = NOT A A XOR TRUE = NOT A A lhsPRIMARY rhs XOR TRUE NOT

Proof by truth table: A XOR A = FALSE

A XOR A = FALSE
#Alhsrhs
0FALSEFALSEFALSE
1TRUEFALSEFALSE
lhs ≡ rhs holds · lhs and rhs agree on every assignment. · Exhaustively checked and solver cross-checked · 2 rows

The same law in four notations

WordsA XOR A
ProgrammingA XOR A
MathematicalA ⊕ A
AlgebraA ⊕ A
LaTeXA \oplus A
WordsFALSE
ProgrammingFALSE
Mathematical0
Algebra0
LaTeX0
A XOR A = FALSE A XOR A = FALSE A lhsPRIMARY rhs XOR FALSE
A XOR A = FALSE A XOR A = FALSE A lhsPRIMARY rhs XOR FALSE

The common slip

Expecting A XOR A to be A, by analogy with A OR A. XOR is not idempotent; it cancels.

Questions

Is XOR associative and commutative?

Yes to both, which is why A XOR B XOR C needs no brackets and reads the same in any order: it is true when an odd number of the three are true.

Related

Lesson that teaches this

Pitfalls

Tools

See also

Laws

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.