MATH · TRUTH TABLE
Truth Table Calculator
Generate truth tables for any logical expression with up to 4 variables (A, B, C, D). Supports AND, OR, NOT, XOR, IMPLIES, IFF, and Unicode logic symbols.
| A | B | Result |
|---|---|---|
| F | F | F |
| F | T | F |
| T | F | F |
| T | T | T |
About This Calculator
Generate complete truth tables for Boolean (propositional) logic expressions. Type an expression using variables A, B, C, D and operators AND, OR, NOT, XOR, IMPLIES, IFF — or use Unicode symbols like ∧, ∨, ¬, ⊕, →, ↔. The calculator builds every possible truth-value assignment and evaluates your expression for each row.
How It Works
The expression is parsed using a recursive descent parser that respects operator precedence: NOT (highest) > AND/NAND > XOR/NOR > OR > IMPLIES > IFF (lowest). Parentheses can override precedence. Variables must be uppercase letters A–D; up to 4 variables are supported (giving at most 16 rows). The table shows T (true) or F (false) for each combination.
The Formula
A ∧ B (AND) A ∨ B (OR) ¬A (NOT) A ⊕ B (XOR) A → B (IMPLIES) A ↔ B (IFF)
- A, B, C, D
- propositional variables (Boolean inputs)
- T / F
- true / false
- →
- material implication: false only when A is true and B is false
- ↔
- biconditional: true when A and B share the same truth value
Frequently Asked Questions
- What operators can I use?
- You can write operators as English words (AND, OR, NOT, XOR, NAND, NOR, IMPLIES, IFF) or as Unicode symbols (∧ ∨ ¬ ⊕ → ↔). All input is case-insensitive and whitespace is ignored. Parentheses group sub-expressions as expected.
- What is a tautology?
- A tautology is a formula that evaluates to true for every possible truth-value assignment. The classic example is "A OR NOT A" (law of excluded middle). If your table's Result column is all T, the expression is a tautology.
- What is a contradiction?
- A contradiction (or unsatisfiable formula) evaluates to false for every assignment. "A AND NOT A" is the canonical example. If your Result column is all F, the expression is a contradiction.
- Why is A → B false only when A is true and B is false?
- Material implication models the idea that a true premise can only lead to a true conclusion. A false premise vacuously "implies" anything (false → anything is true). This is the standard definition in classical propositional logic, even though it differs from everyday causal language.