Truth table generator for Boolean and propositional logic
This truth table generator takes any Boolean expression — written with words such as A AND (B OR NOT C), engineering symbols such as (A+B)'C, or logic symbols such as (p → q) ∧ ¬q — and prints every combination of inputs with the value of the expression. Intermediate columns show each sub-expression, so you can follow how the final answer is built, exactly the way a discrete-maths or digital-electronics course expects the working to be set out.
Under the table you get the minterms and maxterms, the canonical sum-of-products and product-of-sums forms, and a minimal SOP and POS found with the Quine–McCluskey algorithm. The result box tells you whether the expression is a tautology, a contradiction or a contingency, which is the quickest way to verify an equivalence such as De Morgan’s law.
Tables can be copied as Markdown (for GitHub, Notion or Obsidian), CSV (for Excel or Google Sheets) or a LaTeX array, or downloaded as a CSV file. Everything runs in your browser.
How to use the Truth Table Generator
- Type the expression in the Boolean expression box. Variables can be single letters (A, p) or words (Cin, Reset); constants are 1/0 or TRUE/FALSE.
- Use any notation you like: AND, ∧, &, ·, * or simply writing variables next to each other; OR, ∨, |, +; NOT, ¬, !, ~ or a trailing apostrophe; XOR ⊕ ^; NAND, NOR, XNOR; → or -> for implication; ↔ or <-> for the biconditional.
- The table appears immediately. Tick Show intermediate columns to include every sub-expression, choose 1/0 or T/F, and tick 1 first if your course lists the true rows first.
- Read the minterms Σm(…), maxterms ΠM(…), canonical SOP/POS and minimal forms in the list under the table.
- Press Copy Markdown, Copy CSV, Copy LaTeX or Download CSV to use the table elsewhere.
Truth Table Generator features
Every common notation
Words, C-style operators (&&, ||, !, ^), electronics notation (A·B, A+B, A'), and logic symbols (∧ ∨ ¬ ⊕ → ↔ ⊼ ⊽) can even be mixed in one expression.
Correct precedence
NOT binds tightest, then AND/NAND, XOR/XNOR, OR/NOR, implication (right-associative, so A → B → C means A → (B → C)) and finally the biconditional. Parentheses override everything.
Intermediate columns
Each distinct sub-expression gets a column in evaluation order, with minimal parentheses in the headings.
Minterms, maxterms, SOP and POS
Canonical forms are listed from the table, and a Quine–McCluskey pass with Petrick’s method gives a minimal sum of products and product of sums.
Tautology and contradiction check
The summary line says whether the expression is always true, always false or depends on the inputs — handy for checking logical equivalences.
Three export formats
Markdown with centred columns, CSV with a UTF-8 byte-order mark for Excel, and a LaTeX array with ∧, ∨ and ¬ converted to \land, \lor and \lnot.
Operators and their truth values
| Operator | Symbols accepted | True when |
|---|---|---|
| NOT | ¬A, NOT A, !A, ~A, A' | A is false |
| AND | A ∧ B, A AND B, A & B, A·B, AB | both are true |
| OR | A ∨ B, A OR B, A | B, A + B | at least one is true |
| XOR | A ⊕ B, A XOR B, A ^ B | exactly one is true |
| NAND / NOR | A NAND B, A ⊼ B / A NOR B, A ⊽ B | not both / neither |
| XNOR | A XNOR B, A ⊙ B | both the same |
| Implication | A → B, A -> B, A IMPLIES B | A is false or B is true |
| Biconditional | A ↔ B, A <-> B, A IFF B | both have the same value |
Worked example: A AND (B OR NOT C)
With three variables there are 2³ = 8 rows, numbered 0–7 by reading ABC as a binary number. The intermediate columns are ¬C and B ∨ ¬C; the final column is 1 only when A = 1 and (B ∨ ¬C) = 1, which happens in rows 4 (100), 6 (110) and 7 (111). So the minterm list is Σm(4, 6, 7), the canonical SOP is AB'C' + ABC' + ABC, and after minimisation this collapses to AB + AC' — the same result a Karnaugh map would give. The maxterms are the other five rows, ΠM(0, 1, 2, 3, 5), and the minimal POS is A(B + C').
Tips for logic homework and circuit design
- To prove two expressions are equivalent, join them with ↔ and check for “Tautology”. For example
NOT (A AND B) <-> (NOT A OR NOT B)is a tautology, confirming De Morgan’s law. - To test an argument, write (premise₁ ∧ premise₂) → conclusion; a valid argument is a tautology.
- Juxtaposition means AND, so
AB + Cis read as (A ∧ B) ∨ C, matching textbook Boolean algebra. - For circuit minimisation with don’t-care conditions, take the minterm list to the Karnaugh map solver, which draws the groupings. For operations on binary words rather than single bits, use the bitwise calculator.
- Up to 10 variables (1,024 rows) are supported; the canonical forms are abbreviated above 64 terms to keep the page readable.
Truth Table Generator FAQ
How do I make a truth table for an expression with three variables?
Type the expression, for example A AND (B OR NOT C). The generator lists all 8 combinations of A, B and C with the sub-expression columns and the result, plus the minterms and simplified forms.
What is the order of the rows?
Rows count up in binary with the first variable as the most significant bit: 000, 001, 010 … The row number is the minterm index. Tick “1 first” to reverse the order.
How does the generator decide the variable order?
Variables are listed in the order they first appear in the expression. Reorder them in the expression if you need a different column order.
What are minterms and maxterms?
A minterm is a row where the output is 1, written as a product of all variables (A B' C for row 101). A maxterm is a row where the output is 0, written as a sum (A + B' + C'). Σm and ΠM list their row numbers.
Is A → B → C read from the left or the right?
From the right, as in standard logic: A → (B → C). Use parentheses if you mean (A → B) → C, which has a different table.
Can I paste the table into Word or Excel?
Yes. Copy CSV and paste into Excel or Google Sheets, or download the CSV file; for Word paste the Markdown into any Markdown converter, or use the LaTeX array in Overleaf.