Truth table generator
Build a truth table for a logical expression and see its minterms and normal forms.
A clear answer. Here’s how.
Variables are collected in order of first appearance and every combination is evaluated; the first variable is the most significant bit of the row number. Precedence, highest first, is not, and/nand, xor/xnor, or/nor, implies (right to left), then iff. The result is classified as a tautology, contradiction or contingent, and the true rows give the minterms and the canonical sum of products (and product of sums). Expressions are parsed, never executed as code.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Logical expression
- (A and B) or not C
- Columns
- Show each sub-expression
- Values shown as
- 1 and 0
- Row order
- All false first
Example result
| A | B | C | A ∧ B | ¬C | (A ∧ B) ∨ ¬C |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 1 |
Contingent means true for some inputs and false for others. Parsed as (A ∧ B) ∨ ¬C. Minterms Σm(0, 2, 4, 6, 7), using row numbers with A as the most significant bit. Canonical sum of products: (¬A ∧ ¬B ∧ ¬C) ∨ (¬A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ ¬C) ∨ (A ∧ B ∧ ¬C) ∨ (A ∧ B ∧ C). Canonical product of sums: (A ∨ B ∨ ¬C) ∧ (A ∨ ¬B ∨ ¬C) ∧ (¬A ∨ B ∨ ¬C). Precedence, highest first: not, and/nand, xor/xnor, or/nor, implies (right to left), iff.