Truth Table Generator

Free online truth table generator: type any logical formula and get its complete truth table instantly, with every combination of its variables evaluated in your browser.

Input a logical expression to analyze it (supports propositional logic, Boolean algebra)

Client-side only - your data never leaves your browser

Guide

Click an operator to try its example in the calculator. Each one shows every way you can type it.

Type a formula and this truth table generator evaluates it for every combination of its variables. It reads negation, conjunction, disjunction, implication and the biconditional, written in symbols (¬ ∧ ∨ → ↔) or in plain ASCII (!, &, |, ->, <->), and gives you the table itself with nothing else to wade through. Nothing is uploaded either: the table is built in your browser.

How to generate a truth table

  1. Type your formula into the field above - (A & B) -> C, for example. The operator keyboard inserts the symbols if you would rather not type them.
  2. The generator reads the variables off the formula and builds one row per combination of their values: n variables give 2ⁿ rows, always in the same order, so two tables can be compared row by row.
  3. Read the last column. It is the value of the whole formula in each case - a tautology is true in every row, a contradiction in none, and anything in between is contingent.
  4. Export the table as Markdown, CSV or LaTeX, or copy the share link: the formula travels in the URL, so the table can be reopened later or handed to someone else.

What the full calculator adds

  • Whether the formula is a tautology, a contradiction, contingent or merely satisfiable.
  • Equivalent forms: rewrites by the algebraic laws, plus the DNF and CNF read straight off the table.
  • A Karnaugh map for two to four variables, with the groups ringed and the minimal form spelled out.
  • The expression tree, and the same formula drawn as a logic-gate circuit.
  • Arguments and equivalences too: p, p → q ⊨ q checks the argument and gives a countermodel when it fails.
Open the Logic Calculator

A worked example

The table for ((A∧B)→C), exactly as the generator builds it: three variables, so eight rows, with the conjunction evaluated first and the implication read off it.

ABC(A∧B)((A∧B)→C)
FalseFalseFalseFalseTrue
TrueFalseFalseFalseTrue
FalseTrueFalseFalseTrue
TrueTrueFalseTrueFalse
FalseFalseTrueFalseTrue
TrueFalseTrueFalseTrue
FalseTrueTrueFalseTrue
TrueTrueTrueTrueTrue

Truth tables for the basic operators

Every table the generator builds is these five, applied in the order the formula's brackets and operator precedence dictate.

Negation

not p

p¬p

And

p and q

pqp∧q

Or

p or q, or both

pqp∨q

Implication

if p, then q

pqp→q

Biconditional

p if and only if q

pqp↔q

How many rows will the table have?

One row per combination of truth values, so a formula with n distinct variables has 2ⁿ rows. Each variable you add doubles the table.

VariablesRows
12
24
38
416
532
664

Ready-made truth tables

The formulas people most often need a table for, already generated and linkable.

Truth Table to ExpressionConvert any truth table into a logical expression. Generate Boolean formulas in Disjunctive Normal Form (DNF) or Conjunctive Normal Form (CNF) from your custom truth table.

Frequently Asked Questions

Find answers to common questions about using the Logic Calculator

How do I create a truth table for my expression?

Simply enter your logical expression in the calculator input field and click calculate. The truth table will automatically be generated showing all possible combinations of variable values and the resulting output for your expression.

What order are the rows in?

The variables are listed alphabetically, and the rows count through every assignment starting from all-false, with the first variable changing fastest, so the last row is the one where every variable is true. Textbooks differ here — many start from all-true instead — so the rows can appear in a different sequence from your course notes even though the table says exactly the same thing.

How many rows will my truth table have?

Two to the power of the number of distinct variables: three variables give eight rows, four give sixteen, ten give 1,024. Every variable you add doubles the table, which is why a long formula is usually easier to judge from the properties and the equivalent forms than by reading every row.

Can I show 1 and 0 instead of ⊤ and ⊥?

Yes. The notation toggle on the truth table switches between the ⊤ and ⊥ symbols and 1 and 0, and your choice is remembered in this browser the next time you visit.

How do I tell from a truth table whether a formula is a tautology?

Read the final column. If every row is true the formula is a tautology; if every row is false it is a contradiction; if the column has both it is contingent. It is satisfiable as soon as one row is true. The calculator states all of this above the table, so the column is a way to check the verdict rather than to work it out.

See all questions