Binarios.org
Digital Logic Tools

Karnaugh Map Solver

Minimize Boolean functions with an interactive 2, 3, or 4-variable Karnaugh map. Enter minterms, mark don't-care conditions, or click the map cells. The calculator generates simplified Sum of Products (SOP), Product of Sums (POS), and a complete truth table.

1. Configure your Boolean function

Separate names with commas, e.g. A,B,C,D.
Enter indices separated by commas or spaces.
Don't-care indices cannot also be minterms.
X means don't-care.

2. Interactive Karnaugh map

Click any cell to cycle its value. Recalculate to update the minimized expressions.

Loading map…

Click a cell: 0 = off, 1 = on, X = don't-care.

3. Minimized results

Load an example or enter minterms, then click Calculate expression.

Sum of Products (SOP)

—

Product of Sums (POS)

—

Function notation

—

Truth table

The truth table reflects the current map values. X denotes an unspecified output.

The truth table will appear here.

How to use the Karnaugh map solver

  1. Choose 2, 3, or 4 variables and enter their names.
  2. Enter the minterm indices where the function output should be 1.
  3. Optionally enter don't-care indices that can be used to simplify the expression.
  4. Click Apply indices to map to load the values, or click cells directly.
  5. Click Calculate expression to obtain the minimized SOP and POS expressions.

Minterm indices use standard binary ordering: the first variable is the most significant bit. For example, with variables A, B, and C, minterm 5 corresponds to A = 1, B = 0, C = 1.

Understanding SOP and POS

Sum of Products

SOP expresses a Boolean function as an OR of AND terms. For example, A'B + AC is an SOP expression. In a Karnaugh map, groups of 1s produce the product terms.

Product of Sums

POS expresses a Boolean function as an AND of OR terms. For example, (A + B)(A' + C) is a POS expression. Groups of 0s are used to derive the sum terms.

Karnaugh map groups have sizes that are powers of two. Groups may wrap around map edges, and overlapping groups are allowed when they produce a simpler expression. Don't-care cells may be treated as either 0 or 1 when this improves the result.

Frequently asked questions

What is a Karnaugh map?

A Karnaugh map, or K-map, is a visual method for simplifying Boolean functions. It places truth-table outputs in Gray-code order so adjacent cells differ in one variable.

What is a minterm?

A minterm is a product term that corresponds to one input combination. A function's minterm list identifies the input combinations where its output is 1.

What are don't-care conditions?

Don't-care conditions are input combinations whose outputs do not matter for the application. A solver can use them as 0 or 1 when forming larger groups.

Does the calculator support four variables?

Yes. It supports two, three, and four variables, with up to 16 map cells.

Why can more than one simplified expression be correct?

Different combinations of valid groups can cover the same function with the same cost. This calculator selects a compact cover, but other equivalent minimal expressions may also exist.

Related digital logic tools