Type a boolean or propositional logic expression in words or symbols. The generator builds the complete truth table with optional sub-expression columns, lists minterms and maxterms, writes the canonical DNF and CNF and tells you whether it is a tautology.
Last updated:
Use AND & && ∧ · *, OR | || ∨ +, NOT ! ~ ¬ or a postfix ', XOR ^ ⊕, NAND, NOR, XNOR, IMPLIES -> →, IFF <-> ↔, constants 0 1 true false.
Enter your values to see the result.
Advertisement
Advertisement
How to use the Truth Table Generator
Type an expression such as (A AND B) OR NOT C or (p -> q) && !r. Put several expressions on separate lines to compare them.
Choose the layout: column order, whether the first row is all false or all true, and 1/0 or T/F values.
Press Generate Truth Table. The table updates as you type.
Read the summary: how many rows are true, the minterm and maxterm lists and whether the expression is a tautology.
Copy the DNF or CNF from the boxes under the table, or download the table as CSV.
Logical operators and how to type them
Operator
You can type
True when
Precedence
NOT (negation)
NOT A, !A, ~A, ¬A, A'
A is false
1 (strongest)
AND (conjunction)
AND, &, &&, ∧, ·, *
both inputs are true
2
NAND
NAND, ↑
not both inputs are true
2
XOR (exclusive or)
XOR, ^, ⊕, !=
exactly one input is true
3
XNOR
XNOR
both inputs are equal
3
OR (disjunction)
OR, |, ||, ∨, +
at least one input is true
4
NOR
NOR, ↓
both inputs are false
4
IMPLIES (conditional)
IMPLIES, ->, =>, →
not (left true and right false)
5, groups right to left
IFF (biconditional)
IFF, <->, <=>, ↔, ==
both sides have the same value
6 (weakest)
Variable names can be words (rain AND cold) or letters. Tick Single-letter variables to read AB as A AND B, the way digital-logic textbooks write products. Note that ^ means XOR here, as in most programming languages; type ∧ or AND for conjunction.
Worked example: (A AND B) OR NOT C
#
A
B
C
A ∧ B
¬C
Result
0
0
0
0
0
1
1
1
0
0
1
0
0
0
2
0
1
0
0
1
1
3
0
1
1
0
0
0
4
1
0
0
0
1
1
5
1
0
1
0
0
0
6
1
1
0
1
1
1
7
1
1
1
1
0
1
The output is 1 in rows 0, 2, 4, 6 and 7, so the minterm list is Σm(0, 2, 4, 6, 7) and the maxterm list is ΠM(1, 3, 5). The canonical DNF has five terms, but the same function simplifies to just AB + C'.
Tips for building truth tables by hand
Count in binary. List rows 0 to 2ⁿ − 1; the last variable alternates every row, the one before it every two rows, and so on.
Add a column per sub-expression. Evaluate the innermost brackets first and build outwards; it makes mistakes easy to spot.
Use the cheap rows. An AND is 0 as soon as one input is 0, an OR is 1 as soon as one input is 1, and an implication is 1 whenever its left side is 0.
Check equivalences with two lines. De Morgan's laws, contrapositives (p → q vs ¬q → ¬p) and distributive laws can all be confirmed by comparing columns.
Frequently asked questions
How many rows does a truth table have?
A truth table with n variables has 2ⁿ rows, one for every combination of true and false. Two variables give 4 rows, three give 8, four give 16 and ten give 1,024. This generator supports up to 12 variables (4,096 rows).
What is the order of operations in boolean logic?
The usual precedence, from strongest to weakest, is NOT, AND, XOR, OR, IMPLIES and then IFF (biconditional). So A OR B AND C means A OR (B AND C), and p -> q -> r means p -> (q -> r). The tool shows the fully bracketed version of your expression so you can confirm how it was read.
When is an implication p → q false?
Only when p is true and q is false. In every other row, including both rows where p is false, the implication is true. That is why p → q is equivalent to ¬p ∨ q, which you can verify by entering both on separate lines.
What are minterms and maxterms?
A minterm is an AND of all variables (each plain or negated) that is true in exactly one row; the rows where the output is 1 give the minterm list Σm. A maxterm is an OR of all variables that is false in exactly one row; the rows where the output is 0 give the maxterm list ΠM. Row numbers are the binary value of the inputs with the first variable as the most significant bit.
What is the difference between DNF and CNF?
Disjunctive normal form (DNF) is an OR of AND terms, and the canonical DNF is the OR of all minterms. Conjunctive normal form (CNF) is an AND of OR clauses, and the canonical CNF is the AND of all maxterms. Both describe the same function; they are usually not the shortest form, which is what a boolean simplifier finds.
How do I check if two logic expressions are equivalent?
Enter each expression on its own line. Two expressions are logically equivalent when their output columns match in every row. The result cards say Equivalent or list the row numbers where they differ, which is a quick way to check De Morgan's laws or a homework answer.
What is a tautology?
A tautology is an expression that is true in every row, such as p ∨ ¬p or ((p → q) ∧ p) → q. A contradiction is false in every row, and anything in between is called contingent. An expression is satisfiable if at least one row is true.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.