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
Variables
0
detected
Total Rows
0
combinations
True Rows
0
minterms
False Rows
0
maxterms
Variables Detected
Minterm Notation
Truth Table
Number of Variables
Click any Output cell to toggle between 0 and 1. The SOP expression is generated automatically.
Sum of Products (SOP) Expression
—
Minterms (output = 1)
none
Maxterms (output = 0)
none
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
| Operation | Symbol | Rule | Example |
|---|---|---|---|
| AND | · or & | True only if both inputs are 1 | 1 AND 1 = 1 |
| OR | + or | | True if at least one input is 1 | 0 OR 1 = 1 |
| NOT | ! or ~ | Inverts the value | NOT 1 = 0 |
| XOR | ^ | True if exactly one input is 1 | 1 XOR 1 = 0 |
| NAND | NAND | NOT of AND (universal gate) | NAND(1,1) = 0 |
| NOR | NOR | NOT of OR (universal gate) | NOR(0,0) = 1 |
Boolean Laws (Quick Reference)
These fundamental identities allow simplification of complex Boolean expressions:
| Law | AND form | OR form |
|---|---|---|
| Identity | A AND 1 = A | A OR 0 = A |
| Null / Annihilator | A AND 0 = 0 | A OR 1 = 1 |
| Idempotent | A AND A = A | A OR A = A |
| Complement | A AND NOT A = 0 | A OR NOT A = 1 |
| Double Negation | NOT(NOT A) = A | |
| Commutative | A AND B = B AND A | A 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) |
| Distributive | A AND (B OR C) = (A AND B) OR (A AND C) | A OR (B AND C) = (A OR B) AND (A OR C) |
| Absorption | A AND (A OR B) = A | A OR (A AND B) = A |
| De Morgan's | NOT(A AND B) = NOT A OR NOT B | NOT(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:
| A | B | A AND B | NOT(A AND B) | NOT A | NOT B | (NOT A) OR (NOT B) |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 |
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?
What are the basic Boolean operators?
What is De Morgan's theorem?
What is a tautology in Boolean algebra?
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?
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?
How is Boolean algebra used in programming?
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.