Truth Table Generator

Generate a complete truth table for any logical expression using AND, OR, NOT, XOR, and conditional operators.

Share this calculator

Supported operators

AND: & && ∧ OR: | || ∨ NOT: ! ¬ XOR: ^ ⊕ NAND: NAND NOR: NOR IMPLIES: -> →

Variables: p, q, r

Results

Enter a logical expression Enter a logical expression to generate a truth table.

Also in General

Logic & Discrete Math

Truth table generator: evaluate logical expressions

A truth table generator builds a complete truth table for any propositional logic expression. It evaluates every possible combination of truth values for the input variables and shows the result of the expression for each combination. Truth tables are the standard tool for verifying logical equivalences, checking validity, and understanding how logical connectives interact.

Logical connectives

The basic logical connectives are AND (conjunction), OR (disjunction), NOT (negation), XOR (exclusive or), conditional (if-then), and biconditional (if and only if). Each connective has a specific truth-value pattern. AND is true only when both operands are true. OR is true when at least one operand is true. NOT inverts the truth value.

A truth table with n variables has 2^n rows. Two variables produce 4 rows, three produce 8, and four produce 16. The generator creates all rows automatically and evaluates the expression for each combination.

Using truth tables

Truth tables can verify logical equivalences such as De Morgan's laws: NOT (A AND B) is equivalent to (NOT A) OR (NOT B). If two expressions produce identical columns in the truth table, they are logically equivalent.

In digital circuit design, truth tables define the behaviour of logic gates and combinational circuits. Each row represents an input combination and the corresponding output.

Frequently asked questions

How many rows will my truth table have?

A truth table with n distinct variables has 2^n rows. Two variables give 4 rows, three give 8, four give 16, and so on.

What is a tautology?

A tautology is a logical expression that is true for every possible combination of input values. Its truth table column contains only "true" entries. An example is A OR NOT A.

Can I enter nested expressions?

Yes. Use parentheses to group sub-expressions. The generator respects standard operator precedence: NOT is evaluated first, then AND, then OR, then conditional, then biconditional.

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.