Boolean algebra simplifier — minimal SOP and POS

Type a logic expression such as A'B + AB + AB' and get its minimal sum of products and product of sums, its minterms and maxterms, and a full truth table.

Live demo · real result from this tool
AND: AND & · * or juxtaposition; OR: OR | +; NOT: NOT ! ~ ¬ or a postfix '; also XOR ^, NAND, NOR, XNOR, -> and <->.
Minimal sum of productsA + B
Minimal product of sums
A + B
Expression is
contingent (depends on the inputs)
Minterms Σm
1, 2, 3
Maxterms ΠM
0

Parsed as

((A'·B) + (A·B)) + (A·B')

Truth table

ABResult
000
011
101
111

Method

The expression is evaluated for every input combination; prime implicants are found with the Quine–McCluskey method and the smallest cover is chosen, which gives a minimal sum of products. The product of sums comes from minimising the zeros.

Processed on your device — nothing is uploaded.

How to use the Boolean algebra simplifier

  1. Type the expression in Boolean expression, for example A'B + AB + AB'.
  2. Keep Single-letter variables (AB means A AND B) ticked for textbook-style input, or untick it for longer variable names.
  3. Choose an Output notation: Algebra (AB’ + C), Logic (A ∧ ¬B ∨ C), Words (A AND NOT B OR C) or Code (A && !B || C).
  4. Read the Minimal sum of products and Minimal product of sums, and check whether the expression is a tautology, a contradiction or contingent.
  5. Use Parsed as to confirm the tool read your brackets the way you meant, and download the truth table if needed.

What it does and when to use it

Simplifying Boolean expressions is a core skill in digital electronics, computer science and discrete maths. A shorter expression needs fewer logic gates and is easier to read in code. Students use Karnaugh maps or algebra laws by hand; this tool gives the answer to check against, plus the minterm list that a K-map starts from.

To compare several expressions in one table, use the truth table generator. For the same logic on actual bits, such as masks, try the binary calculator. The set theory calculator covers the matching laws for unions and intersections.

How it works

  1. The expression is parsed with this order, from strongest to weakest: NOT, AND (including side-by-side letters), XOR/XNOR, OR/NOR, IMPLIES, IFF.
  2. It is evaluated for every combination of inputs to build the truth table and the minterm list.
  3. The Quine–McCluskey method repeatedly merges minterms that differ in one bit, which gives the prime implicants.
  4. Essential prime implicants are taken first, then the smallest set that covers the remaining minterms is chosen. That is the minimal sum of products.
  5. The same process on the 0 rows gives the minimal product of sums.

Step by step for A’B + AB + AB’:

  1. Minterms: A’B is row 01 = 1, AB’ is row 10 = 2, AB is row 11 = 3.
  2. Merge 01 and 11: they differ only in A, giving -1, which is B.
  3. Merge 10 and 11: they differ only in B, giving 1-, which is A.
  4. A and B together cover rows 1, 2 and 3, so the answer is A + B.

By algebra: AB + AB’ = A(B + B’) = A, then A + A’B = A + B.

Worked examples

Three terms to two letters. A'B + AB + AB' gives Minimal sum of products: A + B, with minterms 1, 2, 3 and maxterm 0.

Majority function. AB + BC + AC is already minimal as a sum of products (AB + AC + BC). Its product-of-sums form is (A + B)(A + C)(B + C).

Tautology. A + A' is always true, so the tool reports a tautology (always 1).

XOR. With single letters off, A XOR B becomes A'B + AB', or (A + B)(A’ + B’) as a product of sums.

Limits and tips

  • Put brackets around anything you are unsure of; implicit AND binds tighter than OR, so AB + C means (A AND B) OR C.
  • Don’t-care conditions cannot be entered.
  • All processing happens in your browser.

Frequently asked questions

How do I write NOT, AND and OR?
NOT can be NOT, !, ~, ¬ or a ' after a letter (A'). AND can be AND, &, ·, * or just two letters side by side. OR can be OR, | or +. You can also use XOR (^), NAND, NOR, XNOR, -> for implies and <-> for if and only if.
What does the "Single-letter variables" box do?
When ticked, AB means A AND B, which matches textbook notation. Untick it to use longer names such as X1 or Enable; then you must write the AND explicitly.
Is the answer really the simplest?
The tool finds every prime implicant with the Quine–McCluskey method and then searches for the cover with the fewest terms, then the fewest letters. For very large problems the search has a step limit and may fall back to a greedy choice, which is usually but not always minimal.
What are minterms and maxterms?
Number the rows of the truth table from 0 using the inputs as a binary number. Minterms are the rows where the result is 1; maxterms are the rows where it is 0. Σm(1, 2, 3) is a short way to write the whole function.
How many variables can I use?
Up to 10, which gives a truth table of 1,024 rows.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close