How to use the truth table generator
- Type your expressions in Expressions (one per line). Each line becomes a result column.
- Tick Single-letter variables (AB means A AND B) only if you write AND by putting letters side by side.
- Under Show values as, choose 1 / 0 or T / F.
- Read the table: the input columns come first, then one column per expression.
- Check the Summary for each line’s verdict, and download the CSV if you need it in a spreadsheet or report.
What it does and when to use it
A truth table lists every possible combination of true and false for the inputs, and the result of the expression for each. It is the standard way to define a logic gate, test an argument in propositional logic, or prove that two statements mean the same thing.
Because you can enter several lines, the tool is especially handy for comparing expressions: write a statement and its supposed simplification, then see if the columns agree. To get the simplest form automatically, use the Boolean algebra simplifier. The set theory calculator shows the same ideas with sets, and the binary calculator applies AND, OR and XOR to whole numbers.
How it works
- All variables from all lines are collected and sorted.
- With n variables there are 2ⁿ rows. Row i uses the binary digits of i as the input values, first variable on the left.
- Each expression is evaluated for every row. Operators follow the usual order: NOT first, then AND, XOR, OR, IMPLIES and finally IFF. Brackets override this.
- The summary counts the true rows. All true is a tautology; none true is a contradiction.
The rules for the two-input operators:
| A | B | AND | OR | XOR | A -> B | A <-> B |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 0 | 1 | 1 |
Step by step for P -> Q:
- Two variables, so 2² = 4 rows: FF, FT, TF, TT.
- “If P then Q” is broken only when P is true and Q is false.
- So the column reads T, T, F, T.
Adding the line NOT P OR Q gives the same column, which proves the two are equivalent.
Worked examples
AND. A AND B is true in just the last row; the summary says A AND B: true in 1 of 4 rows.
Implication. With T / F, the lines P -> Q and NOT P OR Q both show T | F | F | F in the third row and match everywhere else.
Tautology. A OR NOT A is true in both rows, so the summary says A OR NOT A: tautology.
De Morgan’s law. NOT (A AND B) and NOT A OR NOT B give identical columns; the last row reads 1 | 1 | 0 | 0.
Limits and tips
- A line that does not use some variable simply ignores it.
- If a line has a mistake, the message names the line number and position.
- The table is built in your browser.
Frequently asked questions
How do I prove two expressions are equivalent?
In what order are the rows listed?
Which symbols can I use?
Why is "Single-letter variables" off by default here?
How big can the table be?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.