Boolean Truth Table Generator

A truth table is the complete behaviour of a Boolean expression written out row by row: every combination of input values, and the output each combination produces. It is the definitive way to check whether an expression does what you intended, whether two expressions are equivalent, and whether a simplification is valid. Writing a table by hand is tedious and error prone once three or four variables are involved, because the row count doubles with each variable. This generator builds the table from a typed expression using AND, OR, NOT and XOR, with parentheses for grouping, and shows every row with its result. It is the natural companion to the interactive gate simulator, which tests one combination at a time, while this tool shows all of them at once.

Quick Answer: Type a boolean expression using AND, OR, NOT and XOR, then click Generate Truth Table to see every input combination and its output.

Free Online Tool

Boolean Truth Table Generator

Every input combination and its output, from one expression.


Operators: AND, OR, NOT, XOR (also &, |, !, ^). Variables: single letters A to Z. Parentheses group sub-expressions.

How to Use the Boolean Truth Table Generator

  1. Type your expression using variable letters such as A and B, with AND, OR, NOT or XOR between them.
  2. Use parentheses to group parts of the expression where the default precedence would give a different result.
  3. Click Generate Truth Table to build one row for every combination of input values.
  4. Read down the output column to see for which combinations the expression is true.
  5. Compare tables for two expressions when you want to check whether they are equivalent.

Key Features

  • Four operators: AND, OR, NOT and XOR, with word forms and common symbols accepted.
  • Parentheses support, so complex expressions can be grouped exactly as intended.
  • Automatic variable detection, with one column per variable found in the expression.
  • Complete row coverage: every combination appears, from all zeros to all ones.
  • Clear row format showing each input value and the resulting output side by side.

Best Practices and Tips

  • Use parentheses liberally. They cost nothing and remove all doubt about which operation applies first.
  • Read the output column as a pattern: a single one among zeros usually means an AND of several conditions, while a single zero means a NAND style condition.
  • Keep expressions to four variables or fewer for readable tables, since five variables already need thirty two rows.
  • Test an expression’s negation too. Comparing a table with its complement often reveals a simpler equivalent form.

Common Mistakes to Avoid

  • Forgetting that NOT binds tightest, so NOT A AND B means the negation of A combined with B, not the negation of the whole combination.
  • Using a variable name longer than one letter, which this tool treats as an error rather than guessing your intent.
  • Writing AND and OR without parentheses in a long expression and assuming the reader will apply the same precedence you did.

Frequently Asked Questions

What is a truth table?

A truth table lists every possible combination of values for the variables in an expression, together with the expression’s output for each combination. For two variables there are four rows, for three there are eight, and for four there are sixteen. It is the exhaustive definition of what an expression computes.

What precedence do the operators follow?

NOT applies first, then AND, then XOR, then OR, which matches the usual mathematical convention. Parentheses override precedence entirely, so when in doubt, add parentheses to state the grouping explicitly rather than relying on the default order.

How do I check whether two expressions are equivalent?

Generate the table for each expression and compare the output columns row by row. If every row matches, the expressions are equivalent for all inputs, regardless of how different they look as written.

Why is the table limited to four variables?

Each added variable doubles the row count, so tables beyond four variables become long and hard to read on a page. Four variables covers the great majority of textbook and practical logic problems while keeping the output usable.

Related Tools