Truth tables look like bureaucratic grids until you watch one being filled. Each row is a separate possible world — a specific assignment of true and false to the propositions — and the final column is the verdict the connective delivers in that world. Walking through the rows one at a time, instead of memorising a 4 \times 4 block, is how logic stops being rote and starts being a set of mechanical rules your hand can execute in seconds.

The table as a walk through worlds

For a two-proposition connective, there are four worlds — the four combinations of truth values for p and q. The truth table lists them in a canonical order. Each row contains the inputs and the verdict.

Below, you can build any propositional expression from buttons — p, q, r, \land, \lor, \lnot, \to, brackets. The canvas parses your expression into a tree and fills in the truth table row by row. For each row, a green-or-red pulse cascades up the tree — from the leaves (where you set p,q) all the way to the root — lighting each node with the sub-formula's verdict in that world.

Pick a preset or tap the buttons to write your own formula. Press Step row to evaluate one world at a time: the two (or three) atomic propositions on the left are assigned, and the verdict climbs the tree from the leaves up to the root, lighting nodes green for $\mathbf{T}$ and red for $\mathbf{F}$. The truth table on the right fills in row by row as the cascade completes.

The five canonical tables

Four connectives take two inputs; one (\lnot) takes one. Each has a distinct signature in its verdict column.

\begin{array}{cc|c|c|c|c} p & q & p \land q & p \lor q & p \to q & p \leftrightarrow q \\ \hline \mathbf{T} & \mathbf{T} & \mathbf{T} & \mathbf{T} & \mathbf{T} & \mathbf{T} \\ \mathbf{T} & \mathbf{F} & \mathbf{F} & \mathbf{T} & \mathbf{F} & \mathbf{F} \\ \mathbf{F} & \mathbf{T} & \mathbf{F} & \mathbf{T} & \mathbf{T} & \mathbf{F} \\ \mathbf{F} & \mathbf{F} & \mathbf{F} & \mathbf{F} & \mathbf{T} & \mathbf{T} \\ \end{array}

Read each column as a shape:

  • \land (AND): \mathbf{T}, \mathbf{F}, \mathbf{F}, \mathbf{F} — true only when both are true.
  • \lor (OR): \mathbf{T}, \mathbf{T}, \mathbf{T}, \mathbf{F} — true when at least one is true.
  • \to (implication): \mathbf{T}, \mathbf{F}, \mathbf{T}, \mathbf{T} — false only when p is true and q is false. The promise pattern.
  • \leftrightarrow (biconditional): \mathbf{T}, \mathbf{F}, \mathbf{F}, \mathbf{T} — true when p and q agree.

And for the unary connective:

\begin{array}{c|c} p & \lnot p \\ \hline \mathbf{T} & \mathbf{F} \\ \mathbf{F} & \mathbf{T} \\ \end{array}

Negation simply flips.

Why the table is complete

Two propositions have 2 \times 2 = 4 input combinations — \mathbf{TT}, \mathbf{TF}, \mathbf{FT}, \mathbf{FF}. Any connective's behaviour is fully fixed by telling you the output in each of those four rows. So a truth table for a two-input connective is always exactly 4 rows. There is nothing to guess — just four cases to fill.

For three propositions, 2^3 = 8 rows. For n propositions, 2^n rows. The size grows fast, but the method is the same: enumerate every assignment, compute the verdict, write it down.

Why this exhaustion works: propositional logic is tamer than set theory or number theory. There are no variables ranging over infinite sets — each proposition is either true or false, end of story. A truth table is a proof for any claim about propositional equivalence: if two formulas agree in every row, they are logically equivalent. If they differ in even one row, they are not.

Walking a compound formula

Truth tables shine when the formula is complicated. Consider \lnot(p \land q). Fill the table by stages — compute p \land q first, then negate.

\begin{array}{cc|c|c} p & q & p \land q & \lnot(p \land q) \\ \hline \mathbf{T} & \mathbf{T} & \mathbf{T} & \mathbf{F} \\ \mathbf{T} & \mathbf{F} & \mathbf{F} & \mathbf{T} \\ \mathbf{F} & \mathbf{T} & \mathbf{F} & \mathbf{T} \\ \mathbf{F} & \mathbf{F} & \mathbf{F} & \mathbf{T} \\ \end{array}

Now compare with \lnot p \lor \lnot q:

\begin{array}{cc|c|c|c} p & q & \lnot p & \lnot q & \lnot p \lor \lnot q \\ \hline \mathbf{T} & \mathbf{T} & \mathbf{F} & \mathbf{F} & \mathbf{F} \\ \mathbf{T} & \mathbf{F} & \mathbf{F} & \mathbf{T} & \mathbf{T} \\ \mathbf{F} & \mathbf{T} & \mathbf{T} & \mathbf{F} & \mathbf{T} \\ \mathbf{F} & \mathbf{F} & \mathbf{T} & \mathbf{T} & \mathbf{T} \\ \end{array}

The final columns of both tables are identical: \mathbf{F}, \mathbf{T}, \mathbf{T}, \mathbf{T}. That identity is De Morgan's law: \lnot(p \land q) \equiv \lnot p \lor \lnot q. The truth table is the proof. (Try it in the builder: load the preset (¬p)∨(¬q) and step through — then change it to ¬(p∧q) and step again. The verdict columns match.)

The three rules for building one quickly

  1. Number the rows canonically. For n propositions, write the 2^n rows in binary-counter order with \mathbf{T} above \mathbf{F} (or the reverse — pick one and stick with it).
  2. Fill column-by-column, not row-by-row. First the propositional columns, then each subformula, then the top-level connective. This is vastly faster and less error-prone than trying to evaluate the whole formula per row.
  3. Compare columns to check equivalence. Two formulas are equivalent iff their final columns match in every row.

Spot-the-pattern drill

Given a final column, can you guess the connective? Try these (two inputs, canonical order):

  • \mathbf{T}, \mathbf{F}, \mathbf{F}, \mathbf{T} — biconditional (\leftrightarrow).
  • \mathbf{F}, \mathbf{T}, \mathbf{T}, \mathbf{F} — exclusive OR (XOR). Note: it is the negation of \leftrightarrow.
  • \mathbf{F}, \mathbf{T}, \mathbf{T}, \mathbf{T} — NAND (\lnot(p \land q)). This column is the complement of AND.
  • \mathbf{T}, \mathbf{T}, \mathbf{F}, \mathbf{T} — converse implication (q \to p).

Every sequence of four \mathbf{T}s and \mathbf{F}s corresponds to some two-input connective. There are 2^4 = 16 such connectives in total; the standard five (\land, \lor, \lnot, \to, \leftrightarrow) are the ones with natural-language counterparts.

The truth-table ethos

Whenever a question in logic feels philosophical ("can p be true while q is false?"), just write the table. No argument about meaning, no appeal to intuition — enumerate the rows and the answer falls out. The table is the closest mathematics has to a mechanical oracle: finite, deterministic, and always conclusive for propositional claims.

Related: Logic and Propositions · Implication as a Promise — When Is p → q Broken? · Set Operations · Proof by Contrapositive