XNOR gate: truth table and symbol
An XNOR gate is a logic gate that outputs 1 when its two inputs are equal, and 0 when they differ. It is the inverse of XOR. Here are its symbol, its full truth table, the boolean expression, and how it is actually built.
XNOR gate truth table
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Boolean expression: Y = (A ⊕ B)̅. A 1 in the table means a high voltage (logic true) and a 0 means low (false). Read each row as: for these inputs, the output Y is this value.
Try the XNOR gate live
3-input XNOR gate truth table
| A | B | C | Y |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 |
A 3-input XNOR gate, defined as NOT (A XOR B XOR C), outputs 1 when an even number of inputs are 1 (none or two).
4-input XNOR gate truth table
| A | B | C | D | Y |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 0 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
A 4-input XNOR gate, defined as NOT (A XOR B XOR C XOR D), outputs 1 when an even number of inputs are 1 (none, two or four), in 8 of the 16 rows.
What the XNOR gate does
XNOR is a 1-bit equality test: its output is 1 exactly when the inputs match. Chain XNORs across two multi-bit numbers and AND the results and you have a comparator that tells you whether the numbers are equal.
Build it yourself
Reading a table is one thing; watching the signals flow is another. Open the logic gate simulator and wire an XNOR gate up from transistors, or read how the XNOR gate works in CMOS and how gates are designed. You can also generate the table for any expression with the truth table generator.
Other gates (or all seven symbols and truth tables on one page):
The XNOR gate is one small step toward a working CPU. Build every gate from CMOS transistors and work up to an 8-bit processor in the free digiwleea lab, with the free theory reference alongside.
Open the gate simulator →Frequently asked
What is an XNOR gate?
An XNOR gate is a logic gate that outputs 1 when its two inputs are equal, and 0 when they differ. It is the inverse of XOR.
What is the truth table of an XNOR gate?
The XNOR gate outputs 1 when its two inputs are equal, and 0 when they differ. It is the inverse of XOR. For inputs (A,B) the outputs are 0,0→1 0,1→0 1,0→0 1,1→1.
What does the XNOR gate symbol look like?
It is drawn as the XOR shape (the OR shield plus an extra curve on the input side) with a small circle at the output.
What is the truth table of a 3-input XNOR gate?
A 3-input XNOR gate, defined as NOT (A XOR B XOR C), outputs 1 when an even number of inputs are 1 (none or two).
What is the truth table of a 4-input XNOR gate?
A 4-input XNOR gate, defined as NOT (A XOR B XOR C XOR D), outputs 1 when an even number of inputs are 1 (none, two or four), in 8 of the 16 rows.
What is the boolean expression for XNOR?
The XNOR gate is written Y = NOT (A XOR B) (symbolically Y = (A ⊕ B)).
How many transistors does an XNOR gate take?
A CMOS XNOR gate takes about 8 transistors when built from two inverters and two transmission gates, or 12 as a fully complementary static gate (an AND-OR-INVERT plus input inverters). In digiwleea you build it from transistors and the simulator verifies it against this exact truth table.