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

Variables can be letters like A, B or X1. Supported operators: NOT (!, ~, ¬), AND (&, ·, *), OR (+, |, ∨), XOR (^, ⊕). Parentheses define precedence; implied products like AB are not supported.

Cap on displayed rows (2^n). For 8 variables, 2^8 = 256.

If the expression has more variables than this, only evaluation is shown.

Outputs

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.

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.

About the author

Ugo Candido builds financial and math tools to help readers make better decisions with transparent, practical models.

Contact: info@calcdomain.com

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.

Formulas

Expression parsing: tokenize variables, operators, and parentheses, then apply recursive descent parsing (NOT > AND > XOR > OR) to build the AST.

Truth table: evaluate the AST for every assignment within the configured limits (2^n rows for n variables) and feed the results to canonical builders.

Canonical SOP: OR together minterms (ANDs of each variable or its complement) for every row where the function is 1.

Canonical POS: AND together maxterms (ORs of each variable or its complement) for every row where the function is 0.

Citations

Complex Number Calculator — calcdomain.com · Accessed 2026-01-19
https://calcdomain.com/complex-number

Modular Inverse Calculator — calcdomain.com · Accessed 2026-01-19
https://calcdomain.com/modular-inverse

A/B Test Significance — calcdomain.com · Accessed 2026-01-19
https://calcdomain.com/a-b-test-significance

One-Way ANOVA — calcdomain.com · Accessed 2026-01-19
https://calcdomain.com/one-way-anova

Significant Figures Calculator — calcdomain.com · Accessed 2026-01-19
https://calcdomain.com/significant-figures

Fast Fourier Transform (FFT) — calcdomain.com · Accessed 2026-01-19
https://calcdomain.com/fft

QR Decomposition — calcdomain.com · Accessed 2026-01-19
https://calcdomain.com/qr-decomposition

Changelog
  • Version: 0.1.0-draft — 2026-01-19
  • Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido Last Updated: 2026-01-19 Version 0.1.0-draft
Version 1.5.0