Truth Table Generator
Developer Tools · Added
A truth table is the one proof technique that needs no cleverness: try every combination and look. Type an expression in whichever notation you learned — programming operators, logic symbols or the word forms — and every case is enumerated, with a column for each piece of working along the way.
Truth table
Result
True in 3 of 8 cases
True in some cases and false in others, which is what a useful condition looks like.
Read as A ∧ (B ∨ ¬C) — the brackets are the parser's, showing how precedence grouped your input.
| A | B | C | ¬C | (B ∨ ¬C) | A ∧ (B ∨ ¬C) |
|---|---|---|---|---|---|
| T | T | T | F | T | T |
| T | T | F | T | T | T |
| T | F | T | F | F | F |
| T | F | F | T | T | T |
| F | T | T | F | T | F |
| F | T | F | T | T | F |
| F | F | T | F | F | F |
| F | F | F | T | T | F |
True on rows 0, 1, 3 counting from zero — the minterms, if you are heading towards a Karnaugh map.
Rows count down from all-true, which is the order textbooks print. Two operators are worth watching: ^ is exclusive-or here, as it is in C and JavaScript, not exponentiation; and + is OR, as it is in Boolean algebra, not addition. Implication surprises people most — A → B is false only when a true premise leads to a false conclusion, so every row with a false premise comes out true.
How to use the truth table generator
- 1Type your expression. Brackets, and the operators listed under the box, all work as you would expect.
- 2Read the classification: always true, always false, or true in some cases.
- 3Follow the intermediate columns to see how each row reached its answer.
- 4Enter a second expression in the comparison field to check whether the two are equivalent.
Examples
De Morgan's law
- Input
- !(A && B) compared with !A || !B
- Result
- Equivalent — the two agree on all four rows
Material implication
- Input
- A -> B
- Result
- False on one row only: A true, B false
Every row with a false premise comes out true, which is the part that surprises people.
About the truth table generator
Using it on real conditions
The everyday use is not homework. It is taking the condition out of an if statement that has grown three ands and a not, substituting single letters for the sub-expressions, and looking at what it actually does.
Two results are worth the trip on their own. A tautology means the branch always runs and the condition can go. A contradiction means the branch is dead code — and dead code that looks live is exactly the kind of thing that survives a review.
Why implication looks wrong at first
Material implication is false in one case only: a true premise leading to a false conclusion. Everything else is true, including every row where the premise is false. So 'if the moon is made of cheese then I am the king of Spain' is a true statement.
It reads as a trick until you see what the alternative would cost. A rule such as 'every number over 100 is positive' should not be falsified by the number 7, which the rule says nothing about. Making the false-premise rows true is what lets a general statement stay true for the cases outside its scope.
Frequently asked questions
Which notation does it accept?
Is ^ exclusive-or or a power?
How does it decide what binds tightest?
Why does it stop at ten variables?
Related tools
Binary Calculator
Developer Tools
Arithmetic and bitwise operations on 8 to 64-bit integers, in any base.
Regex Tester
Developer Tools
Test regular expressions live with highlighted matches, capture groups and replace.
Number Base Converter
Converters
Convert between binary, octal, decimal, hexadecimal and any base from 2 to 36.