Boolean Algebra Simplifier
Simplify any boolean expression with up to five variables (A–E) to its minimal sum of products and product of sums using the Quine–McCluskey method, with prime and essential prime implicants listed.
How it works
1) Evaluate the expression for all 2ⁿ rows → minterms · 2) Quine–McCluskey: repeatedly merge terms that differ in one bit (X·Y + X·Y' = X) until no merge is possible → prime implicants · 3) keep the essential primes (the only cover of some minterm), then pick the fewest remaining primes (ties → fewest literals) · POS: minimise the 0-rows the same way and apply De Morgan
The simplifier never rewrites your text symbolically — it computes the function's minterms and then runs the Quine–McCluskey algorithm, the tabular equivalent of a Karnaugh map that guarantees all prime implicants are found. An exact search then chooses the smallest set of primes covering every minterm, so the result is a true minimum two-level form (fewest product terms, then fewest literals), not just a shorter one. The product-of-sums form comes from minimising the zeros of the function and complementing.
Worked example
ABC + ABC' + AB'C + A'BC has minterms Σm(3, 5, 6, 7) — it is 1 whenever at least two of the three inputs are 1. Quine–McCluskey merges them into three prime implicants, AB (6, 7), AC (5, 7) and BC (3, 7), all essential, so the minimal SOP is AB + AC + BC and the minimal POS is (A + B)(A + C)(B + C). The literal count drops from 12 to 6 — the classic majority (2-of-3 voter) function.
Sources: Quine–McCluskey algorithm — Wikipedia · Petrick’s method — Wikipedia
Frequently asked questions
Is the answer guaranteed to be the simplest?
It is the minimal two-level sum of products: no other SOP has fewer product terms, and among those with the same number it has the fewest literals. Multi-level forms (factoring, XOR gates) can sometimes be smaller still — for example A ⊕ B ⊕ C has no simpler SOP than four 3-literal terms.
What are prime and essential prime implicants?
A prime implicant is a product term that cannot be enlarged (no literal can be dropped) without covering a 0. It is essential when it is the only prime covering some minterm, so it must be in every minimal solution. The table lists both and marks which primes the final result uses.
Why does the result use different variables from my expression?
Variables that cancel out disappear. For example A·B + A·B' simplifies to A because B no longer affects the output. The result only uses the variables the function actually depends on.
How is this different from a Karnaugh map?
Karnaugh maps group adjacent 1s visually and work well up to four variables; Quine–McCluskey does the same merging in a table and scales to any number. Both give the same minimal result. Use the Karnaugh map solver if you start from a list of minterms or need don't-care conditions.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.