NAND Gate Truth Table
In Logic Gates, a truth table represent all possible combinations of binary input and their corresponding binary outputs. NAND Logic Gate is a very basic digital logic gate that produces an output of 0 (LOW) when all inputs are 1 (High). The output becomes 1 (High) when at least one input is 0 (LOW).
The following diagram represent the very basic Boolean Expression, NAND Gate Symbol, and NAND Gate Truth Table.

NAND Gate Truth Table
Truth tables represent all possible input combinations and their corresponding outputs for a logic gate. NAND Gate truth tables for various numbers of inputs are explained below
|
The total possible input combinations in a truth table are calculated using 2ⁿ, where n is the number of inputs. For example:
and so on… |
Let’s explain various truth tables of NAND Logic gate for different numbers of inputs
NAND Gate Truth Table – 2 Inputs
For 2-input NAND Gate, there are 22=4 possible input combinations, explained below.
- Input A Column: First 2 bits = 0, next 2 bits = 1
- Input B Column: Alternates 0 and 1
The truth table of 2 inputs NAND Gate with their output is given below

In the above NAND gate truth table of 2 inputs
- For A=0 and B = 0, the output (X) will be 1 because neither input is active.
- For A=0 and B = 1, the output (X) will be 1 because the A input is 0.
- For A=1 and B = 0, the output (X) will be 1 because the B input is 0.
- For A=1 and B =1, the output (X) will be 0 because both inputs are 1.
NAND Gate Truth Table – 3 Inputs
For 3-input NAND Gate, there are 23=8 possible input combinations, explained below.
- Input A Column: First 4 bits = 0, next 4 bits = 1
- Input B Column: First 2 bits = 0, next 2 = 1, next 2 = 0, next 2 = 1
- Input C Column: Alternates 0 and 1
The truth table of 3 inputs NAND Gate with their output is given below

In the above NAND gate truth table of 3 inputs
- For A = 0, B = 0, and C = 0, the output (X) will be 1 because all inputs are 0.
- For A=0, B = 0, and C = 1, the output (X) will be 1 because the A and B inputs are 0.
- For A=0, B = 1, and C = 0, the output (X) will be 1 because the A and C inputs are 0.
- For A=0, B = 1, and C = 1, the output (X) will be 1 because the A input is 0.
- For A=1, B = 0, and C = 0, the output (X) will be 1 because B and C inputs are 0.
- For A=1, B = 0, and C = 1, the output (X) will be 1 because the B input is 0.
- For A=1, B = 1, and C = 0, the output (X) will be 1 because the C input is 0.
- For A=1, B =1, and C = 1, the output (X) will be 0 because all inputs (A, B,C) are 1.
NAND Gate Truth Table – 4 Inputs
For 4-input NAND Gate, there are 24=16 possible input combinations, explained below.
- Input A Column: First 8 bits = 0, next 8 bits = 1
- Input B Column: First 4 bits = 0, next 4 = 1, next 4 = 0, next 4 = 1
- Input C Column: 2 zeros, 2 ones, repeated
- Input D Column: Alternates 0 and 1
The truth table of 4 inputs NAND Gate with their output is given below

In the above NAND gate truth table of 4 inputs
- For A = 0, B = 0, C = 0, and D = 0, the output (X) will be 1 because all inputs are 0.
- For A=0, B = 0, C = 0, and D = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=0, B = 0, C = 1, and D = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=0, B = 0, C = 1, and D = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=0, B = 1, C = 0, and D = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=0, B = 1, C = 0, and D = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=0, B = 1, C = 1, and D = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=0, B =1, C = 1, and D = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A = 1, B = 0, C = 0, and D = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=1, B = 0, C = 0, and D = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=1, B = 0, C = 1, and D = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=1, B = 0, C = 1, and D = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=1, B = 1, C = 0, and D = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=1, B = 1, C = 0, and D = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=1, B = 1, C = 1, and D = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, and D).
- For A=1, B =1, C = 1, and D = 1, the output (X) will be 0 because all inputs (A, B, C, and D) are 1.
NAND Gate Truth Table – 5 Inputs
For 5-input NAND Gate, there are 25=32 possible input combinations, explained below.
- Input A Column: First 16 bits = 0, next 16 bits = 1
- Input B Column: First 8 bits = 0, next 8 = 1, next 8 = 0, next 8 = 1
- Input C Column: 4 zeros, 4 ones, repeated
- Input D Column: 2 zeros, 2 ones, repeated
- Input E Column: Alternates 0 and 1
The truth table of 5 inputs NAND Gate with their output is given below

In the above NAND gate truth table of 5 inputs
- For A = 0, B = 0, C = 0, D = 0, and E = 0, the output (X) will be 1 because all inputs are 0.
- For A=0, B = 0, C = 0, D = 0, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B = 0, C = 0, D = 1, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B = 0, C = 0, D = 1, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B = 0, C = 1, D = 0, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B = 0, C = 1, D = 0, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B = 0, C = 1, D = 1, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B =0, C = 1, D = 1, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A =0, B = 1, C = 0, D = 0, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B = 1, C = 0, D = 0, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B = 1, C = 0, D = 1, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B = 1, C = 0, D = 1, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B = 1, C = 1, D = 0, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B = 1, C = 1, D = 0, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B = 1, C = 1, D = 1, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=0, B =1, C = 1, D = 1, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A = 1, B = 0, C = 0, D = 0, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 0, C = 0, D = 0, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 0, C = 0, D = 1, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 0, C = 0, D = 1, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 0, C = 1, D = 0, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 0, C = 1, D = 0, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 0, C = 1, D = 1, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B =0, C = 1, D = 1, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A = 1, B = 1, C = 0, D = 0, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 1, C = 0, D = 0, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 1, C = 0, D = 1, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 1, C = 0, D = 1, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 1, C = 1, D = 0, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 1, C = 1, D = 0, and E = 1, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B = 1, C = 1, D = 1, and E = 0, the output (X) will be 1 because at least one input is 0 from the given inputs (A, B, C, D, and E).
- For A=1, B =1, C = 1, D = 1, and E = 1, the output (X) will be 0 because all inputs (A, B, C, D, and E) are 1.