Truth Table Calculator
Generate the full truth table of any propositional logic expression with up to 6 variables. Use AND, OR, NOT, XOR, IMPLIES (->) and IFF (<->), or the symbols & | ! ^. The calculator tells you whether the formula is a tautology, a contradiction or contingent, counts the true rows and gives the sum-of-products (DNF) form. Example: (P -> Q) AND P gives a table with exactly one true row (P = T, Q = T).
Show steps
How to use the Truth Table Calculator
- Type your expression using single-letter variables, for example (P -> Q) AND P.
- Use NOT, AND, OR, XOR, -> (implies) and <-> (iff), or the symbols ! & | ^. Add parentheses to be explicit.
- Choose T/F or 1/0 for the table values.
- Press Calculate to get the full table, the classification and the sum-of-products form.
Formula and method
Operators and precedence (highest first): NOT, AND, XOR, OR, IMPLIES, IFF.
A truth table lists every combination of true (T) and false (F) for n variables, giving 2n rows, and shows the value of the expression for each.
Implication: P → Q is false only when P is true and Q is false. Biconditional: P ↔ Q is true when P and Q have the same value. XOR: true when exactly one input is true.
Example: (P → Q) ∧ P is true only when P = T and Q = T, so it is a contingent formula equivalent to P ∧ Q.
Basic truth tables
| P | Q | P AND Q | P OR Q | P XOR Q | P → Q | P ↔ Q |
|---|---|---|---|---|---|---|
| T | T | T | T | F | T | T |
| T | F | F | T | T | F | F |
| F | T | F | T | T | T | F |
| F | F | F | F | F | T | T |
NOT P simply flips the value: T becomes F and F becomes T.
Tautology, contradiction and contingency
A tautology is true on every row, for example P OR NOT P. A contradiction is false on every row, for example P AND NOT P. Anything else is contingent: its truth depends on the inputs. The calculator labels your expression automatically.
Logical equivalence
Two expressions are equivalent if their final columns are identical. To test De Morgan’s law, enter NOT (P AND Q) and compare it with NOT P OR NOT Q: the columns match on all four rows.
Worked example
Expression: (P -> Q) AND (Q -> R). With three variables there are eight rows. The formula is true on four of them: (P, Q, R) = (T, T, T), (F, T, T), (F, F, T) and (F, F, F). It is false when P is true and Q false, or when Q is true and R false, since either breaks one of the two implications. The sum-of-products output lists these four rows in one line.
Common laws
De Morgan: NOT (P AND Q) = NOT P OR NOT Q. Contrapositive: P → Q = NOT Q → NOT P. Distribution: P AND (Q OR R) = (P AND Q) OR (P AND R). Implication: P → Q = NOT P OR Q.
Using truth tables in computing
Digital circuits are built from logic gates that follow these tables. A truth table lists the output of a circuit for each input, and the sum-of-products form gives a direct way to build it with AND, OR and NOT gates.
Tips for large tables
Each added variable doubles the rows: 3 variables give 8, 4 give 16, 5 give 32 and 6 give 64. Use parentheses for anything beyond simple chains, because implication and equivalence are not associative.
Accuracy and limits
The table is computed exactly. The parser treats a chain of implications as right-associative (P -> Q -> R means P -> (Q -> R)). Variables are single letters, case-insensitive.
Frequently asked questions
How do I make a truth table?
List all combinations of T and F for your variables, then evaluate the expression on each row.
What is a tautology?
A formula that is true for every combination of inputs.
How many rows does a truth table have?
2 to the power of the number of variables.
When is P implies Q false?
Only when P is true and Q is false.
What does XOR mean?
Exclusive or: true when exactly one of the two inputs is true.
Sources
Related calculators
Related to This Article
More math articles
- Journey to the Edge: A Meticulous Exploration of One-Sided Limits
- Free Grade 8 English Worksheets for South Dakota Students
- The Best Grade 5 ELA Practice Tests for Michigan Students
- The Best Grade 2 Math Worksheets for Florida Students
- Organizing the Products: How to Sorting Results from Multiplying Fractions and Whole Numbers
- Can the CBEST Test be Waived?
- Pyruvate Oxidation and Krebs Cycle: Carbon and ATP Counts
- How to Master the Basics: A Comprehensive Guide to Prime Numbers, Multiples, Divisors, and Divisibility
- Completing the Puzzle: How to Finishing Equations when Multiplying Fractions by Whole Numbers Using Models
- 11 Times Table


What people say about "Truth Table Calculator: AND, OR, NOT, XOR, Implies, Iff"?
No one replied yet.