Boolean Algebra Calculator

Our Boolean Algebra Calculator handles all digital logic and boolean algebra operations in one place. Enter any boolean expression using standard operators — AND, OR, NOT, XOR, NAND, NOR, XNOR — and instantly get the truth table, minterms, maxterms, canonical SOP and POS forms, and a minimized expression using the Quine-McCluskey algorithm. The Karnaugh map visualizer highlights which cells are minterms, making it easy to identify groupings and simplifications.

star 4.9
auto_awesome AI
New

Boolean Calculator calculator

Operators: * or AND = AND  |  + or OR = OR  |  ' or ! = NOT  |  ^ or XOR = XOR  |  NAND, NOR, XNOR

Examples:

Minimal SOP (Simplified)

Minterms Σm(…)

Maxterms ΠM(…)

Canonical SOP

Canonical POS

Truth Table

calculate Boolean Laws

Identity
A+0=A   A·1=A
Null
A+1=1   A·0=0
Idempotent
A+A=A   A·A=A
Complement
A+A'=1   A·A'=0
Absorption
A+AB=A   A(A+B)=A
De Morgan's
(AB)'=A'+B'
(A+B)'=A'·B'
Double Negation
(A')'=A

grid_on Input Syntax

AND A*B   A·B   A AND B
OR A+B   A OR B
NOT A'   !A   NOT A
XOR A^B   A XOR B
NAND A NAND B
NOR A NOR B

lightbulb Quick Tips

  • AB means A AND B (implicit multiplication)
  • K-map groups must be powers of 2: 1, 2, 4, 8
  • Green cells = 1 (minterm), Red = 0 (maxterm)
  • NAND and NOR are universal gates
  • More 1s grouped → simpler expression

How to Use the Boolean Calculator

1

Enter Expression

Type your boolean expression using * (AND), + (OR), ' or ! (NOT), ^ (XOR). Variables are single letters A-Z.

2

View Truth Table

The truth table is generated automatically for all variable combinations (up to 4 variables = 16 rows)

3

Check K-map

The Karnaugh map highlights minterms (1s) making it easy to spot groupings for simplification

4

Get Simplified Form

See the minimal SOP expression from the Quine-McCluskey algorithm along with canonical SOP/POS forms

The Formula

A boolean function is fully defined by its truth table. SOP canonical form: OR of all minterms (rows where output = 1). POS canonical form: AND of all maxterms (rows where output = 0). The Quine-McCluskey algorithm minimizes SOP by grouping minterms that differ by one variable.

F = Σm(minterms) = Πm(maxterms)

lightbulb Variables Explained

  • A, B, C, D Boolean input variables (0 or 1)
  • AND (·) Logical AND — output 1 only if both inputs are 1
  • OR (+) Logical OR — output 1 if at least one input is 1
  • NOT (') Logical NOT — inverts the input
  • XOR (⊕) Exclusive OR — output 1 if inputs differ
  • SOP Sum of Products — OR of AND terms (minterms)
  • POS Product of Sums — AND of OR terms (maxterms)

tips_and_updates Pro Tips

1

Use * or · for AND, + for OR, ' or ! for NOT, ^ for XOR

2

Complement law: A + A' = 1, A · A' = 0 — use this to eliminate variables

3

De Morgan's: (A·B)' = A'+B' and (A+B)' = A'·B'

4

Absorption: A + A·B = A and A·(A+B) = A

5

Group minterms in powers of 2 (1, 2, 4, 8) on the Karnaugh map for minimal SOP

6

NAND and NOR are universal gates — any boolean function can be built from just NAND

Boolean algebra is the mathematical foundation of digital electronics, computer science, and logic circuit design. Every processor, memory chip, and programmable logic device relies on boolean operations — AND, OR, NOT, XOR, NAND, NOR — to process binary data. Engineers and computer science students routinely need to simplify boolean expressions to minimize gate counts, reduce circuit complexity, and optimize power consumption. A single 4-variable function can have up to 16 rows in its truth table and dozens of possible simplifications. Manual simplification using De Morgan's theorems, consensus, and absorption laws is tedious and error-prone, especially under exam conditions. This boolean algebra calculator automates the entire workflow: enter any expression with up to four variables, and it instantly produces the complete truth table, identifies all minterms and maxterms, generates canonical Sum-of-Products (SOP) and Product-of-Sums (POS) forms, applies the Quine-McCluskey algorithm for guaranteed minimal expressions, and renders a color-coded Karnaugh map for visual verification. Whether you are designing combinational logic for an FPGA, verifying homework problems, or preparing for a digital logic exam, this tool replaces hours of manual work with accurate, step-by-step results.

What is a Boolean Algebra Calculator?

A boolean algebra calculator evaluates and simplifies logical expressions using the rules of boolean algebra.

It generates truth tables showing every input/output combination, identifies minterms and maxterms, and applies minimization algorithms like Quine-McCluskey to find the simplest equivalent expression.

Boolean Operators and Notation

This calculator accepts multiple notation styles:

  • AND (*, ·, AND, &&)
  • OR (+, OR, ||)
  • NOT (', !, ~, NOT)
  • XOR (^, XOR)
  • NAND
  • NOR
  • XNOR

Variables are single letters A through D. Parentheses are supported for grouping.

Examples: A*B+C', (A OR B) AND NOT C, A NAND B.

How to Simplify a Boolean Expression Step by Step

To simplify a boolean expression, apply the algebraic laws that govern binary logic until no further reduction is possible.

Start with the identity and complement laws (A + A' = 1, A · A' = 0), then use absorption (A + A·B = A) and distribution to factor common variables. De Morgan's theorems convert complemented groups, and the consensus theorem removes redundant terms. For a systematic result, list minterms and combine those differing by one bit.

As George Boole introduced in his 1854 work, per Encyclopaedia Britannica, these laws form a closed algebra where every expression can be reduced to a minimal form (not always unique). This calculator shows each rule applied in order.

How to Read and Build a Truth Table for Any Logic Function

A truth table lists every possible combination of input variables and the resulting output, giving a complete definition of a boolean function.

For n variables there are 2^n rows, so two variables produce 4 rows and four variables produce 16 rows; conversely, the number of variables equals the base-2 logarithm of the row count, which our logarithm calculator can evaluate for larger functions. Order the inputs in standard binary counting sequence (00, 01, 10, 11) and evaluate the expression for each row.

According to the IEEE standard for logic operations, the output column fully characterizes the function regardless of how the expression is written. This tool auto-generates the truth table, then derives minterms (rows equal to 1) and maxterms (rows equal to 0) directly from it.

SOP vs POS: Sum of Products and Product of Sums Explained

Sum of Products (SOP) expresses a boolean function as an OR of AND terms, one minterm for each row where the output equals 1. Product of Sums (POS) is the dual: an AND of OR terms, one maxterm for each row where the output equals 0.

Both are canonical forms describing the same function, and either can be minimized. Digital design textbooks such as those referenced by All About Circuits note that SOP maps naturally to two-level AND-OR gate networks, while POS maps to OR-AND networks.

Choose whichever yields fewer gates for your circuit. The calculator outputs both canonical forms plus the minimized SOP for comparison.

How Karnaugh Maps Simplify Boolean Logic Visually

A Karnaugh map is a grid that arranges truth-table outputs so that physically adjacent cells differ by exactly one variable, using Gray-code ordering (00, 01, 11, 10).

This adjacency lets you visually group 1s in rectangular blocks of powers of two (1, 2, 4, 8) to eliminate variables and read off a minimal SOP.

Named after Maurice Karnaugh, who published the technique in 1953, K-maps are practical for up to four or five variables before adjacency becomes hard to track. This calculator renders a color-coded map highlighting each minterm so you can confirm the algorithmic result by eye.

How the Quine-McCluskey Algorithm Finds the Minimal Expression

The Quine-McCluskey method is a tabular procedure that guarantees a minimal Sum of Products, making it more reliable than Karnaugh maps for functions with many variables.

It lists every minterm in binary, groups them by the number of 1-bits, then repeatedly combines terms that differ by a single bit, marking the eliminated position with a dash. Terms that cannot combine further are prime implicants. A prime implicant chart then selects the smallest set of essential prime implicants covering all minterms.

Because it is algorithmic, it scales where visual methods fail, which is why it underpins many automated logic-synthesis tools used in modern EDA workflows.

Understanding De Morgan's Theorems and Universal Gates

De Morgan's theorems state that (A·B)' = A' + B' and (A+B)' = A'·B' — complementing a group flips the operator and inverts each variable. These laws are the basis for converting any circuit into NAND-only or NOR-only form.

NAND and NOR are called universal gates because any boolean function can be built entirely from either one, a property widely used in chip fabrication to reduce the number of transistor types. As standard digital-logic references note, this universality simplifies manufacturing and testing.

The calculator applies De Morgan's laws automatically when you enter NAND, NOR, or XNOR operators, showing the equivalent AND/OR/NOT expansion.

Practical Uses of Boolean Algebra in Engineering and Programming

Boolean algebra is used far beyond textbooks. Hardware engineers apply it to minimize gate counts in combinational logic for CPUs, FPGAs, and ASICs, directly cutting power draw and chip area.

Software developers use the same laws to simplify conditional statements, optimize compiler branch logic, and write clearer if-conditions. Database engineers translate query filters into boolean predicates, and search engines evaluate AND/OR/NOT operators the same way.

According to computer-science curricula summarized by Khan Academy, boolean logic is foundational to how all digital information is processed. This calculator supports up to four variables, covering the vast majority of combinational-logic exam problems and everyday simplification tasks.

Common Mistakes When Simplifying Boolean Expressions

Simplifying boolean expressions invites several common errors:

  • The most frequent error is confusing OR (+) with arithmetic addition — in boolean algebra 1 + 1 = 1, not 2.
  • Another is dropping parentheses, which changes operator precedence and produces a different function; NOT binds tightest, then AND, then OR.
  • Students often stop simplifying too early, missing a consensus term or an absorption that removes a whole variable, or too late, over-factoring into a longer expression.
  • Misordering Karnaugh-map columns (using binary 00, 01, 10, 11 instead of Gray code 00, 01, 11, 10) breaks adjacency and yields wrong groupings.

Always verify the simplified result against the original truth table, which this calculator does automatically to catch these mistakes.

Boolean Operator Precedence and Order of Evaluation

When an expression mixes operators without full parentheses, boolean algebra evaluates NOT first, then AND, then OR, mirroring how multiplication precedes addition in ordinary arithmetic.

So A + B·C means A OR (B AND C), and A·B' means A AND (NOT B), not (A AND B)'. XOR is typically treated at the same level as AND or lower, so parentheses are recommended whenever XOR is combined with other operators to avoid ambiguity.

This precedence follows the conventions used across digital-logic references and IEEE notation. To stay safe, wrap any sub-expression whose grouping you care about in parentheses; the calculator respects explicit parentheses over default precedence every time.

Frequently Asked Questions

sell

Tags