Build Your Truth Table
Supported operators: NOT, AND, OR, XOR, NAND, NOR, XNOR, parentheses, 0, 1, !, ~, &, |, ^, &&, ||. Maximum recommended variables: 8.
Formula Used
The table size uses 2n, where n is the number of unique variables. Every row represents one binary assignment.
- NOT(A) = 1 when A = 0.
- A AND B = 1 only when both values are 1.
- A OR B = 1 when at least one value is 1.
- A XOR B = 1 when inputs are different.
- A NAND B = NOT(A AND B).
- A NOR B = NOT(A OR B).
- A XNOR B = NOT(A XOR B).
Canonical output forms are also shown. The calculator builds Σm minterms for true rows and ΠM maxterms for false rows.
How to Use This Calculator
- Enter a Boolean expression using supported operators.
- Add parentheses where grouping matters.
- Click Generate Truth Table.
- Review the result summary and canonical forms.
- Inspect the truth table and Plotly graph.
- Download the generated table as CSV or PDF.
Example Data Table
Example expression: A XOR B
| # | A | B | Output |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 2 | 1 | 0 | 1 |
| 3 | 1 | 1 | 0 |
Frequently Asked Questions
1. What does this calculator produce?
It generates a complete truth table for your Boolean expression. It also reports row totals, true and false counts, canonical SOP, canonical POS, and useful minterm or maxterm notation.
2. Which operators can I use?
You can use NOT, AND, OR, XOR, NAND, NOR, XNOR, parentheses, constants 0 and 1, plus shorthand symbols like !, ~, &, |, ^, &&, and ||.
3. Why does the number of rows grow quickly?
Each added variable doubles the combinations. That is why the truth table size follows 2n. Three variables create 8 rows, while eight variables create 256 rows.
4. Should I always use parentheses?
Parentheses are strongly recommended. They remove ambiguity, make expressions easier to read, and ensure the calculator evaluates your intended grouping instead of relying only on built-in precedence.
5. What are minterms and maxterms?
Minterms represent rows where the output is true. Maxterms represent rows where the output is false. They help express the same logic function in canonical SOP and canonical POS forms.
6. Why did my expression return an error?
Most errors come from missing parentheses, unsupported symbols, or missing operators between variables. Rewrite the expression with explicit operators and balanced parentheses for reliable evaluation.
7. How many variables should I use?
For readability, eight variables or fewer works best. Larger tables become difficult to scan, export, and verify because each new variable doubles the total number of rows.
8. What does the graph show?
The Plotly graph shows output values by row index. It helps reveal alternating patterns, repeated logic regions, and clusters of true or false outputs visually.