About the Boolean Expression Calculator
A truth table is the most complete description of a Boolean expression: it lists the output for every possible combination of inputs. From it you can read the minterms and maxterms, write the canonical sum of products and product of sums, spot tautologies and contradictions, and prove that two expressions are equivalent. Building one by hand is simple but tedious, and errors creep in as the number of variables grows, since each extra variable doubles the rows.
This Boolean expression calculator builds the truth table for an expression of up to eight variables. It lists the minterms and maxterms, writes the canonical SOP and POS forms, says whether the expression is a tautology, a contradiction or satisfiable, and, if you enter a second expression, checks whether the two are equivalent and shows the first input where they differ.
How to Use the Boolean Expression Calculator
Type the expression. Letters are variables; use ' or ! for NOT, side-by-side letters or · for AND, + for OR and ^ for XOR. The words AND, OR, NOT and XOR also work.
Optionally type a second expression in compare with to test equivalence.
The truth table appears in the steps, one row per input combination.
The Formulas
rows: 2ⁿ for n variables, numbered in binary with the first variable as the most significant bit
minterm: the AND of all variables, complemented where the row has 0 (true on one row)
maxterm: the OR of all variables, complemented where the row has 1 (false on one row)
canonical SOP = OR of the minterms of the true rows = Σm(…)
canonical POS = AND of the maxterms of the false rows = ΠM(…)
Step-by-Step Example
A(B + C), compared with AB + AC.
A B C | A(B + C) A B C | A(B + C)
0 0 0 | 0 1 0 0 | 0
0 0 1 | 0 1 0 1 | 1
0 1 0 | 0 1 1 0 | 1
0 1 1 | 0 1 1 1 | 1
minterms Σm(5, 6, 7) maxterms ΠM(0, 1, 2, 3, 4)
canonical SOP: AB'C + ABC' + ABC
AB + AC gives the same column, so the expressions are equivalent
This proves the distributive law A(B + C) = AB + AC for every input, not just for the cases you happened to try.
Reading Minterms and Maxterms
Each row has a number: with variables A, B and C, row 5 is binary 101, meaning A = 1, B = 0, C = 1. Its minterm is AB'C, the one AND term that is true only on that row. The canonical sum of products ORs together the minterms of every true row, so it is true exactly where the function is. The shorthand Σm(5, 6, 7) lists just the row numbers.
Maxterms work the other way round. Row 0 has maxterm (A + B + C), the one OR term that is false only when A, B and C are all 0. The canonical product of sums ANDs together the maxterms of every false row. Note that a minterm uses the variable where the row has 1, but a maxterm complements it there.
Equivalence and Proofs
Two Boolean expressions are equal if and only if their truth tables match on every row. That makes the truth table a complete proof method for any identity with a manageable number of variables. Comparing (A + B)' with A'B' confirms De Morgan's law; comparing (A + B)' with A' + B' fails at A = 0, B = 1, where the first gives 0 and the second gives 1, exposing a common mistake.
Equivalence checking is used in practice to verify that an optimised circuit still behaves like the original, and that a rewritten condition in a program still selects the same cases.
Tautologies, Contradictions and Satisfiability
An expression that is 1 on every row is a tautology, such as A + A'. One that is 0 on every row is a contradiction, such as AA'. Anything else is satisfiable: at least one input makes it true. Finding such an input for large expressions is the famous SAT problem, which is hard in general; for up to eight variables a truth table settles it instantly.
Operator Precedence
Without brackets, NOT binds tightest, then AND, then XOR, then OR. So AB + C means (A·B) + C, and A + BC means A + (B·C). A prime after a bracket negates the whole bracket: (A + B)' is NOT (A OR B). When in doubt, add brackets; the truth table will show exactly how the expression was read.
From Truth Table to Circuit
A truth table is also a design starting point. When you know what a circuit must do, such as light an LED when a majority of three switches are on, you write the table first: the output is 1 on rows 3, 5, 6 and 7. The canonical SOP, A'BC + AB'C + ABC' + ABC, already describes a working circuit, and simplification reduces it to AB + AC + BC. Writing the table first keeps the design honest, because every input combination is considered.
Large Truth Tables
Each extra variable doubles the table: 3 variables give 8 rows, 5 give 32 and 8 give 256. The calculator evaluates all of them but shows the first 64 rows in the steps to keep the page readable; the minterm and maxterm lists always cover every row. For expressions with many variables, the minterm list is usually more useful than the full table, and the Boolean algebra calculator can turn it into a compact simplified form.
Understanding Your Result
The headline says whether the expression is a tautology, a contradiction, or how many rows are true.
The minterms and maxterms line lists the true and false rows.
The canonical SOP and canonical POS lines write the full canonical forms.
The equivalence line reports whether the second expression matches, and if not where they first differ.
When Should You Use This Calculator?
Use it to build truth tables for logic and discrete maths homework.
Use it to prove or disprove that two expressions are equivalent.
Use it to find the canonical forms needed before simplification.
Common Mistakes
Getting the row order wrong. The first variable is the most significant bit.
Mixing up minterm and maxterm complements. Minterms complement on 0, maxterms on 1.
Assuming equivalence from a few rows. All 2ⁿ rows must match.
Ignoring precedence. AND binds before OR.