Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Build a Truth Table

A truth table lists every way to assign T and F to the letters of a formula and shows the value of the formula in each row. Work from the inside out: one column per subformula, filled row by row with the rule of its connective.

Recognize the task

The question says "construct the truth table", "for which values is it true", or asks for the value of a formula in every case: P∧¬QP \land \neg Q, P↔¬QP \leftrightarrow \neg Q, (P∧Q)→R(P \land Q) \to R. It is also the first step of a tautology, contradiction or equivalence check. Test: count the distinct letters nn; the table has 2n2^n rows.
Truth tables and the five connectives are introduced on the truth tables page; the rule for the arrow is in what is a logical implication.

Two ways to do it

A column for every subformulausual
¬P,P∧Q,P∨Q,P→Q,P↔Q\neg P,\quad P \land Q,\quad P \lor Q,\quad P \to Q,\quad P \leftrightarrow Q
Evaluate one connective at a time, innermost first, so each cell needs only one rule.
Hunt for the false rowsshortcut
A→B is F only when A=T, B=FA \to B \text{ is F only when } A = T,\ B = F
When the main connective is an arrow, find the rows with the left side T and the right side F, and mark every other row T; this is the material implication reading.

Steps

StepOn (P→Q)∧¬Q(P \to Q) \land \neg Q
1Count the letters and the rows. Each letter can be T or F, so nn letters give 2n2^n rows: 2, 4, 8, 16.n=2n = 2, so 22=42^2 = 4 rows
2Fill the letter columns in the standard order. The first letter column is half T, then half F; each next column halves the blocks; the last one alternates T, F. Every row is then a different assignment.PP: T, T, F, F; QQ: T, F, T, F
3List the subformulas from the inside out. Break the formula at its connectives. The last column is the whole formula; its main connective is the one applied last.P→QP \to Q, then ¬Q\neg Q, then (P→Q)∧¬Q(P \to Q) \land \neg Q
4Fill each column with one connective rule. ¬\neg flips the value; ∧\land is T only when both sides are T; ∨\lor is F only when both are F; →\to is F only for T followed by F; ↔\leftrightarrow is T when the two sides match.P→QP \to Q: T, F, T, T; ¬Q\neg Q: F, T, F, T
5Read the final column. Combine the columns with the main connective. Where the final column is T, the formula is true.PQP→Q¬Q(P→Q)∧¬QTTTFFTFFTFFTTFFFFTTT\begin{array}{c|c|c|c|c} P & Q & P \to Q & \neg Q & (P \to Q) \land \neg Q \\ \hline T & T & T & F & F \\ T & F & F & T & F \\ F & T & T & F & F \\ F & F & T & T & T \end{array}

Worked examples

Example 1 · a negated letter

2 letters
PP: T, T, F, F; QQ: T, F, T, F
standard order, 4 rows
¬Q\neg Q: F, T, F, T
flip the QQ column
P∧¬QP \land \neg Q: F, T, F, F
T only where both are T

Example 2 · a biconditional

2 letters
¬Q\neg Q: F, T, F, T
flip the QQ column
PP and ¬Q\neg Q match in rows 2 and 3
compare with PP: T, T, F, F
P↔¬QP \leftrightarrow \neg Q: F, T, T, F
T exactly where they match

Example 3 · three letters

8 rows
P∧QP \land Q: T, T, F, F, F, F, F, F
T only in the first two rows
RR: T, F, T, F, T, F, T, F
the last column alternates
(P∧Q)→R(P \land Q) \to R: T, F, T, T, T, T, T, T
F only for T followed by F
Check any table in the proposition analyzer, which prints the truth table of a formula, or see each row as a region in the Venn diagram and truth table tool.

See it happen

Each row of the table is one possible world: one choice of T or F for every letter. Each new letter doubles the number of worlds, which is why nn letters give 2n2^n rows. A formula is a rule that says T or F in each world, so listing all rows describes it completely. The columns for subformulas follow the same idea as working out an arithmetic expression from the innermost brackets outward.

Common mistakes

Counting too few rows

✗ three letters, 2⋅3=62 \cdot 3 = 6 rows
✓ three letters, 23=82^3 = 8 rows

Making the arrow false when the first part is false

✗ P→QP \to Q at P=FP = F, Q=TQ = T is F
✓ it is T; the only F row of P→QP \to Q is P=TP = T, Q=FQ = F

Reading the negation as covering the whole formula

✗ ¬P∧Q\neg P \land Q at P=TP = T, Q=FQ = F: ¬(T∧F)=T\neg(T \land F) = T
✓ ¬\neg binds tightest: ¬T∧F=F∧F=F\neg T \land F = F \land F = F

Mixing row orders

✗ two formulas tabled in different row orders, then compared row by row
✓ use one fixed order for both: T before F, first letter changing slowest