Enter your values
Evaluate a Boolean expression
Build a truth table and identify whether the statement is always true, always false, or depends on its inputs.
Variables A–Z are accepted (up to 6). NOT binds first, then AND, XOR, and OR. Adjacent terms mean AND; expressions may use words or symbols.
Contingency
(A ∧ B) ∨ ¬ C is a contingency: it is true for 5 of 8 possible input combinations and false for 3.
Truth table
Each row evaluates the expression for one possible assignment.
| A | B | C | (A ∧ B) ∨ ¬ C |
|---|---|---|---|
| 0 | 0 | 0 | 1 · True |
| 0 | 0 | 1 | 0 · False |
| 0 | 1 | 0 | 1 · True |
| 0 | 1 | 1 | 0 · False |
| 1 | 0 | 0 | 1 · True |
| 1 | 0 | 1 | 0 · False |
| 1 | 1 | 0 | 1 · True |
| 1 | 1 | 1 | 1 · True |
Canonical forms
(¬A ∧ ¬B ∧ ¬C) ∨ (¬A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ ¬C) ∨ (A ∧ B ∧ ¬C) ∨ (A ∧ B ∧ C)(A ∨ B ∨ ¬C) ∧ (A ∨ ¬B ∨ ¬C) ∧ (¬A ∨ B ∨ ¬C)These canonical forms reproduce the truth table. They are systematic forms, not necessarily the shortest possible simplification.
How to read this result
- List the distinct variables in alphabetical order: A, B, C.
- There are 23 = 8 possible assignments.
- Evaluate NOT first, then AND, XOR, and OR for each row.
- The output is 1 in 5 rows and 0 in 3 rows, so the expression is a contingency.
What is a boolean algebra calculator?
Boolean algebra is a system for working with truth values, usually written 0 (false) and 1 (true). This calculator evaluates a propositional expression for every possible assignment of its variables, then summarizes its logical behavior.
Important terms
- Truth table
- A table containing one row for each possible assignment of truth values to the variables in an expression.
- Tautology
- A proposition that evaluates to true for every possible assignment.
- Contradiction
- A proposition that evaluates to false for every possible assignment.
- Contingency
- A proposition that is true for some assignments and false for others.
- Canonical SOP and POS
- Sum of products groups true rows as AND terms joined by OR; product of sums groups false rows as OR terms joined by AND.
When this method is useful
- Check a logic homework expression row by row.
- Compare two expressions by comparing their truth-table outputs.
- Inspect canonical sum-of-products and product-of-sums representations.
- Explore the behavior of NOT, AND, XOR, and OR in digital logic.
Formula and variables
- n
- number of distinct variables
- N
- number of rows in the complete truth table
- f
- Boolean function represented by the expression
Each of n variables can independently be 0 or 1, so the number of assignments is 2 × 2 × … × 2 = 2ⁿ. Evaluating the expression on every assignment completely specifies its Boolean function.
Domain note: This tool accepts up to six variables and produces at most 64 rows. Supported operators are NOT, AND, XOR, and OR, with parentheses and standard precedence. It does not perform minimum-gate Karnaugh-map or Quine–McCluskey simplification.
How to use this calculator
- 1
Enter variables and operators using words (AND, OR, NOT, XOR) or symbols (∧, ∨, ¬, ⊕).
- 2
The calculator identifies the variables and lists all 2ⁿ possible assignments in alphabetical order.
- 3
Each row is evaluated with NOT before AND, then XOR, then OR; parentheses override this order.
- 4
The output counts determine whether the expression is a tautology, contradiction, or contingency.
- 5
Canonical SOP is formed from true rows; canonical POS is formed from false rows.
Step-by-step examples
Example 1
Problem: Evaluate (A AND B) OR NOT C.
Substitution: For A = 1, B = 1, C = 1: (1 AND 1) OR NOT 1 = 1 OR 0.
Result: The output is 1 for this row. Across all eight rows, the expression is true in 5 and false in 3.
Because it is true for some assignments and false for others, this expression is a contingency.
Example 2
Problem: Classify A OR NOT A.
Substitution: If A = 0, the output is 0 OR 1 = 1; if A = 1, it is 1 OR 0 = 1.
Result: Both rows are true, so the expression is a tautology.
This is the law of excluded middle.
Example 3
Problem: Classify A AND NOT A.
Substitution: If A = 0, the output is 0 AND 1 = 0; if A = 1, it is 1 AND 0 = 0.
Result: Both rows are false, so the expression is a contradiction.
A proposition and its negation cannot both be true.
Rules, edge cases, and related ideas
Operator precedence
Parentheses are evaluated first, followed by NOT, AND, XOR, and OR. Use parentheses whenever the intended grouping might be unclear.
XOR
Exclusive OR is true exactly when its two inputs differ: 0 ⊕ 0 = 0, 0 ⊕ 1 = 1, 1 ⊕ 0 = 1, and 1 ⊕ 1 = 0.
Canonical forms
A minterm is true for exactly one input row. OR-ing the true-row minterms gives canonical SOP; maxterms for false rows combine into canonical POS.
Edge cases and limitations
- A constant-only expression has no variables, so there is no variable truth table to display.
- More than six distinct variables is rejected to keep the table readable.
- Incomplete operators, unmatched parentheses, and unsupported symbols produce an input message instead of a partial table.
How this differs from a related concept
Use this calculator to evaluate one expression and inspect its complete truth table. It reports canonical forms, but does not claim a minimum-literal simplification; use a dedicated Boolean minimizer for that task.
Understand the result
The truth table is the definitive finite check for the supported propositional expressions. Two expressions with the same output in every row are logically equivalent, even if their written forms differ. Canonical forms provide a reproducible representation; they are not guaranteed to be the shortest expression.
Common mistakes
- Forgetting that NOT binds more tightly than AND and OR.
- Reading XOR as ordinary OR; XOR is false when both inputs are true.
- Assuming a canonical SOP or POS is automatically the shortest form.
- Omitting parentheses when a different grouping is intended.
Frequently asked questions
How many truth-table rows are there?
For n distinct variables, a complete truth table has 2ⁿ rows. This calculator supports up to six variables, or 64 rows.
What is the difference between SOP and POS?
Canonical SOP combines AND terms for rows where the output is 1. Canonical POS combines OR terms for rows where the output is 0.
Does the calculator minimize Boolean expressions?
It provides canonical SOP and POS forms. These are systematic but may not be minimal; a separate Boolean minimization method is needed to guarantee a shortest form.