De Morgan's laws: NOT (A AND B) = NOT A OR NOT B, with proof and examples
De Morgan's laws say how a negation passes through AND and OR: the negation of an AND is the OR of the negations, and the negation of an OR is the AND of the negations.
The negation of an AND is the OR of the negations, and the negation of an OR is the AND of the negations.
“Not both A and B” means at least one of them fails: NOT (A AND B) = NOT A OR NOT B. “Neither A nor B” means both fail: NOT (A OR B) = NOT A AND NOT B. The operator flips when the NOT moves inside. That flip is the whole law, and forgetting it is the single most common mistake in writing rules, which is why the slip has its own pitfall page and its own lesson step.
The laws are what make negation normal form possible: by applying them repeatedly the engine pushes every NOT down to the inputs, which is the first stage of the normal-form converter and of the NAND-only and NOR-only constructions. They also explain why NAND and NOR are each other's duals and why a NAND gate drawn with inverted inputs is an OR.
Both identities are proved below on the four rows over A and B. The worked example compares NOT (A AND B) with NOT A OR NOT B row by row, and the normal-form converter records the law as a named step whenever it pushes a negation inward.
Statement
NOT (A AND B) = NOT A OR NOT BNOT (A OR B) = NOT A AND NOT B Proof by truth table: NOT (A AND B) = NOT A OR NOT B
| # | A | B | lhs | rhs |
|---|---|---|---|---|
| 0 | FALSE | FALSE | TRUE | TRUE |
| 1 | FALSE | TRUE | TRUE | TRUE |
| 2 | TRUE | FALSE | TRUE | TRUE |
| 3 | TRUE | TRUE | FALSE | FALSE |
The same law in four notations
NOT (A AND B)!(A && B)¬(A ∧ B)(A·B)'\overline{A \cdot B}NOT A OR NOT B!A || !B¬A ∨ ¬BA' + B'\overline{A} + \overline{B}Proof by truth table: NOT (A OR B) = NOT A AND NOT B
| # | A | B | lhs | rhs |
|---|---|---|---|---|
| 0 | FALSE | FALSE | TRUE | TRUE |
| 1 | FALSE | TRUE | FALSE | FALSE |
| 2 | TRUE | FALSE | FALSE | FALSE |
| 3 | TRUE | TRUE | FALSE | FALSE |
The same law in four notations
NOT (A OR B)!(A || B)¬(A ∨ B)(A + B)'\overline{A + B}NOT A AND NOT B!A && !B¬A ∧ ¬BA'·B'\overline{A} \cdot \overline{B}The common slip
Distributing the NOT without flipping the operator: NOT (A AND B) is not NOT A AND NOT B. They differ when exactly one of A and B is true, which the equivalence checker shows as the counterexample A = TRUE, B = FALSE.
Questions
Do De Morgan's laws work for three or more operands?
Yes: NOT (A AND B AND C) = NOT A OR NOT B OR NOT C, and likewise for OR. The engine applies the law to the whole n-ary gate at once, and the truth table generator will show you the eight rows.
Who was De Morgan?
Augustus De Morgan, a nineteenth-century British mathematician, stated the laws in the form logicians use; the same facts about sets were known earlier. The spelling with a capital D and a space is his name; the laws are also written “De Morgan's theorem” in digital design texts.
Related
Lesson that teaches this
Pitfalls
Tools
- Boolean algebra calculator and simplifier with steps (every law named and verified)
- Logical equivalence checker: two expressions, exact verdict, counterexample
Practice
See also
- NOT (A AND B) = NOT A OR NOT B, not NOT A AND NOT B
- “Neither A nor B” is NOT A AND NOT B
- Lesson 6: De Morgan’s laws (intermediate, 12 min)
- De Morgan in practice: NOT (A AND B) rewritten and verified
- The De Morgan slip: NOT (A AND B) vs NOT A AND NOT B
- De Morgan in code: !(a && b) refactored to !a || !b, verified
Laws
Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.