Boolean Algebra Calculator

Evaluate Boolean expressions with AND, OR, NOT, XOR, NAND, NOR operators.

Evaluate a boolean expression with variables A, B, C — generates full truth table

Use: AND, OR, NOT, &&, ||, ! — Variables: A, B, C

What Is the Boolean Algebra Calculator?

The Boolean Algebra Calculator generates a complete truth table for any Boolean expression using variables A, B, and C. It evaluates all 8 combinations of true/false values and shows the result for each row, classifying the expression as a tautology, contradiction, or contingency.

Formula

Boolean Operators: AND: A AND B, A && B, A∧B → true only if both A and B are true OR: A OR B, A || B, A∨B → true if at least one is true NOT: NOT A, !A, ¬A → flips the truth value XOR: A XOR B → true if exactly one is true Key Laws: De Morgan's: ¬(A∧B) = ¬A∨¬B and ¬(A∨B) = ¬A∧¬B Absorption: A∧(A∨B) = A and A∨(A∧B) = A Double Negation: ¬¬A = A

How to Use

Enter a Boolean expression using A, B, C as variables. Supported operators: AND (&&), OR (||), NOT (!), and parentheses for grouping. Click Generate Truth Table to see all 8 rows. Use the example buttons for common expressions like AND, OR, XOR, and De Morgan's laws.

Example Calculation

Expression: (A AND B) OR (NOT A AND C) A B C | (A∧B) | ¬A | (¬A∧C) | Result 0 0 0 | 0 | 1 | 0 | 0 0 0 1 | 0 | 1 | 1 | 1 0 1 0 | 0 | 1 | 0 | 0 0 1 1 | 0 | 1 | 1 | 1 1 0 0 | 0 | 0 | 0 | 0 1 0 1 | 0 | 0 | 0 | 0 1 1 0 | 1 | 0 | 0 | 1 1 1 1 | 1 | 0 | 0 | 1

Understanding Boolean Algebra

Boolean algebra was invented by George Boole in 1847 as a way to express logical reasoning in algebraic form. Its significance became clear a century later when Claude Shannon showed that Boolean algebra is the mathematical language of digital circuits.

Every logic gate in a computer — AND, OR, NOT, NAND, NOR, XOR — implements a Boolean operation. A truth table enumerates all possible input combinations and their outputs, completely characterizing the gate's behavior.

The NAND gate is particularly special: any Boolean function can be implemented using only NAND gates (it is "functionally complete"). This makes NAND the universal building block of digital electronics.

Frequently Asked Questions

What is a tautology?

A tautology is a Boolean expression that is always TRUE regardless of the input values. Example: A OR NOT A is always true.

What is a contradiction?

A contradiction (or unsatisfiable formula) is always FALSE for all input combinations. Example: A AND NOT A is always false.

What is a contingency?

A contingency is neither a tautology nor a contradiction — it is true for some inputs and false for others. Most real-world Boolean expressions are contingencies.

What are De Morgan's Laws?

De Morgan's Laws state: NOT(A AND B) = (NOT A) OR (NOT B), and NOT(A OR B) = (NOT A) AND (NOT B). They allow you to push negation inside compound expressions.

What are real-world applications?

Boolean algebra is the mathematical foundation of digital circuits (logic gates), programming (if/else conditions), database queries (WHERE clauses), and search engines (AND/OR/NOT in search queries).

Related Tools