NAND Gate Explained: Universal Gate Truth Table
A NAND gate is the inverse of AND: it outputs 0 only when every input is 1. Check its truth table and use the live mini-demo.
How a NAND gate works
NAND means NOT AND. The gate first evaluates the AND condition and then inverts that result. For two inputs A and B, its Boolean expression is Y = ¬(A · B). The output is 1 for three input combinations and drops to 0 only when both inputs are 1. Comparing the NAND truth table with the AND truth table shows that every output is the opposite value.
NAND is a combinational logic gate: it reacts to current input values and does not store state. The small inversion circle on a gate symbol marks the negated output. A NAND gate can also have more inputs; it returns 0 only when all of them are 1. This simple rule makes it easy to test a design row by row.
Why NAND is called a universal gate
NAND is called universal because networks made only from NAND gates can reproduce NOT, AND, OR, and any Boolean function. A NAND gate with its inputs tied together acts as an inverter. Combining NAND outputs can build AND and OR behavior, so a designer can implement an entire combinational circuit using one gate type. This property is important in digital electronics and is a common topic in logic-gate exercises.
Use the mini-demo to toggle A and B, then compare its output with the AND table: the NAND output is the inverse on every row. In the free logic gate simulator, try wiring NAND gates to create an inverter or another basic gate. These transformations make Boolean algebra visible and help explain how digital circuits can be built from a small set of standard components.
NAND truth table
Boolean expression: Y = ¬(A · B)
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Use the interactive controls on this page to toggle the inputs and see the output change.
Frequently asked questions
When does a NAND gate output 0?
A two-input NAND gate outputs 0 only when both inputs are 1. For all other input pairs, it outputs 1.
Why is NAND called a universal gate?
You can combine NAND gates to build NOT, AND, OR, and any Boolean function, so a circuit can be made using NAND alone.