Skip to content
K-Map Solver

Truth Table to K-Map Solver

Set the output of every input row to 0, 1 or X and let the solver find the simplest expression. The map, expression and circuit stay in sync.

Try an example
Variables

Pick the output of every row: 0, 1 or X (don't care). Keyboard: ↑ ↓ change row, ← → change value, or press 0, 1, X.

Truth table rows 0 to 7
#ABCF
0000
1001
2010
3011
4100
5101
6110
7111

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

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

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

From table to map

A truth table lists every input combination in binary order. A K-map holds the same information in Gray-code order so that adjacent cells differ by one variable. The solver converts between the two for you; edit either and the other updates.

Entering a table

Each row has a button that cycles 0, 1 and X. Rows are numbered by their minterm index, and variable A is the most significant bit. Use “Fill all with 1” or “Clear all” for a fast start.

Worked example: sum of products

The sum output of a full adder is 1 when an odd number of inputs are 1.

F = Σm(1, 2, 4, 7)

ABC0001111001

Simplified result

F = A'B'C + A'BC' + AB'C' + ABC

  • A'B'C — minterms (1)
  • A'BC' — minterms (2)
  • AB'C' — minterms (4)
  • ABC — minterms (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

Can the truth table hold don't-cares?

Yes. Set a row's output to X to mark it as a don't-care.

Why does the sum of a full adder not simplify?

Its ones sit on a checkerboard: no two are neighbours, so no group larger than one cell exists.