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)
XNOR(a, b)XNOR(a, b)XNOR(a, b)XNOR(a, b)2 inputs: XNOR(A, B)
| # | A | B | f |
|---|---|---|---|
| 0 | FALSE | FALSE | TRUE |
| 1 | FALSE | TRUE | FALSE |
| 2 | TRUE | FALSE | FALSE |
| 3 | TRUE | TRUE | TRUE |
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)
Same as the biconditional: A <-> B
| # | A | B | f |
|---|---|---|---|
| 0 | FALSE | FALSE | TRUE |
| 1 | FALSE | TRUE | FALSE |
| 2 | TRUE | FALSE | FALSE |
| 3 | TRUE | TRUE | TRUE |
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
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
- One-bit comparator: A greater than B
- Two-bit equality: (A1 XNOR B1) AND (A0 XNOR B0)
- XNOR built from AND, OR and NOT
Laws
Tools
- Truth table generator: any Boolean expression, up to 12 variables, with intermediate columns
- Logic circuit generator: Boolean expression to gate diagram (SVG)
See also
- XNOR elimination: XNOR(A, B) = A ↔ B
- Biconditional elimination: the A ↔ B rewrite and the ↔E rule
- Biconditional (↔, if and only if): truth table and examples
- XOR gate: truth table for 2, 3 and 4 inputs (odd parity, not “exactly one”)
- Two-bit equality: (A1 XNOR B1) AND (A0 XNOR B0)
- One-bit comparator: A greater than B
- XNOR built from AND, OR and NOT
- Double equals (==) compares values; for logical equivalence use ↔
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.