Truth Table Generator
Type any boolean expression with AND, OR, NOT, XOR, NAND or NOR and variables A–E to get its full truth table, minterms, maxterms and the canonical sum-of-products and product-of-sums forms.
How it works
Rows = 2ⁿ for n variables · each row assigns 0/1 to the variables in binary counting order · precedence: NOT > AND > XOR > OR · minterm mᵢ = row i where F = 1, maxterm Mᵢ = row i where F = 0 · canonical SOP = Σ of all minterms, canonical POS = Π of all maxterms
A truth table lists the output of a logic function for every combination of its inputs. The generator reads your expression with a strict parser (no code is executed), finds which of the variables A–E it uses, then evaluates it for all 2ⁿ input rows in standard binary order, so row numbers are the minterm indices used in Karnaugh maps and Quine–McCluskey simplification. Operator precedence follows the usual convention in digital-logic textbooks: NOT binds tightest, then AND, then XOR, then OR; juxtaposition (AB) and a trailing apostrophe (A') are accepted as AND and NOT.
Worked example
(A AND B) OR NOT C uses A, B and C, so there are 2³ = 8 rows. NOT C is 1 in rows 0, 2, 4 and 6 (C = 0), and A AND B adds row 7 (A = B = C = 1). The minterms are Σm(0, 2, 4, 6, 7), the maxterms ΠM(1, 3, 5), and F = 1 in 5 of 8 rows — a contingent function. The canonical SOP is A'B'C' + A'BC' + AB'C' + ABC' + ABC.
Sources: Truth table — Wikipedia · Canonical normal form — Wikipedia
Frequently asked questions
Which operators can I type?
AND as AND, &, *, · or simply by writing variables side by side (AB); OR as OR, | or +; NOT as NOT, !, ~, ¬ or a trailing apostrophe (A'); XOR as XOR, ^ or ⊕; and NAND, NOR, XNOR by name. Parentheses and the constants 0 and 1 also work.
In what order are the rows listed?
In binary counting order with the first variable as the most significant bit: for A, B, C the rows go 000, 001, 010 … 111. The row number in decimal is the minterm (or maxterm) index, which is how Karnaugh maps and Σm / ΠM notation refer to them.
What is the difference between minterms and maxterms?
A minterm is a product (AND) term that is 1 for exactly one row; OR-ing the minterms of the rows where F = 1 gives the canonical sum of products. A maxterm is a sum (OR) term that is 0 for exactly one row; AND-ing the maxterms of the rows where F = 0 gives the canonical product of sums. Both describe the same function.
How do I know if an expression is a tautology?
If every row outputs 1 the expression is a tautology (for example A OR NOT A); if every row outputs 0 it is a contradiction (A AND NOT A). Otherwise it is contingent — its value depends on the inputs. The generator labels which case you have.
Can two different expressions have the same truth table?
Yes — that is exactly what logical equivalence means. Compare the minterm lists: if Σm is identical, the expressions are equivalent (for example A'B' and (A + B)', by De Morgan's law). Use the boolean algebra simplifier to find the shortest equivalent form.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.