About the Truth Table Generator
This truth table generator evaluates a Boolean expression for every possible combination of its inputs and lays out the result as a truth table. Type an expression such as (A AND B) OR NOT C, A·B + C', !(A & B) | C or A -> B and it lists every row, along with the minterm (Σm) and maxterm (ΠM) lists, the canonical sum-of-products and product-of-sums forms, and whether the expression is a tautology, a contradiction or contingent.
It accepts the notations you will meet in digital electronics, discrete maths and programming: words (AND, OR, NOT, XOR, NAND, NOR, XNOR), symbols (&, |, !, ~, ^, +, ·, *, ∧, ∨, ¬, ⊕, →, ↔) and the textbook prime for NOT (A'). Writing two variables side by side, as in AB, means A AND B. Put several expressions on separate lines to compare them column by column — useful for proving that two circuits or De Morgan forms are equivalent.
Variables are single letters A–Z (case-insensitive), and up to six variables (64 rows) are supported so the table stays readable. Rows are ordered as binary counting with the alphabetically first variable as the most significant bit, which matches Karnaugh map and minterm numbering conventions.
How to use the truth table generator
- 1Type a logic expression using single-letter variables, e.g. (A AND B) OR NOT C.
- 2Add more expressions on new lines to compare them side by side.
- 3Choose whether to display 1/0 or T/F.
- 4Read the truth table, minterms, maxterms and canonical forms.
- 5Use the equivalence note to check whether two expressions match.
Formula and method
A truth table lists the output of a logic function for every combination of its n inputs, so it always has 2ⁿ rows. The generator parses your expression with the usual precedence — NOT binds tightest, then AND (and NAND), then XOR (and XNOR), then OR (and NOR), then implication and equivalence — and evaluates it row by row, counting in binary with the first variable alphabetically as the most significant bit.
The row numbers where the output is 1 are the minterms; writing a product term (AND of every variable, complemented where the bit is 0) for each and ORing them gives the canonical sum of products. The rows where the output is 0 are the maxterms; ORing each variable (complemented where the bit is 1) and ANDing those sums gives the canonical product of sums. Both canonical forms describe exactly the same function as your expression.
- n
- Number of distinct variables
- A', ¬A, !A
- NOT A
- AB, A·B, A & B
- A AND B
- A + B, A | B
- A OR B
- A ⊕ B, A ^ B
- A XOR B
- A → B
- Implication: NOT A OR B
Worked examples
(A AND B) OR NOT C
With three variables there are 2³ = 8 rows. The output is 1 whenever C is 0 (rows 0, 2, 4, 6) and also when A and B are both 1 (rows 6 and 7), giving minterms 0, 2, 4, 6 and 7.
Implication A -> B
An implication is false only when the premise is true and the conclusion false (A = 1, B = 0, row 2). Every other row is true, so the canonical SOP is A'B' + A'B + AB and the single maxterm is (A' + B).
Three-input parity: A XOR B XOR C
XOR outputs 1 when an odd number of inputs are 1: rows 001, 010, 100 and 111, i.e. minterms 1, 2, 4 and 7. This is the odd-parity function used in error detection.
Law of excluded middle
A OR NOT A is true whether A is 0 or 1, so both rows are minterms and the expression is a tautology.
Frequently asked questions
How many rows does a truth table have?+
A truth table has 2ⁿ rows for n input variables: 4 rows for two inputs, 8 for three, 16 for four and 64 for six. Each row is one combination of 0s and 1s, usually listed in binary counting order.
What symbols can I use for AND, OR and NOT?+
AND: AND, &, &&, *, · or ∧, or simply write variables together (AB). OR: OR, |, ||, + or ∨. NOT: NOT, !, ~, ¬ or a trailing apostrophe (A'). XOR: XOR, ^ or ⊕. Implication: -> or →; equivalence: <-> or ↔.
What are minterms and maxterms?+
A minterm is a row where the function is 1, written as a product of all variables (e.g. A'BC for row 3). A maxterm is a row where it is 0, written as a sum (e.g. A + B' + C' for row 3). A function equals the OR of its minterms or the AND of its maxterms.
How do I check if two logic expressions are equivalent?+
Enter both expressions on separate lines. If their output columns match in every row they are logically equivalent, and the tool tells you so — a quick way to verify De Morgan's laws or a simplified circuit.
What is the order of operations in Boolean logic?+
NOT is applied first, then AND, then OR — just like negation, multiplication and addition in ordinary algebra. This tool places XOR between AND and OR, and implication and equivalence last. Use parentheses whenever in doubt.