Skip to content

Truth Table Generator

Type a logic expression such as (A and B) -> C and see every row of its truth table, instantly and in your browser.

Verdict

Depends on the values

7 of 8 rows are true.
ABCResult
1111
1100
1011
1001
0111
0101
0011
0001

How it works

  1. Type an expression using letters or short names for the variables, for example (A or B) and not C.
  2. Use and, or, not, xor, -> for implication and <-> for “if and only if”. Symbols such as & | ! ^ work too.
  3. Read the table, one row per combination, and the verdict: always true, always false, or depends on the values.
  4. Type a second expression in the comparison box to check that two formulas are equivalent, or copy the table as CSV.

What people use it for

  • Logic homework

    Check a hand-built table for a proposition with three variables.

  • Simplifying conditions

    Confirm that !(A && B) behaves like !A || !B before changing an if statement.

  • Digital circuits

    List when a gate network outputs 1, then copy the table into your notes.

Questions

In which order are the operators applied?
From strongest to weakest: not, and, xor, or, implies, then if and only if. Implication groups to the right, so A -> B -> C reads as A -> (B -> C). When in doubt, add parentheses.
How many variables are supported?
Up to 8, which is 256 rows. Variables are names made of letters, digits and underscores, and they are case-sensitive: A and a are two variables. The words and, or, not, xor, implies, iff, true and false are reserved. The values 0 and 1 are accepted as constants. Very long or deeply nested expressions are refused with a message.
How does the equivalence check work?
Both expressions are evaluated for every combination of all the variables found in either one. They are equivalent when the results match on every row; a variable that appears in only one expression is still tried with both values.