NAND Gate Truth Table for 2, 3, 4, 5 Inputs
A NAND gate is a digital logic gate that provides the output LOW (0) only when all inputs are HIGH (1). The output will be HIGH (1) when at least one input is LOW (0).
Truth Tables of NAND Gate for Various Inputs
The following table shows the number of input combinations and the output behavior of NAND gates with different numbers of inputs:
| NAND Gate | Number of Inputs | Possible Combinations |
|---|---|---|
| 2-Input NAND | 2 | 4 |
| 3-Input NAND | 3 | 8 |
| 4-Input NAND | 4 | 16 |
| 5-Input NAND | 5 | 32 |
Let’s explain the truth tables of NAND gates with different numbers of inputs.
NAND Gate Truth Table for 2 Inputs
The following diagram shows the NAND Gate Truth Table for 2 Inputs.

Let’s explain the truth table of a 2-input NAND logic gate.
- A = 0, B = 0: Both inputs are LOW, so the output is 1 (HIGH).
- A = 0, B = 1: Input A is LOW, so the output becomes 1 (HIGH).
- A = 1, B = 0: Input B is LOW, so the output becomes 1 (HIGH).
- A = 1, B = 1: Both inputs are HIGH, so the output is 0 (LOW).
NAND Gate Truth Table for 3 Inputs
The following diagram shows the NAND Gate Truth Table for 3 Inputs.

Let’s explain the truth table of a 3-input NAND logic gate.
- A = 0, B = 0, C = 0: All inputs are LOW, so the output is 1 (HIGH).
- A = 0, B = 0, C = 1: Inputs A and B are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 0: Inputs A and C are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 1: Input A is LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 0: Inputs B and C are LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 1: Input B is LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 0: Input C is LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 1: All three inputs are HIGH, so the output is 0 (LOW).
NAND Gate Truth Table for 4 Inputs
The following diagram shows the NAND Gate Truth Table for 4 Inputs.

Let’s explain the truth table of a 4-input NAND logic gate.
- A = 0, B = 0, C = 0, D = 0: All inputs are LOW, so the output is 1 (HIGH).
- A = 0, B = 0, C = 0, D = 1: Inputs A, B, and C are LOW, so the output is 1 (HIGH).
- A = 0, B = 0, C = 1, D = 0: Inputs A, B, and D are LOW, so the output is 1 (HIGH).
- A = 0, B = 0, C = 1, D = 1: Inputs A and B are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 0, D = 0: Inputs A, C, and D are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 0, D = 1: Inputs A and C are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 1, D = 0: Inputs A and D are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 1, D = 1: Input A is LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 0, D = 0: Inputs B, C, and D are LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 0, D = 1: Inputs B and C are LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 1, D = 0: Inputs B and D are LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 1, D = 1: Input B is LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 0, D = 0: Inputs C and D are LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 0, D = 1: Input C is LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 1, D = 0: Input D is LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 1, D = 1: All inputs are HIGH, so the output is 0 (LOW).
NAND Gate Truth Table for 5 Inputs
The following diagram shows the NAND Gate Truth Table for 5 Inputs.

Let’s explain the truth table of a 5-input NAND logic gate.
- A = 0, B = 0, C = 0, D = 0, E = 0: All inputs are LOW, so the output is 1 (HIGH).
- A = 0, B = 0, C = 0, D = 0, E = 1: Inputs A, B, C, and D are LOW, so the output is 1 (HIGH).
- A = 0, B = 0, C = 0, D = 1, E = 0: Inputs A, B, and E are LOW, so the output is 1 (HIGH).
- A = 0, B = 0, C = 0, D = 1, E = 1: Inputs A, B, and C are LOW, so the output is 1 (HIGH).
- A = 0, B = 0, C = 1, D = 0, E = 0: Inputs A, B, and D are LOW, so the output is 1 (HIGH).
- A = 0, B = 0, C = 1, D = 0, E = 1: Inputs A, B, and D are LOW, so the output is 1 (HIGH).
- A = 0, B = 0, C = 1, D = 1, E = 0: Inputs A, B, and E are LOW, so the output is 1 (HIGH).
- A = 0, B = 0, C = 1, D = 1, E = 1: Inputs A and B are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 0, D = 0, E = 0: Inputs A, C, D, and E are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 0, D = 0, E = 1: Inputs A, C, and D are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 0, D = 1, E = 0: Inputs A, C, and E are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 0, D = 1, E = 1: Inputs A and C are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 1, D = 0, E = 0: Inputs A, D, and E are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 1, D = 0, E = 1: Inputs A and D are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 1, D = 1, E = 0: Inputs A and E are LOW, so the output is 1 (HIGH).
- A = 0, B = 1, C = 1, D = 1, E = 1: Input A is LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 0, D = 0, E = 0: Inputs B, C, D, and E are LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 0, D = 0, E = 1: Inputs B, C, and D are LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 0, D = 1, E = 0: Inputs B, C, and E are LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 0, D = 1, E = 1: Inputs B and C are LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 1, D = 0, E = 0: Inputs B, D, and E are LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 1, D = 0, E = 1: Inputs B and D are LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 1, D = 1, E = 0: Inputs B and E are LOW, so the output is 1 (HIGH).
- A = 1, B = 0, C = 1, D = 1, E = 1: Input B is LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 0, D = 0, E = 0: Inputs C, D, and E are LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 0, D = 0, E = 1: Inputs C and D are LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 0, D = 1, E = 0: Inputs C and E are LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 0, D = 1, E = 1: Input C is LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 1, D = 0, E = 0: Inputs D and E are LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 1, D = 0, E = 1: Input D is LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 1, D = 1, E = 0: Input E is LOW, so the output is 1 (HIGH).
- A = 1, B = 1, C = 1, D = 1, E = 1: All inputs are HIGH, so the output is 0 (LOW).