Generating truth table...
Enter a Boolean expression or choose a quick-load example, then generate its complete truth table.
How to Use the Truth Table Generator
The truth table generator converts a Boolean expression into every possible assignment of true and false values. Enter variables such as A, B, P, or DoorOpen, connect them with Boolean operators, and select Generate Truth Table. The result lists the variables in their first-seen order and places the complete expression in the final column.
You can type common words such as AND, OR, NOT, XOR, NAND, NOR, IMPLIES, and IFF. Symbolic forms including ¬, ∧, ∨, ⊕, →, and ↔ are also supported. Parentheses make grouping explicit. Enable intermediate columns when you want to inspect how each subexpression contributes to the final result, which is especially useful when checking homework or tracing a digital-logic design.
The display selector changes truth values between T/F, 1/0, and True/False without changing the underlying logic. Expressions are evaluated on the server with a defined operator precedence, and the tool accepts up to eight distinct variables. That limit produces at most 256 rows, keeping the complete table readable and responsive on phones as well as desktop screens.
How Boolean Expression Truth Tables Work
A Boolean variable has exactly two possible values: true or false. A truth table systematically assigns those values to every variable, then evaluates the expression once per assignment. With one variable there are two combinations. With two variables there are four, and with three variables there are eight. In general, an expression containing n distinct variables requires 2n rows.
The rows are not guesses or samples; they exhaust the possible inputs within classical two-valued logic. That completeness makes truth tables useful for proving equivalence, finding counterexamples, checking conditions in software, and understanding combinational logic circuits. The final column describes the Boolean function computed by the entire expression.
Boolean Operators and Logic Gate Symbols
Each operator defines a small truth function. NOT reverses one input. AND requires both inputs to be true, while inclusive OR requires at least one. XOR is different from inclusive OR because XOR is false when both inputs are true. NAND and NOR negate AND and OR respectively, and each can be used as a universal gate in digital circuit construction.
| Operation | Accepted input | Symbol | Result rule | Logic name |
|---|---|---|---|---|
| NOT | NOT A, !A, ~A | ¬ | True when A is false | Inverter |
| AND | A AND B, A & B | ∧ | True only when both are true | AND gate |
| NAND | A NAND B | NAND | False only when both are true | NAND gate |
| OR | A OR B, A | B | ∨ | True when either or both are true | OR gate |
| NOR | A NOR B | NOR | True only when both are false | NOR gate |
| XOR | A XOR B, A ^ B | ⊕ | True when inputs differ | XOR gate |
| Implication | A -> B, A IMPLIES B | → | False only when A is true and B is false | Material implication |
| Equivalence | A IFF B, A XNOR B | ↔ | True when inputs match | XNOR gate |
Operator Precedence in Boolean Expressions
When parentheses do not settle the order, this calculator evaluates NOT first, followed by AND or NAND, XOR, OR or NOR, implication, and finally equivalence. Most binary operators associate from left to right. Implication associates from right to left, so A → B → C means A → (B → C).
Precedence conventions can differ between textbooks and programming languages. Parentheses are therefore the safest way to communicate intent. Writing (A OR B) AND C is clearer than relying on a reader to remember which connective binds more tightly.
Tautologies, Contradictions, and Contingencies
A tautology is true on every row. For example, A OR NOT A is always true in classical logic. A contradiction, such as A AND NOT A, is false on every row. A contingency has a mixture of true and false results, so its value depends on the inputs.
The classification badge summarizes the final column, while the distribution bar shows the exact number of true and false rows. This provides a quick check without replacing the complete table.
Truth Table Generator FAQ
How do I make a truth table from a Boolean expression?
List every variable, create all 2n true/false assignments, and evaluate the operations in each row. This generator performs those steps and can expose intermediate subexpressions so you can verify the calculation.
What is the order of operations in Boolean logic?
This tool uses NOT, AND/NAND, XOR, OR/NOR, implication, then equivalence from strongest to weakest. Parentheses override that order and are recommended whenever an expression could be read in more than one way.
What is the difference between OR and XOR?
Inclusive OR is true when either input or both inputs are true. XOR means exclusive OR, so it is true only when exactly one of its two inputs is true.
How many rows does a truth table need?
A complete table with n variables contains 2n rows because every variable independently has two values. Three variables need eight rows, while eight variables need 256 rows.
What makes a Boolean expression a tautology?
An expression is a tautology when its final column is true under every possible variable assignment. Truth-table equivalence proofs often form a biconditional between two expressions and check whether that biconditional is a tautology.
Can I use implication and biconditional operators?
Yes. Enter implication with →, ->, =>, or IMPLIES, and enter biconditional with ↔, <->, <=>, IFF, or XNOR. Material implication is false only when the antecedent is true and the consequent is false.
Related Calculators
System of Equations Calculator
Solve simultaneous linear equations with clear steps.
Matrix Multiplier
Multiply matrices and inspect each dot-product step.
Combination & Permutation Calculator
Count ordered and unordered selections.
Number Pattern & Sequence Finder
Detect common sequence rules and predict next terms.
Euler Totient Calculator
Count integers coprime to a selected number.
Fibonacci Sequence Generator
Generate exact Fibonacci terms and explore recurrence.