DIGITAL · TOOL

Karnaugh Map Solver

Light up the cells and get the minimal sum-of-products instantly — the algorithm guarantees minimality, no eyeballing groups.

Basic No backend · 100% client-side

What it does: Set the output on a Karnaugh map and find the minimal boolean expression (SOP).

When to use it: When simplifying logic circuits, doing digital-logic homework, or reducing the gate count.

→ B'D' + BD
Minimal expression F = (SOP)?
0

MEANS Light up some cells to start simplifying. Each product term in the expression corresponds to one group of mergeable 1s.

Show prime implicants and selected terms
PPrime implicants: —
Selected (minimum cover): —
mMinterms: — Don't-cares: —
Next

You might also need

How to

How to use the Karnaugh map solver

Pick variables → click cells → read the result.

  1. 01

    Pick the number of variables

    2, 3 or 4 variables, giving 4 / 8 / 16 cells.

  2. 02

    Click cells to set values

    Clicking a cell repeatedly cycles through 0 → 1 → X (don't-care) → 0. 1 = output true, X = don't care.

  3. 03

    Read the minimal expression

    The tool uses Quine–McCluskey + Petrick in real time to find the minimal sum-of-products (SOP) and lists the selected prime implicants.

Reference

Notation and cell states

The expression notation and the three cell states of the Karnaugh map.

Notation / stateMeaning
A'NOT A (A inverted)
ABA AND B (product = AND)
+OR (sum = OR)
cell = 1output is true for that input combination
cell = 0output is false for that input combination
cell = Xdon't-care (can be treated as 0 or 1 to simplify further)

Simplification algorithm: Quine–McCluskey to find prime implicants + Petrick's method to pick the minimum cover (result is the exact minimal SOP).

FAQ

Common questions, answered in 3 minutes

Why is a Karnaugh map arranged in Gray code?

Adjacent cells differ by only one variable bit, so physically adjacent 1s can merge into larger groups, each corresponding to eliminating one variable. The row/column labels in this tool are already ordered in Gray code 00-01-11-10.

What are don't-care terms (X) for?

Some input combinations never actually occur, so their output can be anything. Marking them X lets the algorithm treat them as 1 whenever that yields a simpler result, giving a shorter expression.

Is the result always minimal?

Yes. This tool does not group by eye; it uses Quine–McCluskey to list all prime implicants, then Petrick's method to exhaustively find the cover with the fewest terms and fewest literals.

Can it output a form other than "sum-of-products"?

It currently outputs the minimal SOP (sum-of-products). POS (product-of-sums) can be obtained by inverting the output and simplifying again; this may be added later.

Data Provenance

Standards and sources referenced by this tool

Item Value / Formula Source
Simplification algorithm Quine–McCluskey + Petrick Quine (1952), McCluskey (1956), Petrick (1956)
Gray code adjacency 00 01 11 10 Gray code (reflected binary)

Simplification solved exactly by Quine–McCluskey + Petrick, no external API.

⚡ Powered by Circflow