Maths & numbers

Truth table generator

Build a truth table for a logical expression and see its minterms and normal forms.

Truth table generator
Esc to restore

Your inputs

Operators: not ! ~ ¬ · and & ∧ · or | ∨ · xor ^ ⊕ · nand · nor · xnor · implies -> → · iff <-> ↔. Brackets, 0/1 and true/false work. Up to 8 variables.

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded, and nothing is saved unless you choose “Save result”.

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

First 5 rows of the example result
ABCA ∧ B¬C(A ∧ B) ∨ ¬C
000011
001000
010011
011000
100011

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.