# How do I simplify Boolean algebra?

Simplifies a Boolean expression, or a list of minterms with don’t-cares, to a minimal sum of products and product of sums (Quine-McCluskey), with its minterms and maxterms.

- Page: https://www.acalculator.org/logic/boolean-algebra-calculator
- JSON spec: https://www.acalculator.org/logic/boolean-algebra-calculator.json
- Version: 157c625fdfd9

## Default answer

Example with the default inputs (Start from Expression, Expression AB + AB' + A'B): The simplest form is A + B.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| from | Start from | A Boolean expression, or the minterm numbers of a function. |
| f | Expression | Letters are variables; + or OR, · or AND or side by side, ’ after or ! before for NOT, ^ or XOR. |
| n | Number of variables | How many variables the function has; they are named A, B, C and so on. |
| m | Minterms | The input rows where the function is 1, as numbers separated by commas. |
| d | Don’t cares (optional) | Rows where the output does not matter, as numbers separated by commas. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| sop | Simplest sum of products | A minimal OR of ANDs: fewest terms, then fewest letters. |
| pos | Simplest product of sums | A minimal AND of ORs. |
| minterms | Minterms | The rows of the truth table where the function is 1. |
| maxterms | Maxterms | The rows where the function is 0 (don’t cares left out). |
| vars | Variables | The variables, first one the highest bit of a row number. |

## Method

Truth table from the expression; prime implicants by the Quine-McCluskey method; a minimal cover by exact search (fewest terms, then fewest literals, then a fixed order). The product of sums is the complement’s minimal sum, by De Morgan’s laws.

## Assumptions

- Variables are single letters (case does not matter); at most 5 of them.
- A row number reads the variables as binary digits, the first variable (in alphabetical order) the highest bit.
- When several forms are equally short, one is chosen by a fixed order, so another correct answer may exist.

## Worked examples

1. from = minterms, n = 4, m = 4, 8, 10, 11, 12, 15, d = 9, 14 gives sop = AB' + AC + BC'D', minterms = Σm(4, 8, 10, 11, 12, 15), maxterms = ΠM(0, 1, 2, 3, 5, 6, 7, 13). Source: Wikipedia, Quine–McCluskey algorithm: f(A,B,C,D) = Σm(4,8,10,11,12,15) + d(9,14) has the minimal forms BC′D′ + AB′ + AC and BC′D′ + AD′ + AC, https://en.wikipedia.org/wiki/Quine%E2%80%93McCluskey_algorithm.
2. from = expr, f = A + A'B gives sop = A + B, pos = (A + B), minterms = Σm(1, 2, 3), vars = A, B. Source: Kuphaldt, Lessons in Electric Circuits Vol. IV, §7.5 Boolean Rules for Simplification (A + AB = A, A + A′B = A + B), LibreTexts, https://workforce.libretexts.org/Bookshelves/Electronics_Technology/Electric_Circuits_IV_-_Digital_Circuitry_(Kuphaldt)/07:_Boolean_Algebra/7.05:_Boolean_Rules_for_Simplification.
3. from = expr, f = A + AB gives sop = A, pos = A, minterms = Σm(2, 3). Source: Kuphaldt, Lessons in Electric Circuits Vol. IV, §7.5 Boolean Rules for Simplification (A + AB = A, A + A′B = A + B), LibreTexts, https://workforce.libretexts.org/Bookshelves/Electronics_Technology/Electric_Circuits_IV_-_Digital_Circuitry_(Kuphaldt)/07:_Boolean_Algebra/7.05:_Boolean_Rules_for_Simplification.
4. from = expr, f = AB + BC(B + C) gives sop = AB + BC, pos = (A + C)B, minterms = Σm(3, 6, 7). Source: Kuphaldt, Lessons in Electric Circuits Vol. IV, §7.6 Circuit Simplification Examples (AB + BC(B + C) = B(A + C)), LibreTexts, https://workforce.libretexts.org/Bookshelves/Electronics_Technology/Electric_Circuits_IV_-_Digital_Circuitry_(Kuphaldt)/07:_Boolean_Algebra/7.06:_Circuit_Simplification_Examples.
5. from = expr, f = AB + AB' + A'B gives sop = A + B, maxterms = ΠM(0). Source: Kuphaldt, Lessons in Electric Circuits Vol. IV, §7.5 Boolean Rules for Simplification (A + AB = A, A + A′B = A + B), LibreTexts, https://workforce.libretexts.org/Bookshelves/Electronics_Technology/Electric_Circuits_IV_-_Digital_Circuitry_(Kuphaldt)/07:_Boolean_Algebra/7.05:_Boolean_Rules_for_Simplification (AB + AB′ = A, then A + A′B = A + B).
6. from = expr, f = A XOR B gives sop = AB' + A'B, pos = (A' + B')(A + B). Source: Kuphaldt, Lessons in Electric Circuits Vol. IV, §7.5 Boolean Rules for Simplification (A + AB = A, A + A′B = A + B), LibreTexts, https://workforce.libretexts.org/Bookshelves/Electronics_Technology/Electric_Circuits_IV_-_Digital_Circuitry_(Kuphaldt)/07:_Boolean_Algebra/7.05:_Boolean_Rules_for_Simplification.

## FAQ

### How do I simplify a Boolean expression?

Apply the rules of Boolean algebra (A + AB = A, A + A′B = A + B, AB + AB′ = A) until no rule shortens it, or use a method that always finds the shortest form, such as a Karnaugh map or the Quine-McCluskey method. This calculator uses Quine-McCluskey, so AB + AB′ + A′B becomes A + B.

### How do I type NOT, AND and OR?

NOT is a ’ after a letter or bracket (A′, (A + B)′), or !, ~ or NOT before it. AND is letters side by side (AB), or ·, *, & or AND. OR is +, | or OR. XOR is ^, ⊕ or XOR. Use 0 and 1 for false and true.

### What is the Quine-McCluskey method?

It lists the minterms, merges pairs that differ in one variable again and again until nothing merges (the prime implicants), then picks the fewest prime implicants that cover every minterm. It gives the same kind of answer as a Karnaugh map. This calculator takes up to 5 variables.

### What are minterms and don’t cares?

A minterm is a row of the truth table where the function is 1, numbered by reading the variables as a binary number (A is the highest bit). A don’t care is a row whose output does not matter, so the method may treat it as 1 or 0, whichever gives a shorter answer.

### Why can there be more than one simplest answer?

Two different sets of terms can be equally short. Σm(4, 8, 10, 11, 12, 15) + d(9, 14) is BC′D′ + AB′ + AC or BC′D′ + AD′ + AC. The calculator shows one of them, picked by a fixed order.

### What is the product of sums?

The same function written as an AND of ORs, such as (A + C)B for AB + BC. It is found by simplifying the rows where the function is 0 and applying De Morgan’s laws.

## Sources

- Wikipedia, Quine–McCluskey algorithm: prime implicants by merging minterms, the prime implicant chart, and the example f(A,B,C,D) = Σm(4,8,10,11,12,15) + d(9,14) with minimal forms BC′D′ + AB′ + AC and BC′D′ + AD′ + AC. Retrieved 2026-10-02. https://en.wikipedia.org/wiki/Quine%E2%80%93McCluskey_algorithm
- Kuphaldt, Lessons in Electric Circuits, Volume IV, section 7.5 Boolean Rules for Simplification (A + AB = A, A + A′B = A + B, (A + B)(A + C) = A + BC) and section 7.6 Circuit Simplification Examples (AB + BC(B + C) = B(A + C)), LibreTexts, CC BY. Retrieved 2026-10-02. https://workforce.libretexts.org/Bookshelves/Electronics_Technology/Electric_Circuits_IV_-_Digital_Circuitry_(Kuphaldt)/07:_Boolean_Algebra/7.05:_Boolean_Rules_for_Simplification
