Truth Table & Boolean Logic Solver

Type a boolean expression and get its full truth table instantly, plus the minterms and the canonical sum-of-products form. Supports AND, OR, NOT, XOR, parentheses, and implicit AND like AB. Everything runs in your browser.

Calculator Electronics Updated Oct 16, 2026
How to Use
  1. Type a Boolean expression. Variables are single letters, and upper and lower case are different variables, so a and A are two separate inputs.
  2. Write AND as &, *, a middle dot (·) or a period, or just put letters together (AB). Write OR as + or |, NOT as !, ~ or an apostrophe after the letter (A'), and XOR as ^. The words and, or, not and xor work too.
  3. The truth table builds as you type, with the rows where the output is 1 highlighted.
  4. Read the minterm list and the canonical sum-of-products beside the table.
  5. Try a preset such as XOR or the 3-input majority function, or type two expressions in turn and compare their minterm lists.
f =
AND & * or just AB  ·  OR + |  ·  NOT ! ~ A′  ·  XOR ^  ·  group with ( )
Variables
—
Minterms (output = 1)
—
Canonical sum-of-products
—

Worked Example

The default expression AB + BC + AC is the majority function: it is 1 when at least two of the three inputs are 1. The solver builds an 8-row table and marks rows 011, 101, 110 and 111, so the minterms are Σm(3, 5, 6, 7) and the canonical sum-of-products is A′BC + AB′C + ABC′ + ABC. This is also the carry output of a full adder.

Variation, De Morgan's law: type !(A & B) and the minterms are Σm(0, 1, 2), giving A′B′ + A′B + AB′. Now type !A + !B: the list is the same, which proves the two expressions are equivalent.

The common mistake: expecting AB′ to mean NOT (AB). The apostrophe only complements the B, so AB′ is 1 in row 2 alone. To complement the whole product write (AB)′, which is 1 in rows 0, 1 and 2.

Show Work: How the Table Is Built

Here is what the solver does with the default expression AB + BC + AC, step by step.

1. Read the expression. Letters next to each other are joined with AND, so the input is read as (A AND B) OR (B AND C) OR (A AND C). AND is applied before OR, the same way multiplication comes before addition.

2. Find the variables. The letters used are A, B and C, sorted alphabetically. Three variables give 23 = 8 rows. Each row number is the binary number formed by the inputs, with the first variable as the most significant bit: m = 4A + 2B + C.

3. Evaluate every row. Row 5 is A = 1, B = 0, C = 1. AB = 0, BC = 0 and AC = 1, so the output is 1. Row 4 (A = 1, B = 0, C = 0) gives 0 + 0 + 0 = 0.

4. Collect the minterms. The rows that give 1 are 3, 5, 6 and 7, shown as Σm(3, 5, 6, 7).

5. Write the sum-of-products. Each minterm becomes a product with a prime on every variable that is 0 in that row: row 3 (011) is A′BC, row 5 (101) is AB′C, row 6 (110) is ABC′ and row 7 (111) is ABC. ORing them gives A′BC + AB′C + ABC′ + ABC.

Formulas

Number of rows
rows = 2n
n variables; 8 variables give 256 rows.
Row number
m = 4A + 2B + C
For three variables; the first letter alphabetically is the highest bit.
Minterm
row 101 → AB′C
Plain where the input is 1, primed where it is 0.
Canonical SOP
f = Σm(rows where f = 1)
The OR of all the minterms.
De Morgan
(AB)′ = A′ + B′ · (A + B)′ = A′B′
Push a NOT inside and swap AND with OR.
Precedence
NOT > AND > XOR > OR
A + BC means A + (BC).

Boolean logic and truth tables

Underneath every digital device is Boolean algebra: a maths of just two values, true (1) and false (0), combined with three core operations — AND (true only if both inputs are true), OR (true if either is), and NOT (flips the value). From those, everything else is built, including XOR (true when the inputs differ). A truth table simply lists every possible combination of the input variables and the resulting output. Because each variable can be 0 or 1, a function of n variables has 2n rows — the table is the complete, exhaustive definition of what the function does.

This solver parses your expression into a syntax tree, then evaluates it for all 2n input combinations to build the table. The same two-valued logic underlies logic gates, processor instructions and the conditions in software.

Minterms and sum-of-products

Once you have the table, a powerful trick lets you write the function as a formula. Each row where the output is 1 is a minterm: a single AND of all the variables, each taken plain if it is 1 in that row or complemented (with a prime, A′) if it is 0. OR all the minterms together and you get the canonical sum-of-products — an expression guaranteed to be equivalent to your original. It is the bridge from a desired behaviour (the table) to a circuit (gates). For the 3-input majority function above, the minterms are the four rows with two or more 1s, and their sum-of-products is exactly a circuit you could wire up. Simplifying that expression further — with Boolean algebra or a Karnaugh map — is the next step in digital design, and the canonical SOP is always where it begins.

A use you can try right now

Boolean algebra has laws, and the most famous are De Morgan’s: NOT(A AND B) equals (NOT A) OR (NOT B), and NOT(A OR B) equals (NOT A) AND (NOT B). They are why a NAND gate can build anything, and why you can rewrite a condition to remove a negation. Test one: type !(A & B), note its truth table, then type !A + !B and confirm the columns match exactly. Equivalence proven, no algebra required — that side-by-side check is one of the most useful things a truth table can do.

History

George Boole set out an algebra of logic in The Mathematical Analysis of Logic (1847) and An Investigation of the Laws of Thought (1854). Augustus De Morgan, his contemporary, stated the laws that carry his name in 1847.

Truth tables in their modern form appeared around 1921, in work by Emil Post and Ludwig Wittgenstein. In 1937 Claude Shannon showed in his MIT master's thesis that Boolean algebra describes relay and switching circuits, which is why the same tables now describe logic gates and processor instructions.

About This Solver

The solver accepts the full set of common notations — symbolic operators, word operators (and / or / not / xor), the apostrophe for complement, and implicit AND by juxtaposition, so you can paste most expressions straight from a textbook. Variables are case-sensitive. It computes the exact truth table, the list of minterms, and the canonical sum-of-products, for up to eight variables. Everything runs on your device with nothing uploaded.

Frequently Asked Questions

What operators can I use?

AND: &, *, a middle dot (·), a period, or letters written together (AB means A AND B). OR: + or |. NOT: !, ~ or an apostrophe after the letter (A'). XOR: ^. The words and, or, not and xor, the symbols ∧ ∨ ¬ ⊕, brackets and the constants 0 and 1 also work. Precedence is NOT, then AND, then XOR, then OR.

What are minterms and sum-of-products?

A minterm is one row of the truth table where the output is 1, written as a product of all the variables, each plain if it is 1 in that row or primed if it is 0. The canonical sum-of-products is the OR of all those minterms. It is exactly equivalent to your expression and is the usual starting point for simplifying a logic circuit.

Why does AB' not mean NOT (A AND B)?

The apostrophe applies only to the letter or bracket just before it. AB' means A AND (NOT B), which is 1 only in row 2 (A = 1, B = 0). To complement the whole product, write (AB)' or !(AB), which is 1 in rows 0, 1 and 2.

How many variables can it handle?

Up to eight, which is a 256-row table. Each extra variable doubles the number of rows, so the limit keeps the table readable.

How do I check that two expressions are equivalent?

Type each one and compare the minterm lists: equivalent expressions give the same list over the same variables. !(A & B) and !A + !B both give Σm(0, 1, 2). If one expression leaves out a variable, its table has fewer rows and the numbers will not line up; mention the variable in both, for example A(B + B') instead of A.

How do I use the Truth Table & Boolean Logic Solver?

Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Is it free? Does it work without internet?

Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.

Where does my data go?

Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.

Common Use Cases

Check a Simplification

Compare the minterm lists of the original and the simplified expression. If they match, the simplification is correct.

Design From a Specification

Write down when the output should be 1, read off the sum-of-products, then simplify it in the Boolean Algebra Lab.

Coursework and Revision

See De Morgan's laws, distribution and absorption hold row by row by typing both sides.

Verify an Adder

A full adder's sum is (A^B)^C and its carry is AB + BC + AC; the tables confirm both against the binary addition of A, B and C.

Last updated: