What operators can I use in the truth table generator?
You can use a wide range of logical operators: && or 'and' for conjunction (AND), || or 'or' for disjunction (OR), ! or '~' or 'not' for negation (NOT), ^ or 'xor' for exclusive OR, -> or '=>' for implication, and <-> for biconditional (XNOR). The constants T and F represent tautology (always true) and contradiction (always false). See also our Odds Calculator.
How many variables can I use in a single expression?
You can use up to 4 variables (p, q, r, s) for a manageable table size. With 4 variables, the truth table has 16 rows (2^4). Using 5 or more variables is not recommended as it produces 32+ rows and becomes difficult to read.
What is a tautology and how can I tell if my formula is one?
A tautology is a formula that evaluates to TRUE for every possible combination of input values. If all rows in the result column show TRUE, the formula is a tautology. This calculator labels the formula as 'Tautology', 'Contradiction', or 'Contingency' based on the output.
What does 'false values first' mean?
By default, truth tables list TRUE before FALSE (T, F) for each variable. Selecting 'False values first' reverses this order so FALSE appears at the top (F, T). Both orderings cover the same combinations; it is a matter of convention and personal preference. You might also find our Dice Probability Calculator useful.
What is the difference between XOR and OR?
OR (||) is TRUE when at least one operand is TRUE, including when both are TRUE. XOR (^) is TRUE only when exactly one operand is TRUE — it returns FALSE when both operands are TRUE or both are FALSE. XOR is called 'exclusive or' because it excludes the case where both are true.
How does logical implication (p -> q) work?
The implication p -> q is FALSE only when p is TRUE and q is FALSE. In all other cases — when p is FALSE, or when both are TRUE — the implication evaluates to TRUE. This mirrors the logical rule that a false hypothesis makes any conditional statement vacuously true.
Can I use parentheses to group sub-expressions?
Yes, parentheses are fully supported and recommended for complex expressions. For example, write (p && q) -> (!p || r) to ensure the AND is evaluated before the implication. Without parentheses, the calculator applies standard operator precedence: NOT > AND > XOR > OR > implication > biconditional.
What is a contradiction?
A contradiction is the opposite of a tautology — it is a formula that evaluates to FALSE for every possible input combination. For example, p && !p is always false because a variable and its negation cannot both be true simultaneously. Contradictions appear when a formula is logically impossible. Check out our calculate Combination as well.