Boolean Algebra Calculator

Evaluate logic expressions, inspect every truth-table row, and identify equivalent canonical forms.

Enter your values

DISCRETE MATHEMATICS

Evaluate a Boolean expression

Build a truth table and identify whether the statement is always true, always false, or depends on its inputs.

Symbol view(A ∧ B) ∨ ¬ C

Variables A–Z are accepted (up to 6). NOT binds first, then AND, XOR, and OR. Adjacent terms mean AND; expressions may use words or symbols.

Press Enter to calculate
Try an example
RESULT

Contingency

(A ∧ B) ∨ ¬ C is a contingency: it is true for 5 of 8 possible input combinations and false for 3.

True outputs5
False outputs3
VariablesA, B, C
Rows8

Truth table

Each row evaluates the expression for one possible assignment.

ABC(A ∧ B) ∨ ¬ C
0001 · True
0010 · False
0101 · True
0110 · False
1001 · True
1010 · False
1101 · True
1111 · True

Canonical forms

Sum of products (canonical SOP)(¬A ∧ ¬B ∧ ¬C) ∨ (¬A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ ¬C) ∨ (A ∧ B ∧ ¬C) ∨ (A ∧ B ∧ C)
Product of sums (canonical POS)(A ∨ B ∨ ¬C) ∧ (A ∨ ¬B ∨ ¬C) ∧ (¬A ∨ B ∨ ¬C)

These canonical forms reproduce the truth table. They are systematic forms, not necessarily the shortest possible simplification.

How to read this result

  1. List the distinct variables in alphabetical order: A, B, C.
  2. There are 23 = 8 possible assignments.
  3. Evaluate NOT first, then AND, XOR, and OR for each row.
  4. The output is 1 in 5 rows and 0 in 3 rows, so the expression is a contingency.
Overview

What is a boolean algebra calculator?

Boolean algebra is a system for working with truth values, usually written 0 (false) and 1 (true). This calculator evaluates a propositional expression for every possible assignment of its variables, then summarizes its logical behavior.

Important terms

Truth table
A table containing one row for each possible assignment of truth values to the variables in an expression.
Tautology
A proposition that evaluates to true for every possible assignment.
Contradiction
A proposition that evaluates to false for every possible assignment.
Contingency
A proposition that is true for some assignments and false for others.
Canonical SOP and POS
Sum of products groups true rows as AND terms joined by OR; product of sums groups false rows as OR terms joined by AND.

When this method is useful

  • Check a logic homework expression row by row.
  • Compare two expressions by comparing their truth-table outputs.
  • Inspect canonical sum-of-products and product-of-sums representations.
  • Explore the behavior of NOT, AND, XOR, and OR in digital logic.
Formula

Formula and variables

N=2n,f:{0,1}n→{0,1}N=2^n,\qquad f:\{0,1\}^n\to\{0,1\}
n
number of distinct variables
N
number of rows in the complete truth table
f
Boolean function represented by the expression

Each of n variables can independently be 0 or 1, so the number of assignments is 2 × 2 × … × 2 = 2ⁿ. Evaluating the expression on every assignment completely specifies its Boolean function.

Domain note: This tool accepts up to six variables and produces at most 64 rows. Supported operators are NOT, AND, XOR, and OR, with parentheses and standard precedence. It does not perform minimum-gate Karnaugh-map or Quine–McCluskey simplification.

How it works

How to use this calculator

  1. 1

    Enter variables and operators using words (AND, OR, NOT, XOR) or symbols (∧, ∨, ¬, ⊕).

  2. 2

    The calculator identifies the variables and lists all 2ⁿ possible assignments in alphabetical order.

  3. 3

    Each row is evaluated with NOT before AND, then XOR, then OR; parentheses override this order.

  4. 4

    The output counts determine whether the expression is a tautology, contradiction, or contingency.

  5. 5

    Canonical SOP is formed from true rows; canonical POS is formed from false rows.

Worked examples

Step-by-step examples

Example 1

Problem: Evaluate (A AND B) OR NOT C.

Substitution: For A = 1, B = 1, C = 1: (1 AND 1) OR NOT 1 = 1 OR 0.

Result: The output is 1 for this row. Across all eight rows, the expression is true in 5 and false in 3.

Because it is true for some assignments and false for others, this expression is a contingency.

Example 2

Problem: Classify A OR NOT A.

Substitution: If A = 0, the output is 0 OR 1 = 1; if A = 1, it is 1 OR 0 = 1.

Result: Both rows are true, so the expression is a tautology.

This is the law of excluded middle.

Example 3

Problem: Classify A AND NOT A.

Substitution: If A = 0, the output is 0 AND 1 = 0; if A = 1, it is 1 AND 0 = 0.

Result: Both rows are false, so the expression is a contradiction.

A proposition and its negation cannot both be true.

Method knowledge

Rules, edge cases, and related ideas

Operator precedence

Parentheses are evaluated first, followed by NOT, AND, XOR, and OR. Use parentheses whenever the intended grouping might be unclear.

XOR

Exclusive OR is true exactly when its two inputs differ: 0 ⊕ 0 = 0, 0 ⊕ 1 = 1, 1 ⊕ 0 = 1, and 1 ⊕ 1 = 0.

Canonical forms

A minterm is true for exactly one input row. OR-ing the true-row minterms gives canonical SOP; maxterms for false rows combine into canonical POS.

Edge cases and limitations

  • A constant-only expression has no variables, so there is no variable truth table to display.
  • More than six distinct variables is rejected to keep the table readable.
  • Incomplete operators, unmatched parentheses, and unsupported symbols produce an input message instead of a partial table.

How this differs from a related concept

Use this calculator to evaluate one expression and inspect its complete truth table. It reports canonical forms, but does not claim a minimum-literal simplification; use a dedicated Boolean minimizer for that task.

Interpretation

Understand the result

The truth table is the definitive finite check for the supported propositional expressions. Two expressions with the same output in every row are logically equivalent, even if their written forms differ. Canonical forms provide a reproducible representation; they are not guaranteed to be the shortest expression.

Common mistakes

  • Forgetting that NOT binds more tightly than AND and OR.
  • Reading XOR as ordinary OR; XOR is false when both inputs are true.
  • Assuming a canonical SOP or POS is automatically the shortest form.
  • Omitting parentheses when a different grouping is intended.

Frequently asked questions

How many truth-table rows are there?

For n distinct variables, a complete truth table has 2ⁿ rows. This calculator supports up to six variables, or 64 rows.

What is the difference between SOP and POS?

Canonical SOP combines AND terms for rows where the output is 1. Canonical POS combines OR terms for rows where the output is 0.

Does the calculator minimize Boolean expressions?

It provides canonical SOP and POS forms. These are systematic but may not be minimal; a separate Boolean minimization method is needed to guarantee a shortest form.

References & technical sources

Keep calculating

Related calculators