Truth Table Generator screenshot

Truth Table Generator

Generate every row of a boolean expression with correct operator precedence, and classify it as a tautology, a contradiction or a contingency.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
No sign-up, no upload
Every row enumerated

Truth Table Generator

Generate every row of a boolean expression with correct operator precedence, and classify it as a tautology, a contradiction or a contingency.

How this page computes

One tokenizer and one recursive-descent parser build an expression tree, with the operator table written once. A name of more than one letter is refused rather than split.

The tree is evaluated on every assignment of the distinct variables, in counting order. True rows become the minterm list, false rows the maxterm list, and the counts decide the classification.

The calculation runs entirely in this browser tab; nothing is uploaded.

The page writes out every row of a boolean expression and classifies it. For A and (B or not C) the result is true on three of eight rows, which is contingent — neither always true nor always false.

The rows are numbered with the first variable as the most significant bit, so the row numbers are the minterm indices. The page prints the minterm list and the maxterm list, which are the forms a sum-of-products or product-of-sums circuit is built from.

How to use Truth Table Generator

Type an expression using letters A to Z, the words and, or, xor, not, implies and iff, and parentheses. The symbols & | ^ ! -> <-> mean the same things.

Press Run for the table. A name longer than one letter is refused, because AB would be two variables and guessing which you meant is how a table comes to describe a different formula.

Precedence, and why it is written down

Not binds tightest, then and, then xor, then or, then implies, then iff. Implies is right-associative, so A -> B -> C means A -> (B -> C), which is the convention logic texts use and the one a reader is most likely to expect.

Every row is one complete assignment of true and false to the variables, and the expression is evaluated on each. That is at most 32 rows for the five-variable ceiling, so the table is exhaustive rather than sampled.

What to Expect

Best for

  • The full table of a compound expression
  • Telling a tautology from a contingency from a contradiction
  • The minterm list for a sum-of-products form

Not ideal for

  • More than five variables, where the table would be too large to read
  • Minimising the expression, which the boolean simplifier page does
  • Quantifiers such as for-all, which are not part of propositional logic

What this tool keeps

  • The expression exactly as typed

What may need cleanup

  • Nothing: the table is the answer

Common errors

  • A two-letter name is refused with the operators it probably meant
  • An unclosed bracket is refused with its position
  • A token that cannot start an operand is refused with its position

Example use cases

  • Build the table for A and (B or not C)
  • Check that A implies B is false only on one row
  • Get the minterms of a three-variable expression

Sample input

A and (B or not C)

Sample output

eight rows, three true, minterms m(4, 6, 7), contingent

Who this is for

  • Students learning propositional logic
  • Readers checking a digital circuit

Frequently asked questions

What does contingent mean?

That the expression is true on some rows and false on others. A tautology is true on every row and a contradiction on none, and the page names whichever applies.

Why is AB refused?

Because a variable is one letter, so AB reads as two adjacent variables with no operator between them. Writing A and B is unambiguous, and the refusal names that spelling.

What is a minterm?

A row on which the expression is true, identified by its row number with the first variable as the most significant bit. The sum of those minterms is a sum-of-products form of the same function.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.