Boolean Algebra Calculator

Type a Boolean expression in up to four variables to get its truth table, minterms, maxterms, canonical sum of products and the simplified (minimal) form.

Built by Sabki SolutionsRules: Quine–McCluskey minimisationLast updated

AND: AB, A&B, A*B · OR: A+B, A|B · NOT: A', !A · XOR: A^B · NAND, NOR, XNOR words

Simplified (Minimal SOP)

A'C + AB

Minterms

Σm(1, 3, 6, 7)

Maxterms

ΠM(0, 2, 4, 5)

Canonical Sum of Products

A'B'C + A'BC + ABC' + ABC

Rows Where Output Is 1

4 of 8

RowABCOutput
00000
10011
20100
30111
41000
51010
61101
71111

Boolean Expression Evaluator and Simplifier

Type any expression using A, B, C and D. The calculator builds the truth table, lists the minterms and maxterms, and finds the shortest sum-of-products form, the same answer a Karnaugh map gives.

Operators

OperationAccepted formsPrecedence
NOTA', !A, ~A, NOT A1 (highest)
AND / NANDAB, A&B, A*B, A·B, A AND B, A NAND B2
XOR / XNORA^B, A XOR B, A XNOR B3
OR / NORA+B, A|B, A OR B, A NOR B4

Key identities

  • De Morgan (AB)′ = A′ + B′; (A + B)′ = A′B′
  • Absorption A + AB = A; A(A + B) = A
  • Consensus AB + A′C + BC = AB + A′C
  • Distribution A + BC = (A + B)(A + C)

Worked examples

1. AB + A'C + BC (the default). Σm(1, 3, 6, 7); simplifies to A'C + AB.

2. (A + B)(A + C). Σm(3, 4, 5, 6, 7) → A + BC.

3. A'B'C' + A'BC' + AB'C' + ABC'. Every row with C = 0 → C'.

4. A NAND B. → A' + B' (De Morgan).

Where several minimal forms exist, the calculator shows one of them.

Related tools

Frequently Asked Questions

How do I type an expression?

Use variables A to D. AND: AND, &, * or just write letters together (AB). OR: OR, | or +. NOT: NOT, !, ~ or a quote after the term (A'). XOR: XOR or ^. NAND, NOR and XNOR are also accepted.

What is the order of operations?

NOT first, then AND, then XOR, then OR. Use brackets to override: (A + B)C.

What is a minterm?

A product term containing every variable once, true for exactly one input row. Σm(1, 3) lists the rows (by binary number) where the output is 1.

What is a maxterm?

A sum term false for exactly one row. ΠM lists the rows where the output is 0; the product-of-sums form uses them.

How is the expression simplified?

With the Quine–McCluskey method: minterms are combined into prime implicants, then the smallest set covering every minterm is chosen. It gives the same result as a Karnaugh map.

Why does AB + A'C + BC simplify to AB + A'C?

By the consensus theorem, BC is redundant: whenever B and C are both 1, either AB or A'C is already 1.

What are the basic Boolean laws?

Identity A + 0 = A, A·1 = A; null A + 1 = 1, A·0 = 0; idempotent A + A = A; complement A + A' = 1, A·A' = 0; absorption A + AB = A; De Morgan (AB)' = A' + B' and (A + B)' = A'B'.

What is XOR?

Exclusive OR is 1 when the inputs differ: A XOR B = A'B + AB'. It is used in adders, parity and CRCs.

Why are NAND and NOR called universal?

Any logic function can be built from NAND gates alone (or NOR alone). NOT A = A NAND A.

How many rows does a truth table have?

2ⁿ for n variables: 4 rows for two variables, 8 for three and 16 for four.

Related Calculators

More in Computer Science · Engineering calculators · All calculators A–Z