Truth Table Generator
Type a Boolean expression such as (A -> B) & (B -> C), and the tool lists every combination of true and false for its variables and shows the result of each step. Put several expressions on separate lines to compare them: it tells you whether they are logically equivalent. It also says whether an expression is a tautology, a contradiction or contingent, lists the minterms and writes the canonical sum of products and product of sums. Everything runs in your browser.
Operators: ! or not, & or and, | or or, ^ or xor, nand, nor, -> or implies, <-> or iff. Variables are letters or words. true and false are constants.
| A | B | C | A -> B | B -> C | (A -> B) & (B -> C) | A -> C |
|---|---|---|---|---|---|---|
| T | T | T | T | T | T | T |
| T | T | F | T | F | F | F |
| T | F | T | F | T | F | T |
| T | F | F | F | T | F | F |
| F | T | T | T | T | T | T |
| F | T | F | T | F | F | T |
| F | F | T | T | T | T | T |
| F | F | F | T | T | T | T |
These expressions are not equivalent: they differ in at least one row.
A truth table lists every combination of true and false for the variables and shows what the expression comes to in each row. An expression that is true in every row is a tautology, one that is false in every row is a contradiction, and two expressions that match in every row are logically equivalent. NOT binds tightest, then AND, XOR, OR, implication (which groups from the right) and if and only if. A minterm is a row where the expression is true, numbered by reading the variables as a binary number with the first variable highest and true as 1. Up to 10 variables are supported. Everything is worked out in your browser.
Related Tools
[5 suggestions]Bitwise Calculator
Apply AND, OR, XOR, NOT, shifts and rotations to 8, 16, 32 or 64-bit numbers and see the result in binary, hexadecimal and signed and unsigned decimal.
Developer & WebNumber Base Converter
Convert whole numbers between binary, octal, decimal, hex and any base from 2 to 36, with two's complement.
Developer & WebRegex Tester
Test regular expressions against a string, highlight matches, and inspect capture groups.
Developer & WebModulo Calculator
Find a mod n, the remainder, modular inverses, powers mod n and congruences, with the steps, and see why negative numbers differ.
Student ToolsText to Binary Translator
Convert text to binary, hex, decimal, or octal and decode it back, using UTF-8 bytes.
Developer & WebAbout the Truth Table Generator
A truth table lists all 2 to the power n combinations of true and false for n variables and evaluates the expression in each row. The tool reads words, ASCII symbols and the usual logic symbols: NOT as not, ! or ~, AND as and, & or *, OR as or, | or +, XOR as xor or ^, NAND, NOR, implication as implies or ->, and if and only if as iff or <->. NOT binds tightest, then AND, XOR and OR, then implication, which groups from the right, then if and only if, and brackets override everything. An expression that is true in every row is a tautology, such as A or not A, and one that is false in every row is a contradiction, such as A and not A. Two expressions with the same value in every row are logically equivalent, which is how De Morgan's laws, the contrapositive (A implies B is equivalent to not B implies not A) and the distributive laws are checked. A minterm is a row where the expression is true, numbered by reading the variables as a binary number with the first variable highest and true as 1. The canonical sum of products is the OR of the terms for those rows, and the canonical product of sums is the AND of clauses ruling out the false rows. Up to 10 variables, 1,024 rows, are supported.
How many rows does a truth table have?▾
Two to the power of the number of variables: 4 rows for two variables, 8 for three, 16 for four and 1,024 for ten. Each row is one combination of true and false for the variables.
What is a tautology?▾
An expression that is true for every combination of its variables, such as A or not A. A contradiction is the opposite, false in every row. An expression that is true in some rows and false in others is called contingent.
How do I check whether two expressions are equivalent?▾
Enter both on separate lines. If the final columns match in every row, the expressions are logically equivalent. For example, not (A and B) and (not A) or (not B) match, which is De Morgan's law.
What does A implies B mean in a truth table?▾
It is false only when A is true and B is false, and true in every other row. It is the same as (not A) or B. The tool accepts implies, -> and => for it.
Is my data uploaded?▾
No. The table is built in your browser and nothing you enter is sent anywhere.