- Home
- /
- Math & Conversions
- /
- Boolean Algebra Calculator
Boolean Algebra Calculator
Analyze Boolean algebra expressions, detect variables, generate truth tables, evaluate assignments, and derive canonical sum-of-products and product-of-sums forms for logic design.
Boolean expression builder
Truth table
Parsing & calculation steps
How to Use This Calculator
Enter a Boolean expression using the helper buttons or your own keyboard. The tool tokenizes the formula, highlights detected variables, and lets you toggle checkboxes to evaluate the expression under any TRUE/FALSE assignment.
Adjust the truth table row limit or variable ceiling if you need to explore larger functions, and toggle the output switches to show the truth table and canonical SOP/POS forms that are mechanically derived from the table.
Methodology
This calculator uses a tokenizer that recognizes variables, parentheses, and logical operators (!, ~, ¬, &, *, ·, ∧, +, |, ∨, ^, ⊕). A recursive descent parser builds an abstract syntax tree with strict precedence (NOT > AND > XOR > OR). The AST is evaluated across assignments to compute the truth table, and the same rows feed into canonical SOP (minterms) and POS (maxterms) builders.
- Tokens display your parsed operators and variables so you can confirm the syntax.
- Detected variables are rendered as toggle pills that update the evaluation banner and canonical forms.
- Truth table rows respect the limits you enter and inform the SOP/POS builders.
Full original guide (expanded)
What is Boolean algebra?
Boolean algebra is an algebraic system with two values, usually \(0\) and \(1\) or \(\text{FALSE}\) and \(\text{TRUE}\), and a set of operations such as AND, OR and NOT. It provides the mathematical foundation for digital logic, switching circuits, logic gates and many areas of theoretical computer science.
Basic operations
- NOT (\(\lnot A\), \(\overline{A}\),
!A): inverts the truth value. - AND (\(A \land B\),
A & B): true only if both inputs are true. - OR (\(A \lor B\),
A + B): true if at least one input is true. - XOR (\(A \oplus B\),
A ^ B): true if exactly one input is true.
Core laws of Boolean algebra
- Idempotent: \(A + A = A\), \(A \cdot A = A\).
- Commutative: \(A + B = B + A\), \(A \cdot B = B \cdot A\).
- Associative: \((A + B) + C = A + (B + C)\), \((A \cdot B) \cdot C = A \cdot (B \cdot C)\).
- Distributive: \(A \cdot (B + C) = A B + A C\), \(A + B C = (A + B)(A + C)\).
- Identity: \(A + 0 = A\), \(A \cdot 1 = A\).
- Complementarity: \(A + \overline{A} = 1\), \(A \cdot \overline{A} = 0\).
De Morgan’s laws
\[\overline{A \cdot B} = \overline{A} + \overline{B}, \qquad \overline{A + B} = \overline{A} \cdot \overline{B}.\]
These identities are essential when transforming logic circuits or simplifying expressions, especially when converting between AND/OR and NAND/NOR families.
Truth tables and canonical forms
A truth table lists every combination of variable assignments and the corresponding function output. Rows where the function is \(1\) feed the canonical sum-of-products (SOP) builder, while rows where the function is \(0\) build the canonical product-of-sums (POS) representation.
- SOP: OR of minterms, each minterm is an AND of variables or their complements that yield \(1\).
- POS: AND of maxterms, each maxterm is an OR of variables or their complements that yield \(0\).
Typical use cases
- Digital circuits – derive gate-level implementations from truth tables.
- Verification – confirm that two expressions are equivalent.
- Coursework – support exercises in digital logic, computer architecture, and discrete mathematics.
- Design documentation – keep a canonical representation for review and sharing.
Related logic & algebra tools
More in Core Math & Algebra
Boolean algebra quick checklist
- Express every gate or condition as a Boolean expression.
- Check equivalence using truth tables and canonical forms.
- Apply De Morgan’s laws when converting to NAND/NOR logic.
- Limit the number of variables per expression for readability.
- Document assumptions (don’t-care conditions) explicitly.
Editorial policy
CalcDomain content is created for education and is reviewed for clarity, accuracy, and transparency. The outputs, inputs, and assumptions appear directly in the calculator so you can verify the mechanics yourself.