Skip to content

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.

Engine name: De Morgan's lawFR: Loi de De MorganDE: De-Morgan-Gesetz

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

NOT (A AND B) = NOT A OR NOT B
#ABlhsrhs
0FALSEFALSETRUETRUE
1FALSETRUETRUETRUE
2TRUEFALSETRUETRUE
3TRUETRUEFALSEFALSE
lhs ≡ rhs holds · lhs and rhs agree on every assignment. · Exhaustively checked and solver cross-checked · 4 rows

The same law in four notations

WordsNOT (A AND B)
Programming!(A && B)
Mathematical¬(A ∧ B)
Algebra(A·B)'
LaTeX\overline{A \cdot B}
WordsNOT A OR NOT B
Programming!A || !B
Mathematical¬A ∨ ¬B
AlgebraA' + B'
LaTeX\overline{A} + \overline{B}
NOT (A AND B) = NOT A OR NOT B NOT (A AND B) = NOT A OR NOT B A B lhsPRIMARY rhs NOT AND OR NOT NOT
NOT (A AND B) = NOT A OR NOT B NOT (A AND B) = NOT A OR NOT B A B lhsPRIMARY rhs NOT AND OR NOT NOT

Proof by truth table: NOT (A OR B) = NOT A AND NOT B

NOT (A OR B) = NOT A AND NOT B
#ABlhsrhs
0FALSEFALSETRUETRUE
1FALSETRUEFALSEFALSE
2TRUEFALSEFALSEFALSE
3TRUETRUEFALSEFALSE
lhs ≡ rhs holds · lhs and rhs agree on every assignment. · Exhaustively checked and solver cross-checked · 4 rows

The same law in four notations

WordsNOT (A OR B)
Programming!(A || B)
Mathematical¬(A ∨ B)
Algebra(A + B)'
LaTeX\overline{A + B}
WordsNOT A AND NOT B
Programming!A && !B
Mathematical¬A ∧ ¬B
AlgebraA'·B'
LaTeX\overline{A} \cdot \overline{B}
NOT (A OR B) = NOT A AND NOT B NOT (A OR B) = NOT A AND NOT B A B lhsPRIMARY rhs NOT OR AND NOT NOT
NOT (A OR B) = NOT A AND NOT B NOT (A OR B) = NOT A AND NOT B A B lhsPRIMARY rhs NOT OR AND NOT NOT

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

Practice

See also

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.