Truth table calculator
Calculator
The calculator needs JavaScript. The tables below give the same numbers for common cases.
How it is worked out
- Variables found: p, q, r, so there are 2^3 = 8 rows.
- Order of operations: not, then and, then xor, then or, then -> , then <->.
- Each row evaluates the expression for one combination of true (T) and false (F).
| Inputs | Answer |
|---|---|
| Expression: p and (q or not r) | The expression p and (q or not r) is true in 3 of 8 rows, so it is a contingency (sometimes true, sometimes false). |
| Expression: p -> q | The expression p -> q is true in 3 of 4 rows, so it is a contingency (sometimes true, sometimes false). |
| Expression: (p -> q) <-> (not q -> not p) | The expression (p -> q) <-> (not q -> not p) is true in 4 of 4 rows, so it is a tautology (always true). |
How to use it
A truth table lists every combination of true and false for the variables in a logical expression and the value of the whole expression in each row. With n variables there are 2ⁿ rows. An expression true in every row is a tautology; one false in every row is a contradiction.
Use letters for variables and and, or, not, xor, -> (implies) and <-> (if and only if), or the symbols & | ! ^. Brackets control the order. Without brackets not binds tightest, then and, xor, or, ->, <->.
Frequently asked questions
What is a tautology?
An expression that is true for every combination of its variables.
How many rows does a truth table have?
2 to the power of the number of variables.
What does p -> q mean?
If p then q: false only when p is true and q is false.
Method: standard arithmetic shown step by step; no outside data is used. Checked 2026-11-12.
About · How we verify this · Editorial policy · Corrections
General information only. Results are plain arithmetic on the numbers you enter; check anything important (money, health, school work) against your own records or the official source.