Boolean algebra calculator
A Boolean algebra calculator simplifies a logic expression to the fewest terms that give the same truth table. Type an expression such as A'B + AB + AB' into our Boolean Algebra Simplifier and it simplifies it one law at a time, naming each one, then checks the answer with a Karnaugh map. That one comes out as A + B.
It handles up to 8 variables for the minimal form, and draws Karnaugh maps for up to 4. It opens on A'B + AB + AB'.
Boolean Algebra Simplifier
Simplify expressions with Boolean laws and Karnaugh maps
How to use the Boolean algebra calculator
- Type the expression in the Expression box. Use letters for variables, a prime (') or NOT for not, juxtaposition, · or AND for and, and + or OR for or. Brackets work.
- Choose the notation for the answer: AND OR, ∧ ∨ ¬ or · + ′.
- Choose Group the 1s for a sum of products, or Group the 0s for a product of sums.
- Read the simplified expression, the number of letters before and after, and the minimal form.
- Follow the working, which names each law it uses, and look at the Karnaugh map with its groups drawn.
Tap a cell on the Karnaugh map to mark it as a don't care, and the minimal form uses it if that makes the answer smaller. The examples under the box include De Morgan, consensus and a product of sums. For practice, Practice and help sets simplification questions with worked solutions.
The Boolean algebra laws it uses
| Law | AND form | OR form |
|---|---|---|
| Identity | A · 1 = A | A + 0 = A |
| Null | A · 0 = 0 | A + 1 = 1 |
| Complement | A · A′ = 0 | A + A′ = 1 |
| Idempotent | A · A = A | A + A = A |
| Absorption | A(A + B) = A | A + AB = A |
| De Morgan's | (AB)′ = A′ + B′ | (A + B)′ = A′B′ |
| Distributive | A(B + C) = AB + AC | A + BC = (A + B)(A + C) |
| Redundancy | A(A′ + B) = AB | A + A′B = A + B |
| Consensus | AB + A′C + BC = AB + A′C | (A + B)(A′ + C)(B + C) = (A + B)(A′ + C) |
Each law has a dual: swap AND with OR and 0 with 1, and it stays true. The calculator names the law in every step, such as "Absorption law" or "Consensus theorem".
Worked examples you can check in the calculator
Example 1: combining terms, then redundancy
Simplify A′B + AB + AB′. The first two terms share B, so A′B + AB = B(A′ + A) = B. That leaves B + AB′, and by the redundancy law B + B′A = B + A:
The calculator shows the same two steps, "Combining terms" and "Redundancy law", and reports 6 letters cut to 2.
Example 2: absorption
Simplify A + AB. Whenever A is true the whole thing is true, and when A is false both terms are false, so A + AB = A. The calculator names this the absorption law.
Example 3: De Morgan's law
Simplify (A + B)′A, typed as NOT (A OR B) AND A. De Morgan turns (A + B)′ into A′B′, so the expression is A′B′A. It contains both A and A′, so by the complement law it is always 0:
Example 4: the consensus theorem
Simplify AB + A′C + BC. The term BC is the consensus of AB and A′C: when B and C are both 1, either A is 1 and AB covers it, or A is 0 and A′C does. So BC can go:
This one is easy to miss by hand. The calculator names it the consensus theorem.
Karnaugh maps
A Karnaugh map lays out the truth table so that neighbouring cells differ in one variable. Grouping 1s in blocks of 1, 2, 4 or 8, including groups that wrap round the edges, gives the minimal sum of products. The calculator draws the map with its groups for up to 4 variables.
Example 5: five terms down to two
Simplify A′B′C + A′BC + AB′C + ABC + ABC′. On the map, the four cells with C = 1 form a group of four, giving C, and the two cells with A = 1 and B = 1 form a pair, giving AB:
The calculator cuts 15 letters to 3.
Checking with a truth table
Two Boolean expressions are equal when they give the same output for every row of the truth table. For Example 1, A′B + AB + AB′ and A + B are both 0 only when A = 0 and B = 0, and 1 in the other three rows. The Truth Table Generator builds the full table for any expression. Try completing one in the course, then press Mark:
Fill in the blank output cells of a gate's truth table.
Press Mark to have your answer marked in the Circuits course.
Common mistakes
- Getting De Morgan half right. Break the bar and change the sign: (AB)′ is A′ + B′, not A′B′.
- Treating + like ordinary addition. In Boolean algebra 1 + 1 = 1, and A + A = A.
- Missing absorption. A + AB is just A. Look for a term that contains another whole term.
- Grouping wrongly on a Karnaugh map. Groups must be 1, 2, 4 or 8 cells, rectangular, and can wrap round the edges.
- Forgetting operator order. NOT comes first, then AND, then OR, unless brackets say otherwise.
Practise logic in a short timed paper
Boolean algebra and logic come up in AP Computer Science Principles and College Discrete Math practice, and in GCSE Computer Science in the UK. Each daily paper is a short timed paper of 8 questions worth 25 to 35 marks, and the papers mix topics. To see an expression as gates, use the Logic Gate Simulator.
Common questions
What is Boolean algebra?
How do you simplify a Boolean expression?
What is De Morgan's law?
What is a sum of products?
How many variables can the calculator handle?
What is a don't care?
Revision cards
Say the answer first, then flip the card to check it.
Where to go next
- Solve it
Boolean Algebra Simplifier
Simplify expressions with Boolean laws and Karnaugh maps
Open the tool - Learn it
Circuits
Resistors, capacitors and logic gates: build and understand real circuits
Start the course - Test it
AP Computer Science Principles
A new exam-style paper every day, with instant marking and a mark scheme
Start today's paper