Truth Table Generator — Propositional Logic and Boolean Expressions Guide
Truth tables enumerate every possible combination of variable values and show whether a logical expression is true or false for each case. The free truth table generator on PublicSoftTools parses any propositional logic expression and generates the complete table instantly, detecting tautologies and contradictions automatically.
Logical Operators Reference
| Operator | Accepted syntax | Meaning |
|---|---|---|
| AND (∧) | AND, &, ∧ | True only when both operands are true |
| OR (∨) | OR, |, ∨ | True when at least one operand is true |
| NOT (¬) | NOT, ~, ¬ | Inverts the truth value |
| Implies (→) | ->, →, IMPLIES | False only when premise is true and conclusion is false |
| Biconditional (↔) | <->, ↔, IFF | True when both operands have the same value |
| XOR (⊕) | XOR, ^, ⊕ | True when exactly one operand is true |
How to Use the Truth Table Generator
- Open the truth table generator.
- Type a logical expression in the input field (or click an example).
- Use single lowercase letters for variables (p, q, r, s, t).
- The truth table generates instantly — each row is one combination of variable values.
- If the expression is always true or always false, a tautology or contradiction banner appears.
Operator Precedence
The precedence order from highest to lowest is: NOT, AND, OR, XOR, → (implies), ↔ (iff). This means NOT p AND q is parsed as (NOT p) AND q, not NOT (p AND q). Use parentheses to override precedence: NOT (p AND q) gives a different truth table.
Tautologies and Contradictions
Tautologies
A tautology is true for every possible assignment of variable values. Classic examples:
- p OR NOT p (law of excluded middle)
- (p → q) IFF (NOT p OR q)
- (p AND q) → p (simplification)
Tautologies are important in proof theory — they represent logical truths that hold regardless of factual content.
Contradictions
A contradiction is false for every assignment. The simplest: p AND NOT p. Contradictions are the building blocks of proof by contradiction — assuming P leads to P AND NOT P, so P must be false.
Verifying Logical Identities
De Morgan's laws
De Morgan's laws are fundamental identities used in circuit design and Boolean algebra:
- NOT (p AND q) is equivalent to (NOT p) OR (NOT q)
- NOT (p OR q) is equivalent to (NOT p) AND (NOT q)
Enter both sides in the generator and compare truth tables — they should be identical for every row. Or enter NOT (p AND q) IFF ((NOT p) OR (NOT q)) — this should show as a tautology.
Implication as disjunction
The conditional p → q is logically equivalent to NOT p OR q. Many students find this counterintuitive — implication is only false when the premise is true and the conclusion is false. Verify: enter (p → q) IFF (NOT p OR q) and check for tautology.
Circuit Design Applications
Truth tables are the foundation of digital logic design. Every logic gate (AND, OR, NOT, NAND, NOR, XOR) is defined by its truth table. A combinational circuit with n inputs has 2ⁿ rows. The generator handles up to 5 variables (32 rows), covering the complexity of most student circuit problems.
Generate Any Truth Table
Enter any logical expression with AND, OR, NOT, implies, and iff for an instant complete truth table.
Open Truth Table Generator