Skip to content
K-Map Solver

3-Variable Karnaugh Map Solver

A three-variable K-map has eight cells. Fill it in below to get the simplest sum-of-products or product-of-sums expression, with every group drawn and explained.

Try an example
Variables
ABC0001111001

F = Σm(3, 5, 6, 7)

4 ones · 0 don't-cares · 4 zeros

0false1trueXdon't care (either)

Click a cell to cycle 0 → 1 → X, or hold the button and drag to paint. With the keyboard: arrow keys move, 0 1 X set a value, Space cycles, Page Up/Down switches layers, Ctrl+Z undoes.

Variable namesA B C

1–3 characters, starting with a letter. Names must be different from each other.

Simplified K-map result

Updates as you edit. Hover a term or a card to see its group on the map.

ABC0001111001

Simplified Boolean expression

F =BC+AC+AB

3 terms6 literals4 gates Checked against your function

Groups

  • BCEssential
    Minterms
    (3, 7)
    Original
    A'BC + ABC
    Simplified
    BC
  • ACEssential
    Minterms
    (5, 7)
    Original
    AB'C + ABC
    Simplified
    AC
  • ABEssential
    Minterms
    (6, 7)
    Original
    ABC' + ABC
    Simplified
    AB

Truth table check

8 match0 mismatch

Every input row is evaluated against the simplified expression. A don't-care (X) row may give 0 or 1.

mABCYour FResultStatus
000000 Match
100100 Match
201000 Match
301111 Match
410000 Match
510111 Match
611011 Match
711111 Match
Step-by-step: how the solver gets there (Quine–McCluskey)

Logic circuit

Fit
ABCF
3 AND gates and 1 OR gate9 gate inputs2 levels Simulated circuit matches your function

Hover a gate to highlight its group · drag to pan · Ctrl/⌘ + scroll or the buttons to zoom.

Gate list
  • G1 = AND(B, C)
  • G2 = AND(A, C)
  • G3 = AND(A, B)
  • F = OR(G1, G2, G3)

Export & share

Files always use the light theme so they print cleanly.

Images
Expression as
F = B C + A C + A B

How the 3-variable map is laid out

The map is two rows by four columns. A selects the row; B and C select the column, in Gray-code order 00, 01, 11, 10. Gray order is what makes neighbouring columns differ by one variable only.

The left and right columns are also neighbours, so a group may wrap around the edge. The solver draws such a group with open brackets at the border.

Grouping rules

Groups are rectangles of 1, 2, 4 or 8 cells. A group of two removes one variable, a group of four removes two, and all eight cells make the constant 1. Use the biggest groups possible and as few as possible; overlaps are fine.

Worked example: sum of products

The majority function is 1 when at least two of the three inputs are 1. It is also the carry output of a full adder.

F = Σm(3, 5, 6, 7)

ABC0001111001

Simplified result

F = BC + AC + AB

  • BC — minterms (3, 7)
  • AC — minterms (5, 7)
  • AB — minterms (6, 7)

How to use the K-map solver

  1. Pick the number of variablesChoose 2 to 6. Five and six variables are drawn as several 4×4 layers whose matching cells are neighbours.
  2. Describe your functionClick cells on the map, fill in a truth table, type a Boolean expression, or list minterms or maxterms. All five views edit the same function.
  3. Mark don't-caresCycle a cell 0 → 1 → X. A don't-care may be treated as 0 or 1, whichever makes the groups bigger.
  4. Choose SOP or POSSum of products groups the ones. Product of sums groups the zeros and gives the maxterm form.
  5. Read the groupsEach coloured outline is one term. The same colour marks the term in the expression and its card, which lists the cells it covers.
  6. Check, build, exportCompare the result with your input in the verification table, open the logic circuit, step through the algorithm, then export or share.

Key features

  • 2 to 6 variables

    Up to 64 cells, with layered maps for 5 and 6 variables.

  • Five ways to enter a function

    Map, truth table, expression, minterm list or maxterm list — switch freely.

  • Provably minimal

    Exact cover search over all prime implicants, with every equally good alternative on offer.

  • Don't-care aware

    X cells enlarge groups but never have to be covered.

  • Wrap-around groups

    Groups across the map edges are drawn as open brackets, the way textbooks show them.

  • Logic circuit

    AND–OR, OR–AND, NAND-only or NOR-only schematics with zoom and gate counts.

  • Self-checking

    Every answer is re-evaluated against your input; a truth table flags any mismatch.

  • Step-by-step

    Quine–McCluskey tables, the prime-implicant chart and Petrick's method.

  • Export and share

    PDF report, PNG/SVG, LaTeX, Verilog, VHDL, C, and a link that reopens your problem.

  • Private and offline-friendly

    Everything runs in your browser. Nothing you enter is uploaded.

Frequently asked questions

How many cells does a 3-variable K-map have?

Eight, one per combination of A, B and C.

Why is the column order 00, 01, 11, 10?

It is a Gray code: each step changes a single bit, so cells that look adjacent really are logically adjacent.

How do I get the product-of-sums answer?

Switch the result from SOP to POS. The solver then groups the zeros instead of the ones.