Build the truth table for any logical expression, with working columns, normal forms, a tautology check and an equivalence test, and see exactly how it was grouped.
Initializing in your browser…
Find any chord on guitar, ukulele, bass, banjo, mandolin, Irish bouzouki or a tuning of your own, hear it, and export clean diagrams. Every playable voicing ranked easiest first, slash chords, a neck map and a chord sheet builder.
Extract the main colours of a photo as a palette with hex, RGB and HSL codes and their share of the picture, and export it as CSS, SCSS, Tailwind, JSON, CSV or GIMP.
Record from your microphone in the browser with a real level meter, then trim and download as WAV, MP3, OGG or WebM. Nothing is uploaded.
You want to see the truth table for "if A then B" and check that it means the same as "not A, or B".
Expression
A -> B Compare with: NOT A OR B
Result
A B A → B T T T T F F F T T F F T Contingency, true in 3 of 4 rows Equivalent. A → B and ¬A ∨ B agree on every row.
An implication is false in only one case: when A is true and B is false. That is the second row and the only F in the result column, so the expression is true in three of the four rows, which makes it a contingency rather than a tautology. NOT A OR B is false only when NOT A is false and B is false, which is the same row, so the two expressions agree everywhere and the compare box reports them as equivalent. Compare A -> B with B -> A instead and the page names the row where they part: A true and B false, where A → B is false and B → A is true.
Type a logical expression with words such as AND, OR and IMPLIES or symbols such as ∧ and →, and get its full truth table with a column for every step. The page prints the grouping it used, says whether the expression is a tautology, a contradiction or a contingency, and can test whether two expressions are equivalent.
Type it the way you write it. The generator accepts the words AND, OR, NOT, XOR, NAND, NOR, IMPLIES and IFF in upper or lower case, the symbols ¬ ∧ ∨ ⊕ → ↔, and programming forms such as &&, ||, !, -> and <->. A variable can be any name made of letters, digits and underscores, so p, q, rain and x1 all work, and T, F, 1 and 0 stand for true and false. On a phone, the row of operator buttons under the box types the symbols for you. The table updates as you type, and anything that cannot be read is explained in plain words, such as a bracket that is never closed or an operator with nothing after it.
The grouping is printed. A truth table is only unambiguous once the grouping is agreed, so the Read as line shows the expression with brackets wherever the grouping matters. NOT binds tightest, then AND, then OR and XOR, then implication, then the biconditional, the order used in standard logic textbooks. Implication groups from the right, so A → B → C means A → (B → C); that reading is true in seven of the eight rows, while (A → B) → C is true in only five. NAND and NOR are not associative, so a chain such as A NAND B NAND C is refused with both possible bracketings offered rather than quietly settled one way. The full list of operators, their spellings and their precedence is one click away.
Everything that comes off the table. With working columns on, every distinct sub-expression gets its own column, which is how truth tables are built by hand and makes each step easy to check. The result is classified as a tautology, a contradiction or a contingency, with the number of true rows. For up to eight variables the page also writes out the disjunctive normal form, one term per true row, and the conjunctive normal form, one clause per false row, ready to copy. The table can be shown with T and F or with 1 and 0, copied as tab separated text for a spreadsheet, or downloaded as a CSV file.
Test whether two expressions are equivalent. Type a second expression in the compare box and every combination of values for the variables in either one is checked. If they always agree, they are equivalent. If not, you get the exact assignment where they differ and which of the two is true there, which is the quickest way to find the mistake in a simplification. Tables are drawn for up to 12 variables, which is 4,096 rows.
Read as A → (B → C), true in 7 of 8 rows. The other grouping, (A → B) → C, is true in 5, so the brackets matter.
NOT (A AND B) IFF (NOT A OR NOT B) is true in all 4 rows, so it is a tautology.
Refused, with (A NAND B) NAND C and A NAND (B NAND C) offered instead, because the two give different tables.
A -> B and NOT A OR B are equivalent. A -> B and B -> A are not: they differ when A is true and B is false.
Build the table for a formula or an argument and check each column against your own working.
Compare the original and the simplified expression; if they differ, the page shows the row that proves it.
Write a gate expression with AND, OR, NAND and NOR and read its output for every input, in 1 and 0 if you prefer.
Test a complicated condition written with &&, || and ! before trusting it in code.
Use the words AND, OR, NOT, XOR, NAND, NOR, IMPLIES and IFF in any case, the symbols ¬ ∧ ∨ ⊕ → ↔, or forms such as &&, ||, !, ~, ->, => and <->. The operator list on the page shows every accepted spelling.
NOT first, then AND and NAND, then OR, XOR and NOR, then implication, then the biconditional. So NOT A AND B means (NOT A) AND B, and A AND B OR C means (A AND B) OR C. Brackets always override this order.
Because implication is conventionally right associative, as in most logic textbooks. The two groupings are different functions: A → (B → C) is true in seven of the eight rows and (A → B) → C in five. The page prints the brackets so there is no doubt which one the table shows.
NAND is not associative: (A NAND B) NAND C and A NAND (B NAND C) give different tables, and there is no agreed convention for which is meant. Add brackets to choose one. The same applies to NOR.
A tautology is true in every row, a contradiction is false in every row, and a contingency is true in some rows and false in others. The verdict and the number of true rows appear above the table.
The disjunctive normal form joins one AND term for each true row with OR; the conjunctive normal form joins one OR clause for each false row with AND. Both describe the same function as your expression. They are listed for up to eight variables.
Type the second one under Compare with another expression. Every combination of true and false for the variables in either expression is tried. If any row differs, the page shows that row and which expression is true there.
Up to 12 in one table, which is 4,096 rows. A name can be letters, digits and underscores, such as p, q or switch_1, and a name such as nota is read as one variable rather than NOT a.
Every calculation runs locally in your browser. Your numbers and expressions are not transmitted or stored.