Skip to content

Truth Table Calculator (Boolean Algebra and K-Map Solver)

Make a truth table from any Boolean expression, list minterms and maxterms, and simplify to minimal SOP and POS with Quine–McCluskey and a Karnaugh map.

Calculator Details

Minimal sum of products:F = AB + A′CSee results ↓

Type a Boolean expression, or list minterm numbers (the K-map solver)

Variables A–Z (up to 6). NOT: ' ¬ ~ !, AND: AB · * & AND, OR: + | OR, XOR: ⊕ ^ XOR, also NAND, NOR, XNOR, -> (implies), <-> (iff), 0, 1

Optional input bits in variable order, e.g. 101 for A = 1, B = 0, C = 1: each gate’s output is shown

Your Results

Minimal sum of products: F = AB + A′C

Minimal sum of products

F = AB + A′C

1 on 4 of 8 rows

Minimal product of sums

F = (A′ + B)(A + C)

From the 0s of the table

Minterms Σm

1, 3, 6, 7

Rows where F = 1

Maxterms ΠM

0, 2, 4, 5

Rows where F = 0

A · B + A′ · C is 1 on 4 of 8 rows (minterms 1, 3, 6, 7); its minimal sum of products is AB + A′C and its minimal product of sums is (A′ + B)(A + C).

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Detailed Breakdown

Truth table of F = A · B + A′ · C
RowABCF
00000
10011 (true)
20100
30111 (true)
41000
51010
61101 (true)
71111 (true)
Karnaugh map (rows A, columns BC; small numbers are minterms)
A \ BC00011110
00m01m11m30m2
10m40m51m71m6

How This Calculator Works

How it's calculated

The expression is read by a parser written for Boolean algebra, with NOT binding tightest, then AND, XOR, OR, implication and equivalence. It is evaluated for every combination of the variables, in binary order with the first variable as the most significant bit, which gives the truth table. Each row where F = 1 is a minterm; the canonical sum of products ORs those minterms together, and the canonical product of sums ANDs one sum term for each row where F = 0.

The minimal forms use the Quine–McCluskey method: minterms (and don't-cares) that differ in one bit are merged repeatedly until no more merges are possible, leaving the prime implicants. Essential prime implicants, the only ones covering some minterm, are kept, and the smallest set of the rest that covers what remains is chosen. The minimal POS does the same with the 0s. A Karnaugh map shows the same grouping visually for up to 4 variables.

F = A · B + A′ · C
Σm(1, 3, 6, 7) = A′B′C + A′BC + ABC′ + ABC
Prime implicants: AB, A′C, BC
Essential: AB, A′C
Minimal SOP: F = AB + A′C
Minimal POS: F = (A′ + B)(A + C)

Frequently Asked Questions

How do I type a Boolean expression?

Use single letters for variables. For NOT write ' after a variable (A'), or ¬, ~, ! or NOT before it; for AND write the letters together (AB) or use ·, *, & or AND; for OR use +, | or OR. XOR (⊕ or ^), NAND, NOR, XNOR, -> (implies) and <-> (if and only if) also work, with brackets to group.

What are minterms and maxterms?

A minterm is a row of the truth table where the output is 1, numbered by its input bits read as a binary number; a maxterm is a row where the output is 0. AB + A′C is 1 on rows 1, 3, 6, 7, so F = Σm(1, 3, 6, 7) and F = ΠM(0, 2, 4, 5).

What is the difference between SOP and POS?

Sum of products (SOP) is an OR of AND terms, read from the 1s of the table; product of sums (POS) is an AND of OR terms, read from the 0s. Both describe the same function. For AB + A′C the minimal SOP is AB + A′C and the minimal POS is (A′ + B)(A + C).

How does the K-map solver work?

Choose "Minterms", set the number of variables and list the minterms (and any don't-cares). The calculator draws the Karnaugh map for up to 4 variables and finds the minimal expression with the Quine–McCluskey method, which gives the same result as circling the largest groups on the map. For Σm(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14) the answer is C′ + A′D′ + BD′.

What are don't-care conditions?

Input combinations that can never happen, or whose output doesn't matter, such as the unused codes 10–15 of a BCD digit. They are marked X; the simplifier treats each one as 1 or 0, whichever makes the expression smaller, and never needs them covered.

How is implication (A → B) evaluated?

A → B is false only when A is true and B is false; otherwise it is true, including when A is false. Its minimal SOP is A′ + B, which is the logic identity A → B ≡ ¬A ∨ B.

Why are NAND and NOR called universal gates?

Each can build NOT, AND and OR on its own, so any circuit can be made from just one gate type. A NAND B is A′ + B′ by De Morgan's theorem; tying both inputs together gives NOT A.

Is the minimal expression unique?

Not always. Some functions have several minimal sums of products with the same number of terms and literals, for example when a cyclic set of prime implicants can be covered in two ways. The calculator shows one of them; the prime implicants listed under the result show the alternatives.

Up to 6 variables (64 rows), named by single letters A–Z; letters written together are ANDed (AB means A AND B). Precedence follows the usual digital-design order: NOT, then AND and NAND, then XOR and XNOR, then OR and NOR, then implication, then equivalence; chains of NAND or NOR are read left to right. Minimal forms come from Quine–McCluskey with an exhaustive search over the remaining prime implicants (fewest terms, then fewest literals); when several minimal forms exist, one is shown. Not included: multi-output minimisation, gate-count or NAND-only/NOR-only circuit synthesis, timing hazards, circuit diagrams, and the K-map drawing for 5 and 6 variables (the table and minimal forms still work).

Truth Table Calculator: Boolean Expressions, SOP, POS and Karnaugh Maps

By FindMySum · Last reviewed

A truth table calculator lists the output of a Boolean expression for every combination of its inputs. This one goes further: it reads the expression in either logic or digital-design notation, lists the minterms and maxterms, writes the canonical sum of products and product of sums, and simplifies the function to its minimal SOP and POS forms with the Quine–McCluskey method. For up to four variables it draws the Karnaugh map, and it can show the output of each gate for one input. You can also start from a list of minterms and don't-cares, which turns it into a K-map solver.

Reading a Boolean expression

Boolean algebra has two values, 0 (false) and 1 (true), and three basic operations:

  • NOT (complement), written A′, ¬A or ~A: 1 becomes 0 and 0 becomes 1.
  • AND, written AB, A·B or A ∧ B: 1 only when both inputs are 1.
  • OR, written A + B or A ∨ B: 1 when at least one input is 1.

Derived operations are XOR (1 when the inputs differ), XNOR (1 when they are equal), NAND and NOR (AND and OR followed by NOT), implication A → B (false only when A = 1 and B = 0) and equivalence A ↔ B. Without brackets, NOT is applied first, then AND, then XOR, then OR, so AB + A′C means (A AND B) OR ((NOT A) AND C).

Minterms, maxterms and canonical forms

Number the rows of the truth table by reading the inputs as a binary number, first variable most significant. Each row where F = 1 is a minterm, written as a product that is 1 on that row only: row 6 of a three-variable table, ABC = 110, is the minterm ABC′. ORing all the minterms gives the canonical sum of products, F = Σm(…).

Each row where F = 0 is a maxterm, a sum that is 0 on that row only: row 0, ABC = 000, gives (A + B + C). ANDing all of them gives the canonical product of sums, F = ΠM(…). The two lists are complements of each other: every row is either a minterm or a maxterm (or a don't-care).

Simplifying: Karnaugh maps and Quine–McCluskey

Canonical forms are long. Simplification merges terms that differ in a single variable, using the identity XY + XY′ = X. On a Karnaugh map the rows and columns are labelled in Gray code (00, 01, 11, 10), so neighbouring cells differ in one bit and mergeable minterms sit next to each other, including across the edges. Circling the largest power-of-two rectangles of 1s gives the prime implicants.

The Quine–McCluskey method does the same merging in tables, which works for any number of variables and is how this calculator simplifies:

  1. List the minterms and don't-cares in binary.
  2. Merge every pair that differs in one bit, marking the differing bit with a dash. Repeat with the merged terms until nothing merges. Terms never merged are the prime implicants.
  3. Pick the essential prime implicants: those that are the only cover for some minterm.
  4. Cover the remaining minterms with as few further prime implicants as possible, then as few literals as possible.

The minimal product of sums comes from doing the same with the 0s and complementing the variables.

Worked example: F = AB + A′C

The calculator opens with this expression.

  1. Truth table: AB is 1 on rows 6 and 7; A′C on rows 1 and 3. So F = Σm(1, 3, 6, 7), and the maxterms are 0, 2, 4 and 5.
  2. Prime implicants: merging gives A′C (rows 1, 3), BC (rows 3, 7) and AB (rows 6, 7).
  3. Essential: row 1 is covered only by A′C and row 6 only by AB, so both are essential. Together they cover every minterm, and BC is redundant (it is the consensus term of the other two).
  4. Result: the minimal SOP is AB + A′C, and from the 0s the minimal POS is (A′ + B)(A + C).

Don't-cares

Some input combinations never occur. A circuit that takes a decimal digit in BCD only sees the codes 0 to 9, so codes 10 to 15 are don't-cares. Marking them lets the simplifier treat each as a 1 when that makes a group larger, and ignore it otherwise, which often gives a much simpler circuit. In minterm mode, list them in the don't-care box; they appear as X on the map.

Gate by gate

Give one input combination in "Evaluate at", such as 011 for A = 0, B = 1, C = 1, and the calculator lists every NOT, AND, OR or other gate in the expression with its output, in the order a signal would pass through a circuit. It is a quick way to trace why a circuit gives the output it does.

Limits

The calculator handles one output and up to six single-letter variables. It doesn't minimise several outputs together, convert to NAND-only or NOR-only circuits, draw circuit diagrams or analyse timing hazards. When a function has more than one minimal form, it shows one.

More questions

How many rows does a truth table have?

2ⁿ for n variables, because each variable can be 0 or 1 independently: 4 rows for 2 variables, 8 for 3, 16 for 4 and 64 for 6. That doubling is why truth tables and Karnaugh maps become impractical by hand beyond 5 or 6 variables, and why computer methods such as Quine–McCluskey are used instead.

What is the difference between a truth table in logic and in digital electronics?

None in substance. Logic courses write true and false with ∧, ∨, ¬ and →; digital design writes 1 and 0 with AND, OR, NOT gates and the notation AB + A′C. The calculator accepts both notations and gives the same table.

What are De Morgan's theorems?

(AB)′ = A′ + B′ and (A + B)′ = A′B′: the complement of an AND is the OR of the complements, and the complement of an OR is the AND of the complements. They let you move a NOT through brackets and convert between NAND/NOR circuits and AND/OR circuits.

What is a prime implicant?

A product term that implies the function (it is 1 only where F is 1 or don't-care) and can't be made smaller by removing a literal. On a Karnaugh map it is a largest possible rectangle of 1s whose size is a power of 2. An essential prime implicant is one that is the only cover for some minterm, so every minimal expression must include it.

Why does the order of the variables matter in a truth table?

It sets the row numbers. With A as the most significant bit, the row A = 1, B = 1, C = 0 is binary 110, minterm 6. Listing the variables as C, B, A instead reads the same row as 011, minterm 3, so the minterm list changes even though the function doesn't. The calculator orders variables alphabetically, first letter most significant.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy