Truth Table Generator
Generate a truth table for any propositional formula with AND, OR, NOT, XOR, implication and equivalence.
Examples:
Syntax
- Variables: single letters A–Z (up to 6)
- & or && : AND
- | or || : OR
- ! or ~ : NOT
- ^ : XOR (exclusive or)
- -> : implication
- <-> : equivalence (iff)
- Parentheses ( ) group sub-formulas
- Precedence: ! > & > ^ > | > -> > <->
Classification: Contingent — true for some assignments, false for others
| A | B | C | Result |
|---|---|---|---|
| F | F | F | T |
| F | F | T | T |
| F | T | F | T |
| F | T | T | T |
| T | F | F | T |
| T | F | T | T |
| T | T | F | F |
| T | T | T | T |
How to use
- Enter a formula with single-letter variables and operators, for example (A & B) -> C.
- Press “Generate truth table” to see the result for every truth assignment.
- The formula is also classified as a tautology, a contradiction or contingent.
Notes
Up to 6 variables are supported (at most 64 rows). Operator precedence is ! first, then &, ^, |, -> and <-> last. Type equivalence as <-> and implication as ->. Variables become columns in the order they first appear.
FAQ
- Can variables be lowercase?
- Yes, but a and A are treated as different variables, so keep your naming consistent.
- Are intermediate sub-formulas shown as columns?
- No. This tool shows only the variables and the final result for each row.