Skip to content

XNOR gate: truth table, symbol and equivalence with the biconditional

XNOR is TRUE when its two inputs are equal: both TRUE or both FALSE. It is the negation of XOR, the gate of an equality comparator, and the same function as the biconditional A <-> B.

The two-input table has two TRUE rows, A = B = FALSE and A = B = TRUE, and two FALSE rows where the inputs differ. The second table below is A <-> B, the logician's biconditional, and the two columns are identical; the engine proves XNOR(A, B) = A <-> B as a law, so you may write whichever spelling suits the audience. Like NAND and NOR, XNOR is accepted only as XNOR(A, B) with two operands.

Written with AND, OR and NOT, XNOR is (A AND B) OR (NOT A AND NOT B), one term per TRUE row; the biconditional elimination law proves it. Negating XOR's product-of-sums form gives the same thing. In a diagram the gate is the XOR shape with a bubble on its output.

The practical use is comparison. Two bits are equal when their XNOR is TRUE, and two two-bit numbers are equal when both bitwise XNORs are, which is the worked example on two-bit equality. For three or more inputs there is no XNOR chain in the language; “all equal” must be written out, and NOT (A XOR B XOR C) is even parity, a different function that is TRUE on the row where exactly two inputs are TRUE.

Accepted spellings

XNOR(a, b)

WordsXNOR(a, b)
ProgrammingXNOR(a, b)
MathematicalXNOR(a, b)
AlgebraXNOR(a, b)

2 inputs: XNOR(A, B)

XNOR(A, B)
#ABf
0FALSEFALSETRUE
1FALSETRUEFALSE
2TRUEFALSEFALSE
3TRUETRUETRUE
Beginnerf is true exactly when A and B have the same value (both true or both false).
In every other case, f is false.
About the operators:
- XNOR is true when both parts have the same value.
Intermediatef is true exactly when A and B have the same value (both true or both false).
In every other case, f is false.
Advancedf is true exactly when A and B have the same value (both true or both false) [equivalence gate (XNOR)].
In every other case, f is false.
Formal notation: XNOR(A, B)
XNOR(A, B) XNOR(A, B) A B f XNOR
XNOR(A, B) XNOR(A, B) A B f XNOR

Same as the biconditional: A <-> B

A <-> B
#ABf
0FALSEFALSETRUE
1FALSETRUEFALSE
2TRUEFALSEFALSE
3TRUETRUETRUE
Beginnerf is true exactly when A and B have the same value (both true or both false).
In every other case, f is false.
About the operators:
- A biconditional (↔) is true when both sides have the same value.
Intermediatef is true exactly when A and B have the same value (both true or both false).
In every other case, f is false.
Advancedf is true exactly when A and B have the same value (both true or both false) [biconditional ↔].
In every other case, f is false.
Formal notation: A ↔ B
A <-> B A <-> B A B f ↔
A <-> B A <-> B A B f ↔

The common slip

Writing A == B for “A equals B”. The parser rejects == with a repair to <->, because == compares values in code while the biconditional is the logical operator. XNOR, <-> and “if and only if” all name this one function.

Questions

Is XNOR the same as logical equivalence?

XNOR(A, B) is a formula that is TRUE on the rows where A and B agree. Two formulas F and G are logically equivalent when they agree on every row, that is, when F <-> G is a tautology; the equivalence checker tests exactly that.

How is XNOR built from NAND or NOR gates?

The NOR-only construction of A <-> B uses five gates and the NAND-only one eleven, by the engine's count on the converter page; the biconditional is cheaper in the NOR family because its product-of-sums form is short.

Related

Guides

Worked examples that use it

Laws

Tools

See also

Operators and gates

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.