What Is a Truth Table?
A truth table is a systematic way to show all possible truth values of a logical expression. For each combination of true (T) and false (F) values for the variables, the table shows whether the entire expression evaluates to T or F. Truth tables are the foundation of propositional (Boolean) logic, used in mathematics, philosophy, computer science, and electrical engineering.
A logical expression with n variables has 2ⁿ rows. One variable: 2 rows. Two variables: 4 rows. Three variables: 8 rows. Four variables: 16 rows.
The Basic Connectives
AND (∧)
AND is true only when both inputs are true.
| A | B | A AND B |
|---|---|---|
| F | F | F |
| F | T | F |
| T | F | F |
| T | T | T |
OR (∨)
OR is true when at least one input is true.
| A | B | A OR B |
|---|---|---|
| F | F | F |
| F | T | T |
| T | F | T |
| T | T | T |
NOT (¬)
NOT flips the truth value.
| A | NOT A |
|---|---|
| F | T |
| T | F |
XOR (⊕) — Exclusive OR
XOR is true when exactly one input is true (but not both).
| A | B | A XOR B |
|---|---|---|
| F | F | F |
| F | T | T |
| T | F | T |
| T | T | F |
Worked Example
Expression: A AND B
Variables: A, B — two variables → 4 rows
| A | B | A AND B |
|---|---|---|
| F | F | F |
| F | T | F |
| T | F | F |
| T | T | T |
Result: A AND B is true in 1 out of 4 rows — only when both A and B are true.
NAND and NOR
NAND (NOT AND) and NOR (NOT OR) are the negations of AND and OR. They are the foundation of digital circuit design — any logical circuit can be built from NAND gates alone (NAND universality), or from NOR gates alone.
| A | B | A NAND B | A NOR B |
|---|---|---|---|
| F | F | T | T |
| F | T | T | F |
| T | F | T | F |
| T | T | F | F |
Material Implication (IMPLIES, →)
IMPLIES (A → B) models “if A then B.” It is false only when the premise A is true and the conclusion B is false.
| A | B | A → B |
|---|---|---|
| F | F | T |
| F | T | T |
| T | F | F |
| T | T | T |
The rows where A is false are called “vacuously true” — a false premise implies anything. This is the standard definition in classical logic, even though it differs from everyday causal language (“if it rains, the ground gets wet” does not imply that the ground stays dry when it is not raining).
Biconditional (IFF, ↔)
IFF (if and only if) is true when both sides have the same truth value.
| A | B | A ↔ B |
|---|---|---|
| F | F | T |
| F | T | F |
| T | F | F |
| T | T | T |
A ↔ B is equivalent to (A → B) AND (B → A).
Operator Precedence
When reading a complex expression without parentheses, operators bind in this order (highest to lowest):
- NOT (¬) — binds most tightly
- AND (∧), NAND
- XOR (⊕), NOR
- OR (∨)
- IMPLIES (→)
- IFF (↔) — binds most loosely
So A OR B AND C means A OR (B AND C), not (A OR B) AND C. Use parentheses to override precedence.
Tautologies and Contradictions
A tautology is a formula that is always true — every row in the Result column is T.
Classic tautology: A OR NOT A (law of excluded middle)
| A | NOT A | A OR NOT A |
|---|---|---|
| F | T | T |
| T | F | T |
A contradiction is a formula that is always false — every row is F.
Classic contradiction: A AND NOT A
| A | NOT A | A AND NOT A |
|---|---|---|
| F | T | F |
| T | F | F |
A formula that is neither a tautology nor a contradiction is satisfiable — it is true for at least one assignment but not all.
Building Truth Tables Step by Step
- List all variables (A, B, C, D — up to 4).
- Create 2ⁿ rows, cycling T and F so each combination appears exactly once.
- Evaluate sub-expressions from innermost parentheses outward.
- Compute the final column for the full expression.
- Check: if all F → contradiction; if all T → tautology; otherwise → satisfiable.
Tip: Always resolve NOT first (highest precedence), then AND/NAND, then XOR/NOR, then OR, then IMPLIES, then IFF.