Generate a Boolean truth table online
This truth table generator evaluates a Boolean expression for every combination of its inputs. Type an expression, and the table updates automatically with a column for each variable and a final Result column. It supports up to five distinct variables, which produces at most 32 rows. Use it to check a digital logic exercise, compare a proposed circuit expression or review a discrete mathematics assignment.
The table shows false as 0 and true as 1. Variables are sorted alphabetically, and the rows follow binary counting order with the leftmost variable changing slowest. The copy control exports the complete table as tab-separated text, including its header. You can paste that text into a spreadsheet without manually recreating the columns.
Enter the supported operators
Use & or * for AND, | or + for OR, ^ for XOR, and ! or ~ for NOT. NOT goes before its operand, so !A means NOT A and !(A|B) negates a parenthesized group. Adjacent letters imply AND: AB is the same as A&B. Explicit operators are often easier to review in longer expressions.
Variables must be single letters. Lowercase input is normalized to uppercase, so a and A refer to the same variable. Names containing digits or multiple-letter identifiers are not supported as names: x1 is invalid, while AB is a product of two variables rather than a variable called AB. Writing English words such as AND also enters letters, not an operator keyword.
The parser does not accept apostrophe complements, implication arrows, equivalence symbols or standalone numeric constants. Translate notation from a textbook before entering it. For example, replace a complemented A with !A and use parentheses around the full expression being negated. A syntax error appears in place of the table while the input is incomplete or invalid.
Operator precedence and parentheses
NOT binds most tightly, then AND. OR and XOR share a precedence level in this parser and are evaluated left to right. Consequently A|B^C is interpreted as (A|B)^C. If you intend A|(B^C), enter those parentheses explicitly. This convention can differ from the precedence rules in a programming language you are studying.
Parentheses are also the simplest way to communicate your intended circuit. Compare !(A&B) with !A&B: the first negates the whole AND output, while the second negates only A before the AND operation. Balanced brackets matter; a missing closing parenthesis prevents the tool from producing a valid table.
Use the operator symbols shown beside the input rather than copying an expression unchanged from another calculator. In this interface, the caret means exclusive OR, not exponentiation. The result is a Boolean output, not an arithmetic sum, even when the alternative + and * notation is used.
Worked example: A&B | !C
The default expression is A&B | !C, interpreted as (A AND B) OR (NOT C). Its three variables create eight possible input assignments. The rows below were generated with the same parser and truth-table builder used by the interface.
| A | B | C | Result |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Whenever C is false, !C is true and the OR output is true regardless of A and B. When C is true, the output depends on A&B, so both of those inputs must be true. This is a useful way to check the table by reasoning about cases instead of repeating the full expression mechanically in every row.
Compare expressions and identify special cases
Two expressions are equivalent when their outputs match for every assignment of the same variables. This interface has one expression input, so compare results by copying one table and then entering the other expression. If the detected variable sets differ, align assignments carefully instead of comparing row numbers alone.
An output that is true on every assignment is a tautology; an output that is false on every assignment is a contradiction. A mixed output is contingent on the inputs. The generator shows the rows but does not add an automatic classification badge or calculate intermediate subexpression columns. Read the final column to make that assessment.
A truth table is exhaustive for the expression's listed variables, but it describes a static logical function. It does not model switching delays, electrical voltage thresholds, sequential memory or how a physical circuit behaves while inputs change. Use it to establish the intended logic before checking hardware-specific behavior separately.
Copy, simplify and troubleshoot
The row-count formula is 2ⁿ for n distinct variables. Repeating a letter does not add a variable or double the table size. If the expression contains more than five distinct letters, the interface asks you to reduce the variable count so the table remains readable. Copy is available when the current expression has a valid table.
For simplification, transfer the true minterms manually to the Karnaugh map solver, which supports up to four variables. For individual gate behavior, use the logic gate simulator. Read the truth tables guide and logic gates guide for additional notation and exercises.