Boolean Algebra Simplifier

Analyze expressions · truth tables · tautology/contradiction checker · up to 4 variables

Insert Operator / Variable

AND: AND or &  |  OR: OR or +  |  NOT: NOT or !  |  XOR: XOR or ^  |  NAND: NAND  |  NOR: NOR

Quick Examples

What is Boolean Algebra?

Boolean algebra is a branch of algebra where variables take only binary values — 0 (false) or 1 (true). Developed by mathematician George Boole in 1854, it is the mathematical foundation of digital circuits, computer logic, database queries, and programming conditional statements. Unlike traditional algebra that works with continuous numbers, Boolean algebra operates on two-state logic and uses special operators to combine and transform these binary values.

Every modern computer processor is built from billions of logic gates that physically implement Boolean operations. Understanding Boolean algebra allows engineers to design circuits, programmers to write efficient conditional logic, and data scientists to construct precise database queries.

Boolean Operations

OperationSymbolRuleExample
AND· or &True only if both inputs are 11 AND 1 = 1
OR+ or |True if at least one input is 10 OR 1 = 1
NOT! or ~Inverts the valueNOT 1 = 0
XOR^True if exactly one input is 11 XOR 1 = 0
NANDNANDNOT of AND (universal gate)NAND(1,1) = 0
NORNORNOT of OR (universal gate)NOR(0,0) = 1

Boolean Laws (Quick Reference)

These fundamental identities allow simplification of complex Boolean expressions:

LawAND formOR form
IdentityA AND 1 = AA OR 0 = A
Null / AnnihilatorA AND 0 = 0A OR 1 = 1
IdempotentA AND A = AA OR A = A
ComplementA AND NOT A = 0A OR NOT A = 1
Double NegationNOT(NOT A) = A
CommutativeA AND B = B AND AA OR B = B OR A
Associative(A AND B) AND C = A AND (B AND C)(A OR B) OR C = A OR (B OR C)
DistributiveA AND (B OR C) = (A AND B) OR (A AND C)A OR (B AND C) = (A OR B) AND (A OR C)
AbsorptionA AND (A OR B) = AA OR (A AND B) = A
De Morgan'sNOT(A AND B) = NOT A OR NOT BNOT(A OR B) = NOT A AND NOT B

De Morgan's Theorem

De Morgan's theorem is one of the most powerful tools in Boolean algebra. It establishes the duality between AND and OR under negation:

  • First law: NOT(A AND B) = (NOT A) OR (NOT B)
  • Second law: NOT(A OR B) = (NOT A) AND (NOT B)

Truth table proof for the first law:

ABA AND BNOT(A AND B)NOT ANOT B(NOT A) OR (NOT B)
0001111
0101101
1001011
1110000

Both columns are identical, confirming the law. De Morgan's theorem is widely used to simplify NAND/NOR implementations in hardware design.

Applications of Boolean Algebra

  • Digital circuit design: Every logic gate (AND, OR, NOT, NAND, NOR, XOR) directly implements a Boolean operation. Circuit simplification reduces gate count and power consumption.
  • Database queries: SQL WHERE clauses use AND, OR, NOT to filter records. WHERE age > 18 AND city = 'London'
  • Programming: Every conditional statement (if/else, while) evaluates a Boolean expression.
  • Search engines: Advanced search operators (AND, OR, NOT) are direct applications of Boolean algebra to text retrieval.
  • Cryptography: Many encryption algorithms (AES, DES) rely heavily on bitwise Boolean operations (XOR especially) for mixing and confusion.
  • Artificial intelligence: Decision trees and rule-based systems encode logical conditions as Boolean expressions.

Frequently Asked Questions

What is Boolean algebra?
Boolean algebra is a branch of mathematics where variables can only take two values: 0 (false) or 1 (true). Developed by George Boole in 1854, it forms the mathematical foundation of digital circuits, computer logic, and programming. Unlike traditional algebra, Boolean algebra uses operators AND, OR, and NOT instead of arithmetic operations.
What are the basic Boolean operators?
The three fundamental Boolean operators are AND (conjunction — both must be true), OR (disjunction — at least one must be true), and NOT (negation — inverts the value). Derived operators include XOR (exclusive OR, exactly one must be true), NAND (NOT AND, universal gate), and NOR (NOT OR, universal gate).
What is De Morgan's theorem?
De Morgan's theorem states two laws: (1) NOT(A AND B) = (NOT A) OR (NOT B), and (2) NOT(A OR B) = (NOT A) AND (NOT B). These laws allow switching between AND and OR forms and are essential in digital circuit simplification — particularly when converting between NAND/NOR implementations.
What is a tautology in Boolean algebra?
A tautology is a Boolean expression that evaluates to 1 (true) for every possible combination of input variable values. The classic example is A OR NOT A, which is always 1 regardless of A's value. The complement — an expression always equal to 0 — is called a contradiction. Try A AND NOT A.
What is the difference between XOR and OR?
OR (inclusive OR) returns 1 if at least one input is 1 — including when both are 1. XOR (exclusive OR) returns 1 only when exactly one input is 1. So 1 OR 1 = 1, but 1 XOR 1 = 0. XOR is commonly used in parity checks, checksum algorithms, and encryption (particularly the one-time pad).
What is a truth table?
A truth table is a systematic listing of all possible input combinations for a Boolean expression and their corresponding output values. For n variables, the table has 2n rows. Truth tables are used to verify logic equivalences, classify expressions as tautologies or contradictions, and analyze the behavior of digital circuits.
How is Boolean algebra used in programming?
Boolean algebra underpins nearly all programming logic. Every if/else statement evaluates a Boolean expression. Loop conditions (while, for), bitwise operators (&, |, ^, ~), database WHERE clauses, and search engine query operators are all direct applications. Understanding De Morgan's laws helps programmers simplify complex conditional logic and avoid bugs.