A truth table is a proof by exhaustion — every assignment tried, none skipped. p ∧ (q ∨ ¬r) takes 8 rows for its 3 variables, is true in 3 of them, and is therefore a contingency.
The intermediate columns are the working
A table with only the final column tells you the answer and hides how it was reached. This one builds a column for every distinct sub-expression, innermost first, so the table reads left to right as the evaluation actually happens.
p ∧ (q ∨ ¬r) produces the columns ¬r, q ∨ ¬r, p ∧ (q ∨ ¬r) — 3 of them, ending at the whole expression. Each depends only on columns to its left, which is what makes the ordering meaningful rather than arbitrary.
This matters when a table disagrees with your hand working: the first column where they differ localises the mistake. A single-column table can only tell you that something went wrong somewhere.
Three classifications, and the one that is usually the question
Every propositional expression falls into exactly one of three categories:
- Tautology — true on every row. p ∨ ¬p is one: True in every row — a tautology. The expression is true no matter what the variables are, so it carries no information about them.
- Contradiction — false on every row. p ∧ ¬p is one.
- Contingency — true on some rows and false on others, which is what most expressions are. p ∧ (q ∨ ¬r) is true on 3 of 8.
“Is this a tautology” is the question most exercises are really asking, because a tautology is a statement that holds regardless of the facts — which is what a logical law is. Every valid rule of inference is one.
Equivalence needs a counterexample, not a verdict
Two expressions are logically equivalent when their columns match on every row. When they do not, one row is enough to prove it — and that row is the useful output.
They disagree when p = T, q = F: the first is false and the second is true. One row is enough to settle it — equivalence has to hold everywhere.
That is the difference between “p → q and q → p are not equivalent” and something you can actually check by hand. The first is a claim; the second is a specific assignment you can substitute into both and see them differ.
¬(A ∧ B) and ¬A ∨ ¬B go the other way: they agree on every row, so De Morgan holds — verified here rather than quoted.
Implication is the one that looks wrong
p → q is FALSE only when p is true and q is false. In particular it is TRUE whenever p is false, whatever q does — which strikes almost everyone as wrong the first time.
The reason is that → makes a promise rather than a claim of connection. “If it rains, I will bring an umbrella” is broken only by rain and no umbrella. On a dry day the promise is not broken, regardless of the umbrella, so the statement stands.
That is why p → q and ¬p ∨ q are equivalent — the tool confirms they agree on all 4 rows. Implication is not a primitive: it is a not-or in disguise, and that identity is the cleanest way to see why the false-premise rows come out true.
Reading DNF and CNF straight off the table
Every true row can be described by one conjunction that is true on exactly that row and nowhere else. OR those conjunctions together and you have reproduced the column.
For p ∧ (q ∨ ¬r) that gives DNF = (p ∧ q ∧ r) ∨ (p ∧ q ∧ ¬r) ∨ (p ∧ ¬q ∧ ¬r). Each of the 3 true rows gives one conjunction that is true on exactly that row and nowhere else; ORing them together reproduces the column. That construction works for any column of Ts and Fs at all, which is why every truth function has a formula.
The conjunctive form comes from the false rows instead, with every literal negated: CNF = (¬p ∨ q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r) ∧ (p ∨ ¬q ∨ r) ∧ (p ∨ q ∨ ¬r) ∧ (p ∨ q ∨ r). Both are generated here and checked back against the original column — a normal form that does not reproduce the table is not one.
The consequence is worth stating: since ANY column of Ts and Fs can be built this way, every possible truth function has a formula, and ∧, ∨ and ¬ alone are enough to write all of them. That is a completeness theorem, and the construction above is its proof.
Notation, and the T and F trap
The tool accepts every common spelling: ∧ && & · * for and, ∨ || | + for or, ¬ ~ ! and a postfix prime for not, plus → -> => and ↔ <-> <=>, and the words AND OR NOT XOR NAND NOR IMPLIES IFF.
Two symbols are deliberately NOT read as constants: T and F. They are among the commonest variable letters in logic exercises, and silently turning “A ∧ F” into “A ∧ false” would answer a different question. Write TRUE, FALSE, 1 or 0 when you mean the constants.
Variable case is preserved for the same reason — a and A are different variables, and folding them together would silently merge two columns into one. Row order runs true-first, which is the logic-textbook convention; electronics tables usually count up from all-false, so a table copied from a datasheet will look reversed while saying exactly the same thing.
Sources and methodology
Propositional logic and the normal-form results are standard; the reference below covers the notation used here.
Method. Every figure on this page comes from src/lib/truth-table-generator.ts over the parser in src/lib/algebra/boolean.ts. Sub-expression columns come from a traversal of the parsed tree rather than from string matching, so a repeated sub-expression gets one column rather than two. DNF and CNF are generated from the table and then re-parsed and compared against the original. That engine is verified on every change against 57 hand-written assertions, including that both normal forms reproduce the original column exactly on every tested expression. The count and the per-case breakdown are published on the formula verification page.
Read the guide
Propositional logic and set algebra are the same structure under different symbols, De Morgan included. The Union and Intersection Calculator verifies the set version of the same laws, and the Power Set Calculator covers the 2ⁿ counting that gives a truth table its row count.