The laws of boolean algebra
30 identities for rewriting logic without changing what it does. Each one is shown with the truth table that proves it.
Want to check your own? The calculator compares any two expressions row by row.
Basic
ANDing with 1 leaves a signal untouched, which is how an enable line passes data through.
Proof
| a | a ∧ 1 | a |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
Both columns match on all 2 rows, so the identity holds.
The OR counterpart: 0 is the neutral value for OR, the way 1 is for AND.
Proof
| a | a ∨ 0 | a |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
Both columns match on all 2 rows, so the identity holds.
A single 0 into an AND forces the output low no matter what else happens.
Proof
| a | a ∧ 0 | 0 |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
Both columns match on all 2 rows, so the identity holds.
And a single 1 into an OR pins the output high.
Proof
| a | a ∨ 1 | 1 |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 1 | 1 |
Both columns match on all 2 rows, so the identity holds.
Feeding one signal into both inputs of a gate wastes a gate.
Proof
| a | a ∧ a | a |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
Both columns match on all 2 rows, so the identity holds.
Wiring one signal into both inputs of an OR gate is just as wasteful.
Proof
| a | a ∨ a | a |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
Both columns match on all 2 rows, so the identity holds.
Negation
A signal and its inverse are never both high, so the AND can never fire.
Proof
| a | a ∧ ¬a | 0 |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
Both columns match on all 2 rows, so the identity holds.
One of the two is always high, so the OR is always high.
Proof
| a | a ∨ ¬a | 1 |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 1 | 1 |
Both columns match on all 2 rows, so the identity holds.
Two inverters in a row cancel out, though they are still useful as a buffer.
Proof
| a | ¬(¬a) | a |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
Both columns match on all 2 rows, so the identity holds.
An inverter tied low sits high, which is how a 1 is made where no signal supplies one.
Proof
| ¬0 | 1 |
|---|---|
| 1 | 1 |
Both columns match on all 1 rows, so the identity holds.
And the other way round. Not much of a theorem, but it is the step that clears a negated constant out of an expression.
Proof
| ¬1 | 0 |
|---|---|
| 0 | 0 |
Both columns match on all 1 rows, so the identity holds.
Push a negation through a bracket and AND becomes OR. The rule behind every NAND-only design.
Proof
| a | b | ¬(a ∧ b) | ¬a ∨ ¬b |
|---|---|---|---|
| 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
Both columns match on all 4 rows, so the identity holds.
The mirror image of the first, and the reason NOR is universal in the same way NAND is.
Proof
| a | b | ¬(a ∨ b) | ¬a ∧ ¬b |
|---|---|---|---|
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 |
Both columns match on all 4 rows, so the identity holds.
Order
Input order does not matter to a gate.
Proof
| a | b | a ∧ b | b ∧ a |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
Both columns match on all 4 rows, so the identity holds.
The same holds for OR, and for every other two input gate on this site.
Proof
| a | b | a ∨ b | b ∨ a |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
Both columns match on all 4 rows, so the identity holds.
Grouping does not matter either, which is why a three input AND gate is well defined.
Proof
| a | b | c | (a ∧ b) ∧ c | a ∧ (b ∧ c) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
Both columns match on all 8 rows, so the identity holds.
So a wide OR can be built from a chain of two input ORs.
Proof
| a | b | c | (a ∨ b) ∨ c | a ∨ (b ∨ c) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Both columns match on all 8 rows, so the identity holds.
Distribution
Reads like ordinary algebra: AND distributes over OR.
Proof
| a | b | c | a ∧ (b ∨ c) | (a ∧ b) ∨ (a ∧ c) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Both columns match on all 8 rows, so the identity holds.
Unlike ordinary algebra, it works the other way round too: OR distributes over AND.
Proof
| a | b | c | a ∨ (b ∧ c) | (a ∨ b) ∧ (a ∨ c) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Both columns match on all 8 rows, so the identity holds.
Reduction
If a alone is enough, the extra term adds nothing. Deletes a gate outright.
Proof
| a | b | a ∨ (a ∧ b) | a |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
Both columns match on all 4 rows, so the identity holds.
The dual form: if a is low the whole thing is low regardless of b.
Proof
| a | b | a ∧ (a ∨ b) | a |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
Both columns match on all 4 rows, so the identity holds.
The ¬a is doing no work: if a is low the second term decides, and if a is high the first does.
Proof
| a | b | a ∨ (¬a ∧ b) | a ∨ b |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
Both columns match on all 4 rows, so the identity holds.
The dual. Easy to miss by eye, which is why minimisers earn their keep.
Proof
| a | b | a ∧ (¬a ∨ b) | a ∧ b |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
Both columns match on all 4 rows, so the identity holds.
b takes both values, so it cancels. This is exactly what grouping two squares on a Karnaugh map does.
Proof
| a | b | (a ∧ b) ∨ (a ∧ ¬b) | a |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
Both columns match on all 4 rows, so the identity holds.
The third term is already covered by the other two. The classic trap when minimising by hand.
Proof
| a | b | c | (a ∧ b) ∨ (¬a ∧ c) ∨ (b ∧ c) | (a ∧ b) ∨ (¬a ∧ c) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Both columns match on all 8 rows, so the identity holds.
The product of sums version of the same idea.
Proof
| a | b | c | (a ∨ b) ∧ (¬a ∨ c) ∧ (b ∨ c) | (a ∨ b) ∧ (¬a ∨ c) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
Both columns match on all 8 rows, so the identity holds.
Exclusive or
XOR written with the basic three, which is how it is built when no XOR gate is available.
Proof
| a | b | a ⊻ b | (a ∧ ¬b) ∨ (¬a ∧ b) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
Both columns match on all 4 rows, so the identity holds.
XOR with 0 passes the signal through unchanged.
Proof
| a | a ⊻ 0 | a |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
Both columns match on all 2 rows, so the identity holds.
XOR with 1 inverts it, which makes XOR a controlled inverter.
Proof
| a | a ⊻ 1 | ¬a |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 0 | 0 |
Both columns match on all 2 rows, so the identity holds.
Anything XORed with itself is 0, the property behind parity checks.
Proof
| a | a ⊻ a | 0 |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 0 | 0 |
Both columns match on all 2 rows, so the identity holds.
Using them
The laws are how a circuit gets smaller. In practice you rarely apply them one at a time by hand past three or four variables, but knowing them is what lets you read someone else's simplification and see why it works.
- Absorption and redundancy delete whole terms, so they are the ones worth spotting first.
- Adjacency is the algebraic form of circling two squares on a Karnaugh map: one variable takes both values and cancels.
- De Morgan converts between AND and OR forms, which is what makes NAND-only and NOR-only circuits possible.
- Consensus is the one people miss by hand: a term that looks necessary is already covered by two others.
Reference card
Every identity on one sheet, black on white, for printing or a slide.
Click to download: Boolean algebra laws
Questions
What are the laws of boolean algebra?
A set of identities that let you rewrite a logic expression without changing what it computes. The core ones are identity, annulment, idempotence, complement, commutativity, associativity, distributivity, absorption and De Morgan. Together they are what circuit minimisation is built on.
How is boolean algebra different from ordinary algebra?
Variables take only two values, there is no subtraction or division, and OR distributes over AND as well as the other way round, which has no equivalent in ordinary arithmetic. Absorption and idempotence have no counterpart either: a + a is a, not 2a.
What are De Morgan's laws?
They say that negating a bracket swaps the operator inside it: not (a and b) equals not a or not b, and not (a or b) equals not a and not b. They are what lets any circuit be rebuilt from NAND gates alone, or from NOR gates alone.
How do I prove a boolean identity?
Build the truth table for both sides and check every row matches. With n variables that is 2^n rows, so it is exhaustive rather than a sample, which makes it a genuine proof. Every law on this page is shown with its table, and the calculator will check your own expressions the same way.