Truth Table Generator
Generate the truth table of any Boolean expression with up to 10 variables, plus minterms, maxterms, canonical SOP/POS forms and a tautology check.
Operators: NOT ! ~ ¬ or a trailing ', AND & * · ∧ (or just a space: A B), OR | + ∨, XOR ^ ⊕, NAND ↑, NOR ↓, -> → for implies, <-> ↔ for if and only if. Constants: 0, 1, true, false. Any other name is a variable (AB is one variable, write A B for A AND B).
- Classification
- –
- Variables
- –
- Rows
- –
- True rows
- –
Read as:
Minterms (rows where the result is true)
Canonical sum of products (SOP, DNF)
Maxterms (rows where the result is false)
Canonical product of sums (POS, CNF)
How to generate a truth table
- Type your expression in the Boolean expression field, for example
(A and B) -> not C,A B' + A' Borp ↔ q. The operator buttons insert ¬ ∧ ∨ ⊕ ↑ ↓ → ↔ and brackets at the cursor. - The table updates as you type; press Enter or click Generate table to refresh it at once.
- Choose the Variable order: Alphabetical (the usual textbook order) or Order of appearance in the expression.
- Under Show values as, pick 1 and 0 (digital electronics) or T and F (logic courses).
- Tick Show sub-expression columns to see every intermediate step, such as
A ∧ Bbefore¬(A ∧ B). This is the layout teachers usually expect when you check a formula by hand. - Read the Classification, the minterm and maxterm lists and the canonical forms below the table. Copy CSV and Download CSV export the table for a spreadsheet or a report.
Supported syntax
| Operation | You can type | Shown as |
|---|---|---|
| NOT | not A, !A, ~A, ¬A, A' |
¬A |
| AND | A and B, A & B, A && B, A * B, A · B, A ∧ B, A B |
A ∧ B |
| OR | A or B, A + B, A ∨ B |
A ∨ B |
| XOR | A xor B, A ^ B, A ⊕ B |
A ⊕ B |
| NAND / NOR | nand, ↑ / nor, ↓ |
↑ / ↓ |
| Implication | A implies B, A -> B, A => B, A → B |
A → B |
| Equivalence | A iff B, A xnor B, A <-> B, A <=> B, A ↔ B |
A ↔ B |
OR can also be written with a vertical bar: A | B or A || B. Operator words are case-insensitive. The constants are 0, 1, true and false. Every other name is a variable, including single letters such as T or F, and names like x1 or Light2. A name made of several letters is one variable: AB is not A AND B. Write A B, A·B or A & B for the product. Operator words, including the French et, ou and non, cannot be used as variable names.
Precedence, from tightest to loosest: NOT, then AND and NAND, then XOR, then OR and NOR, then implication, then equivalence. So ¬a ∧ b ∨ c means ((¬a) ∧ b) ∨ c. Implication groups to the right, as in logic textbooks: a → b → c means a → (b → c). The Read as: line shows how the tool understood your input, so you can check the grouping before you trust the table.
Minterms, maxterms and canonical forms
Rows are numbered from 0, with the first variable as the most significant bit. With variables A, B, C, row 5 is A = 1, B = 0, C = 1. A minterm is a row where the expression is true, and the list Σm(…) gives their numbers. A maxterm is a row where it is false, listed as ΠM(…).
The canonical sum of products (SOP, disjunctive normal form) ORs one AND term per minterm. For XOR this gives (¬A ∧ B) ∨ (A ∧ ¬B). The canonical product of sums (POS, conjunctive normal form) ANDs one OR clause per maxterm, with each variable complemented where its bit is 1: (A ∨ B) ∧ (¬A ∨ ¬B). These forms are complete but not minimal. Use them as the starting point for a Karnaugh map or the Quine–McCluskey method.
Tautology, contradiction or contingency
A tautology is true on every row, like the contrapositive law (p → q) ↔ (¬q → ¬p). A contradiction is false on every row, like p ∧ ¬p. Anything else is a contingency. Two formulas are logically equivalent exactly when formula1 <-> formula2 is a tautology, which gives a quick way to check a simplification.
Frequently asked questions
How many variables can I use?
Up to 10 variables, which gives 2¹⁰ = 1,024 rows. Beyond that a full table is no longer readable, so the tool asks you to split the expression.
Why does AB count as a single variable?
The tool accepts descriptive names such as door_open or x1, so letters written together form one name. To multiply A and B, separate them with a space (A B) or use an operator such as ·, * or &.
Can I use T and F as values?
As constants, write 1/0 or true/false. The letters T and F are treated as ordinary variables. To display the table with T and F instead of 1 and 0, choose T and F under Show values as.
What does A' mean?
A trailing apostrophe is the NOT notation common in digital electronics: A' is ¬A and (A B)' is ¬(A ∧ B). It binds as tightly as the prefix NOT.
Is the SOP the simplest form of my expression?
No. The canonical SOP lists every minterm in full, so it is often long. It is exact and unique for a given variable order, which makes it a reliable basis for simplification by hand or with a Karnaugh map.
How is implication evaluated?
A → B is false only when A is true and B is false. A false premise makes the implication true, which surprises many students at first.
Related tools
- Number Base Converter Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, with two's complement, fractions and step-by-step working.
- Scientific Calculator Free online scientific calculator with trigonometry in degrees or radians, logarithms, powers, roots, factorials, keyboard input and a calculation history.
- Text to Binary, Hex and ASCII Convert text to binary, hexadecimal, decimal or octal codes and back, with UTF-8 bytes or Unicode code points, custom separators and a character table.