Boolean algebra calculator
Simplify an expression to a minimal sum of products — one with no term left to drop — with the working shown one law at a time, or check whether two expressions are really the same. Both are exact: the answer comes from the complete truth table, worked out in your browser.
Input ¬(a ∧ b) ∨ a ∧ ¬b
Simplified ¬a ∨ ¬b
True in 3 of 4 rows. Down from 4 to 2 variable mentions. See the full truth table
Show the working 2 steps
- Start ¬(a ∧ b) ∨ a ∧ ¬b
- De Morgan ¬a ∨ ¬b ∨ a ∧ ¬b negating an AND flips it to an OR and negates each term
- Absorption ¬a ∨ ¬b a ∧ ¬b already needs ¬b, so it adds nothing
Which is the same answer the minimiser gives, reached by laws alone.
Are these two the same?
Enter two expressions and they are compared row by row across every combination of their variables. That is a proof of equivalence, not a spot check.
Equivalent: both sides have exactly the same truth table.
The laws of boolean algebra
The rewrites every simplification is built from. Pick any one to load it into the checker above and see it verified across the whole truth table.
| Law | Identity | Check |
|---|---|---|
| Identity | a ∧ 1 = a | |
| Identity | a ∨ 0 = a | |
| Annulment | a ∧ 0 = 0 | |
| Annulment | a ∨ 1 = 1 | |
| Idempotence | a ∧ a = a | |
| Idempotence | a ∨ a = a | |
| Complement | a ∧ ¬a = 0 | |
| Complement | a ∨ ¬a = 1 | |
| Double negation | ¬(¬a) = a | |
| Constant negation | ¬0 = 1 | |
| Constant negation | ¬1 = 0 | |
| Commutativity | a ∧ b = b ∧ a | |
| Commutativity | a ∨ b = b ∨ a | |
| Associativity | (a ∧ b) ∧ c = a ∧ (b ∧ c) | |
| Associativity | (a ∨ b) ∨ c = a ∨ (b ∨ c) | |
| Distributivity | a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c) | |
| Distributivity | a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c) | |
| De Morgan | ¬(a ∧ b) = ¬a ∨ ¬b | |
| De Morgan | ¬(a ∨ b) = ¬a ∧ ¬b | |
| Absorption | a ∨ (a ∧ b) = a | |
| Absorption | a ∧ (a ∨ b) = a | |
| Redundancy | a ∨ (¬a ∧ b) = a ∨ b | |
| Redundancy | a ∧ (¬a ∨ b) = a ∧ b | |
| Adjacency | (a ∧ b) ∨ (a ∧ ¬b) = a | |
| Consensus | (a ∧ b) ∨ (¬a ∧ c) ∨ (b ∧ c) = (a ∧ b) ∨ (¬a ∧ c) | |
| Consensus | (a ∨ b) ∧ (¬a ∨ c) ∧ (b ∨ c) = (a ∨ b) ∧ (¬a ∨ c) | |
| Definition | a ⊻ b = (a ∧ ¬b) ∨ (¬a ∧ b) | |
| Identity | a ⊻ 0 = a | |
| Inversion | a ⊻ 1 = ¬a | |
| Self cancel | a ⊻ a = 0 |
De Morgan's laws are the ones worth memorising: they let you push a negation through a bracket, turning ANDs into ORs and back. Every NAND-only design leans on them, and the full reference proves each law with its truth table.
Three notations, one algebra
Textbooks, engineers and programmers each write the same operators differently. All three are accepted in the boxes above, and the simulator can render expressions in five styles.
| Style | AND | OR | NOT | Example |
|---|---|---|---|---|
| Mathematical | ∧ | ∨ | ¬ | ¬a ∧ b ∨ c |
| Engineering | · or nothing | + | ′ | a′b + c |
| Programming | && | || | ! | !a && b || c |
One thing to watch: ^ is read as XOR here, as in most programming languages, even though a few textbooks use it for AND.
From algebra to an actual circuit
An expression is only half the story. In the simulator the two directions are one keystroke apart, so you can check your algebra against gates that really switch.
- Expression to circuit. On an empty canvas press ctrl+E and paste your expression. You get the wired circuit, ready to toggle.
- Circuit to expression. Build something from gates and choose Boolean expression from the toolbar to read it back as algebra, in whichever of the five notations you picked in the settings.
- Truth table either way. Print the table from a circuit, or press ctrl+T on an empty canvas to build a circuit from a table you fill in.
Questions
How does the simplification work?
The expression is turned into its truth table, and the table is reduced with the Quine-McCluskey algorithm: it finds the prime implicants, keeps the essential ones, covers whatever is left and then drops any term the others already cover. The result is an irredundant sum of products.
Can I see the steps?
Yes. Open "show the working" under the answer and the expression is rewritten one law at a time, with the law named on every line and a note on what it matched. That derivation is produced separately from the answer above it: it only ever applies a law, the way you would on paper, so you can copy it into your homework.
Why does the working sometimes stop before the minimal answer?
Because applying laws and minimising are different jobs. The laws are local rewrites, so a reduction that needs several terms considered together can have no single law that spells it out. The minimiser searches the whole truth table instead, so it always finds the smallest cover. When the two disagree the page shows both, rather than pretending a law got there.
Which notations can I type?
All of the common ones, mixed freely. AND as a·b, a&b, a∧b, a AND b or just ab; OR as a+b, a|b, a∨b or a OR b; NOT as !a, ~a, ¬a, a’ or NOT a; XOR as a^b, a⊻b or a XOR b. Note that ^ is read as XOR, and single letters are variables, so abc means a AND b AND c.
How many variables does it support?
Up to 8. Beyond that the truth table gets impractically large for a page like this.
Can it check two expressions are the same?
Yes. The equivalence checker compares the full truth tables of both expressions over their combined variables, so it is a proof rather than a guess. Every law in the table on this page can be loaded into it.
Does the simulator itself do boolean algebra?
Yes. The simulator turns any circuit into its boolean expression, and builds a circuit from an expression you paste in with ctrl+E. Optional simplification inside the simulator goes through the Wolfram Alpha API and needs your own free App ID in the settings; the calculator on this page needs nothing.