Boolean Algebra
Evaluate a boolean expression and learn the laws of boolean algebra.
Toggle each variable above to evaluate the expression for those inputs.
Boolean algebra works on two values, true and false, combined with AND (∧), OR (∨), and NOT (¬). An AND is true only when both sides are true; an OR is true when at least one side is true. For example, A ∧ (B ∨ C) is true exactly when A is true and at least one of B or C is true.
What boolean algebra is
Boolean algebra is the algebra of truth values. Every variable holds one of two values — true (1) or false (0) — and three core operators combine them: AND (∧, conjunction) is true only when both operands are true, OR (∨, disjunction) is true when either operand is true, and NOT (¬, negation) flips a value. XOR (⊕) is true when the two operands differ. This tool tokenizes your expression with a safe recursive-descent parser, lets you toggle each detected variable, and reports the result for those inputs.
Operators bind by precedence: NOT first, then AND, then XOR, then OR. So A ∨ B ∧ C means A ∨ (B ∧ C), not (A ∨ B) ∧ C. Use parentheses whenever you want a different grouping.
Laws of boolean algebra
The canonical identities used to manipulate and simplify expressions.
| Law | AND form | OR form |
|---|---|---|
| Identity | A ∧ 1 = A | A ∨ 0 = A |
| Null (domination) | A ∧ 0 = 0 | A ∨ 1 = 1 |
| Idempotent | A ∧ A = A | A ∨ A = A |
| Complement | A ∧ ¬A = 0 | A ∨ ¬A = 1 |
| Distributive | A ∧ (B ∨ C) = (A ∧ B) ∨ (A ∧ C) | A ∨ (B ∧ C) = (A ∨ B) ∧ (A ∨ C) |
| Absorption | A ∧ (A ∨ B) = A | A ∨ (A ∧ B) = A |
| De Morgan’s | ¬(A ∧ B) = ¬A ∨ ¬B | ¬(A ∨ B) = ¬A ∧ ¬B |
Worked example: A ∧ (B ∨ C)
Take A = true, B = false, C = true. Evaluate the parentheses first, then the AND.
- 1 Assign each variable a value. A = true, B = false, C = true. List every distinct variable so none is left unset.
- 2 Resolve NOT, then work inside parentheses. Negations bind tightest. Here there is no NOT, and the inner group is B ∨ C = false ∨ true = true.
- 3 Apply operators by precedence. After parentheses, evaluate AND before OR. The expression becomes A ∧ true = true ∧ true.
- 4 Read the final truth value. true ∧ true = true. So A ∧ (B ∨ C) evaluates to true for these inputs.
De Morgan’s laws and simplification
De Morgan’s laws are the workhorses of boolean manipulation: the negation of an AND is the OR of the negations, ¬(A ∧ B) = ¬A ∨ ¬B, and the negation of an OR is the AND of the negations, ¬(A ∨ B) = ¬A ∧ ¬B. They let you push a NOT inward and rewrite a circuit using a different gate family — for example, turning a NAND into an OR of inverted inputs.
This tool evaluates an expression for chosen inputs and teaches the laws; it does not perform full algebraic simplification. Reducing an expression to its minimal sum-of-products form is a distinct problem solved by a truth table together with a Karnaugh map (K-map) for a few variables, or the Quine–McCluskey algorithm for more. Build the truth table, group the true rows, and read off the simplified terms.