PublicSoftTools

Truth Table Generator

Enter any propositional logic expression and get the complete truth table instantly. Supports AND, OR, NOT, implication, biconditional, and XOR with up to 5 variables. Detects tautologies and contradictions. No signup, runs entirely in your browser.

Operators: AND, OR, NOT, -> (implies), <-> (iff), XOR. Use p, q, r, s, t for variables.
True rows: 1 / 4
pqp AND q
FFF
FTF
TFF
TTT

Logic Tips

Verify De Morgan's laws

Enter NOT (p AND q) and compare it with (NOT p) OR (NOT q). Both should produce identical truth tables — that is De Morgan's first law. Try NOT (p OR q) vs (NOT p) AND (NOT q) for the second law.

Prove logical equivalence

Two expressions are logically equivalent if their truth tables are identical. Use the generator to verify that p → q is equivalent to NOT p OR q — a key simplification in circuit design.

Check tautologies

Tautologies are logically always-true statements. Enter (p → q) IFF (NOT p OR q) to verify this is a tautology. The generator will confirm it is true for all rows.

Operator precedence

The precedence order (highest to lowest) is: NOT, AND, OR, XOR, → (implies), ↔ (iff). Use parentheses to override precedence. (p AND q) OR r is different from p AND (q OR r).

Frequently Asked Questions

What operators are supported?

AND, OR, NOT, → (implies), ↔ or IFF (biconditional), and XOR. You can use symbols (∧, ∨, ¬, →, ↔) or words (AND, OR, NOT, IMPLIES, IFF, XOR). Parentheses are supported for grouping.

How many variables can I use?

Up to 5 variables (p, q, r, s, t). With 5 variables, the truth table has 32 rows (2⁵). More than 5 variables would produce tables too large to display usefully.

What is a tautology?

A tautology is a formula that is true for every possible combination of variable values. Example: p OR NOT p is always true. A contradiction is always false — p AND NOT p is never true.

How does implication (→) work?

p → q (p implies q) is false only when p is true and q is false. In all other cases it is true. This matches the logical definition of "if p then q" — the statement is only violated when the premise is true but the conclusion is false.

What is the difference between XOR and OR?

OR (inclusive or) is true when at least one operand is true, including when both are true. XOR (exclusive or) is true only when exactly one operand is true. XOR is false when both operands have the same value.

Is my data stored?

No. The parser and evaluator run entirely in your browser. No expressions or results are sent to any server.