About the Boolean Algebra Calculator
Boolean algebra is the mathematics of true and false, 1 and 0. It describes digital circuits, search queries, database filters and program conditions. A Boolean expression can usually be written in many equivalent ways, and the simplest form uses fewer logic gates, fewer chip connections and less power, which is why simplification is a core skill in digital electronics and computer science courses.
This Boolean algebra calculator simplifies an expression of up to eight variables to a minimal sum of products, using the Quine–McCluskey method, and also gives a minimal product of sums. You can add don't-care conditions, input combinations whose output does not matter, to reach an even simpler result. It lists the minterms and compares the number of literals before and after.
How to Use the Boolean Algebra Calculator
Type the expression using letters for variables. Use ' or ! for NOT, write variables side by side or use · or *** for AND, + for OR and ^** for XOR. The words AND, OR, NOT and XOR also work.
Optionally enter don't-care rows as row numbers, such as 10, 11, 12.
Rows are numbered in binary with the first variable alphabetically as the most significant bit.
The Formulas
key laws: A + A' = 1 AA' = 0 A + AB = A A + A'B = A + B
AB + AB' = A (A + B)' = A'B' (AB)' = A' + B'
consensus: AB + A'C + BC = AB + A'C
method: true rows → combine terms differing in one variable → prime implicants
→ choose the fewest primes covering every true row
Step-by-Step Example
Simplify A'B'C' + A'B'C + A'BC + AB'C' + ABC' + ABC.
true rows (minterms): 0, 1, 3, 4, 6, 7
combine pairs: 0,1 → A'B' 0,4 → B'C' 1,3 → A'C 3,7 → BC
4,6 → AC' 6,7 → AB
every pair is a prime implicant; a cover of all six rows needs three:
A'B' (0, 1) + BC (3, 7) + AC' (4, 6)
F = AC' + A'B' + BC 18 literals reduced to 6
The function has a second minimal form, B'C' + A'C + AB, which covers the same rows with the same cost. Both are correct; the calculator shows one of them.
Why Simplify?
Each literal in a sum of products is a gate input, and each term is an AND gate feeding an OR gate. Cutting 18 literals to 6 means fewer gates, a smaller circuit and often a faster one, because signals pass through fewer stages. In software, simpler conditions are easier to read and test. In programmable logic, simpler expressions use fewer resources.
Karnaugh Maps and Quine–McCluskey
A Karnaugh map arranges the truth table so that cells differing in one variable are adjacent, letting you circle groups of 1, 2, 4 or 8 by eye. It works well for up to four variables and becomes awkward beyond that. The Quine–McCluskey method does the same job as a procedure: repeatedly combine terms that differ in one variable to find all prime implicants, then pick the smallest set that covers every true row. Being systematic, it scales to more variables and is the basis of logic minimisation software.
Don't-Care Conditions
In many circuits some input combinations never occur. A binary-coded decimal digit uses only the patterns 0 to 9, so rows 10 to 15 of a 4-bit input are don't-cares. Each can be treated as 1 or 0, whichever makes the groups larger. For example, the function true on rows 1, 3, 7, 11 and 15 with don't-cares 0, 2 and 5 simplifies to A'D + CD, a result impossible without the don't-cares.
Sum of Products and Product of Sums
A sum of products (SOP) ORs together AND terms and maps to an AND-OR circuit, or equivalently a NAND-NAND circuit. A product of sums (POS) ANDs together OR terms and maps to OR-AND or NOR-NOR circuits. The minimal POS comes from simplifying the false rows and applying De Morgan's laws. Depending on the function, one form may need fewer gates than the other, so the calculator gives both.
Simplifying by Hand With the Laws
The laws of Boolean algebra let you simplify without a table. Factor out common variables, then use complement and absorption laws. For AB + AB' + A'B, factor A from the first two terms to get A(B + B') + A'B = A + A'B, and the law A + A'B = A + B finishes the job. Hand simplification is quick for small expressions but it is easy to stop at a form that looks simple without being minimal, which is why a systematic method is useful as a check.
De Morgan's laws are the other essential tool. They turn the complement of a product into a sum of complements, (AB)' = A' + B', and the complement of a sum into a product of complements, (A + B)' = A'B'. Applying them repeatedly pushes NOT operations down to single variables, which is the first step before factoring.
Limits of the Calculator
The calculator accepts up to eight variables, which gives truth tables of up to 256 rows. For most textbook and small design problems that is plenty. Multi-output circuits, where several functions share gates, need specialised tools, since minimising each output on its own does not always give the smallest shared circuit.
Understanding Your Result
The headline gives the minimal sum of products.
The product of sums line gives the minimal POS form.
The minterms line lists the true rows and any don't-cares.
The literals line compares the size of your expression with the simplified one.
When Should You Use This Calculator?
Use it to simplify logic for a digital circuit before building it.
Use it to check Karnaugh map or Boolean algebra homework.
Use it to tidy complicated conditions in code or search queries.
Common Mistakes
Forgetting the consensus term is redundant. AB + A'C + BC simplifies to AB + A'C.
Misapplying De Morgan's law. (A + B)' is A'B', not A' + B'.
Treating XOR as OR. A ^ B is false when both are 1.
Expecting a unique answer. Some functions have several minimal forms.