Calculators Free

Truth table calculator

Calculator

The calculator needs JavaScript. The tables below give the same numbers for common cases.

How it is worked out

  1. Variables found: p, q, r, so there are 2^3 = 8 rows.
  2. Order of operations: not, then and, then xor, then or, then -> , then <->.
  3. Each row evaluates the expression for one combination of true (T) and false (F).
Worked examples
InputsAnswer
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 -> qThe 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.

Written by Calculators Free Editorial Team · Data 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.