Boolean Algebra Calculator: Simplify Expressions & Truth Tables
Use AND, OR, NOT, XOR, NAND, NOR, XNOR (or & | ! ^ ' symbols). Example: A AND B OR NOT C
Examples:A XOR B · A NAND B · (A OR B) AND NOT C
What is Boolean Algebra?
Boolean algebra is the mathematics of binary (0/1) values combined with AND, OR, and NOT. It's the direct mathematical foundation of every digital circuit, from logic gates to full processors.
How Does This Calculator Work?
Type a boolean expression using AND/OR/NOT (or · + and an overline), and the calculator builds the truth table, derives the Sum of Products form, and applies simplification rules step by step.
Common Formulas & Rules
Boolean variable: a value that is either 0 (false) or 1 (true).
AND (·): result is 1 only if both inputs are 1.
OR (+): result is 1 if at least one input is 1.
NOT (complement, x̄): flips 0 to 1 and 1 to 0.
De Morgan's laws: (A·B)̄ = Ā+B̄, and (A+B)̄ = Ā·B̄.
Sum of Products (SOP): a boolean expression written as OR'd together AND terms, directly derivable from a truth table.
Worked Example
Simplifying A·B + A·B̄ using the distributive law: factor out A to get A·(B + B̄), and since B + B̄ is always 1 (a tautology), the whole expression reduces to just A — a smaller circuit that computes the exact same result with fewer gates.
Boolean calculator, boolean logic calculator and expression calculator
A boolean calculator, a boolean logic calculator and a boolean expression calculator all do the same job: you type an expression, and the tool works out its value for every combination of inputs. This page does that for expressions written with AND, OR, NOT, XOR, NAND, NOR and XNOR, or the symbols &, |, !, ^ and '.
What you get back
A truth table with a row for every input combination.
The minterms (rows where the output is 1) and maxterms (rows where it is 0).
The canonical sum of products (SOP) and product of sums (POS).
A minimal SOP found with the Quine–McCluskey method, including the grouping steps.
How to enter an expression
Use single letters for variables, such as A, B and C.
Join them with operators, for example (A OR B) AND NOT C. Use parentheses whenever the order of evaluation matters.
Press Evaluate and read the truth table first, then the canonical and minimal forms.
Worked example
Take (A AND B) OR (NOT A AND NOT B). The output is 1 when A and B are both 0 (row 0) or both 1 (row 3), and 0 otherwise. The minterms are therefore 0 and 3, the canonical SOP is ¬A·¬B + A·B, and this cannot be reduced further. It is the XNOR function: true exactly when the two inputs are equal.
To test whether two statements are logically equivalent, or to classify one as a tautology, use the logic calculator. To see an expression as gates, continue to the logic circuit calculator.
Study guide: Boolean Algebra
Written for students learning this topic for the first time. Last updated October 2026.
Overview
Boolean algebra works with variables that take the values 0 or 1 and the operations AND (written as a product), OR (a sum) and NOT (a prime or overbar). It is the same mathematics as propositional logic, written in the notation used for circuit design.
Its practical purpose is minimisation: rewrite a function with fewer terms and literals, and the circuit that implements it is smaller, cheaper and faster.
Key ideas explained
The laws
Identity: x + 0 = x and x·1 = x. Null: x + 1 = 1 and x·0 = 0. Idempotent: x + x = x. Complement: x + x′ = 1 and x·x′ = 0. Absorption: x + xy = x. De Morgan: (xy)′ = x′ + y′. Unlike ordinary algebra, both distributive laws hold, including x + yz = (x + y)(x + z).
Canonical forms
A minterm is a product containing every variable (complemented or not) that equals 1 for exactly one row of the truth table. The sum of products (SOP) ORs the minterms where the function is 1; the product of sums (POS) ANDs the maxterms where it is 0. They are written Σm(…) and ΠM(…).
Minimisation
A Karnaugh map (practical up to about four variables) arranges rows in Gray-code order so adjacent cells differ in one variable. Group adjacent 1s in rectangles of size 1, 2, 4 or 8; each group drops the variables that change inside it. The Quine–McCluskey method does the same systematically and handles more variables.
Duality and universal gates
The dual of an expression swaps + with · and 0 with 1. NAND alone, or NOR alone, can build every Boolean function, which is why they are called universal gates.
Worked examples
Simplifying with the laws
Problem. Simplify F = xy + xy′ + x′y.
Factor the first two terms: xy + xy′ = x(y + y′) = x.
So F = x + x′y.
Use the identity x + x′y = x + y (when x = 1 the first term already covers it; when x = 0 the term reduces to y).
Answer. F = x + y. A truth table confirms F is 1 for 11, 10 and 01.
Reading a function from its minterms
Problem. Simplify F(A, B, C) = Σm(1, 3, 5, 7).
The minterms are 001, 011, 101 and 111.
In every one of them C = 1, and A and B take all four combinations.
On a K-map these four cells form one group of four, which eliminates A and B.
Answer. F = C.
Enter these same values in the calculator above and compare each step with the working shown here.
Common mistakes to avoid
Applying ordinary algebra: x + yz is not equal to (x + y)z, although x + yz = (x + y)(x + z) is valid.
Mis-writing a minterm. For three variables, minterm 5 is 101, which is AB′C.
Grouping K-map cells in sizes that are not powers of two, or forgetting that the edges wrap around.
Treating don't-care cells as ones that must be covered.
Applying De Morgan's law without swapping AND and OR.
Where this shows up in computer science
Digital design: a minimised expression means fewer gates, lower cost and shorter delay.
Programming: simplifying complicated conditions and reasoning about bitwise operations.
FPGA and chip synthesis tools automatically minimise Boolean logic before layout.
Test yourself
Try each question before opening the answer.
Simplify x + x′y.
x + y.
How many different Boolean functions of 3 variables are there?
2^(2³) = 256.
Which minterm number is A′BC, with A as the most significant bit?
011 in binary, which is minterm 3.
Frequently asked questions
What is a Sum of Products (SOP) expression?
SOP writes a boolean function as OR'd-together AND terms, one term per row of the truth table where the output is 1. It can be read directly off any truth table without additional simplification.
What do De Morgan's laws say?
De Morgan's laws state (A·B)̄ = Ā+B̄ and (A+B)̄ = Ā·B̄ — the complement of an AND becomes an OR of complements, and vice versa. They're essential for simplifying and converting boolean expressions.
Why is NAND called "functionally complete"?
Any boolean function — AND, OR, NOT, anything — can be built using only NAND gates. This matters in circuit manufacturing, where using a single gate type simplifies production.
Which operators does this boolean expression calculator accept?
AND, OR, NOT, XOR, NAND, NOR and XNOR written as words, or the symbols & | ! ^ and a trailing apostrophe for complement. Use parentheses to control the order of evaluation.
How does the calculator simplify a boolean expression?
It evaluates the expression for every input combination, collects the minterms (rows where the output is 1), and minimises the sum of products with the Quine–McCluskey method, showing the grouping steps.
We use cookies for essential site functionality and, where enabled, for ads (Google AdSense) and analytics
(Google Analytics). See our Privacy Policy for details.