Digital logic helper

Karnaugh Map Solver for 2, 3, and 4 variables

Use this Karnaugh Map Solver to simplify Boolean expressions for digital logic classes, circuit design practice, and quick homework checks. The map uses correct Gray-code ordering, supports don't-care optimisation, and highlights the groups used in the final SOP expression.

  • Select 2, 3, or 4 variables and enter minterms such as 0, 2, 5, 7.
  • Click cells to cycle between 0, 1, and X while the map updates automatically.
  • See colored groups, wrapping groups, corner groups, and a step-by-step explanation.

Number of variables

Function input

Use comma or space separated decimal minterm numbers. Click any map cell to switch it between 0, 1, and X.

Solver actions

K-map

Cells are arranged in Gray-code order. Colored dots show which simplified group covers each cell.

4 variables
ABCD
00
01
11
10
00
01
11
10

Karnaugh map guide for students

Learn how the solver reads minterms, forms valid K-map groups, and turns each group into an SOP term.

Enter minterms or click the K-map directly

You can type minterms as decimal numbers, add optional don't-care terms, or build the function by clicking cells. Each click cycles a cell through 0, 1, and X so the map is easy to adjust while studying.

Use Gray-code order for correct adjacency

Karnaugh maps rely on Gray-code ordering so neighboring cells differ by exactly one variable. This solver displays 2, 3, and 4 variable maps in that order, including the wraparound edges.

See how each SOP term is formed

After solving, every colored group lists the cells it covers and the variables that remain constant. Variables that change inside a group disappear from that product term.

Share a K-map without a database

The current variable count, minterms, and don't-care terms are stored in URL parameters. That makes it easy to share a specific K-map with a classmate or reopen it later.

How to solve a Karnaugh map online

Follow these steps to simplify a Boolean function with the K-map solver.

  1. Choose the number of variables

    Select whether your Boolean function has 2, 3, or 4 variables.

  2. Enter minterms and don't-cares

    Type decimal minterms such as 0, 2, 5, 7 and add optional don't-care terms if your problem includes them.

  3. Review or edit the K-map cells

    Use the Gray-code K-map to check the generated cells, or click cells to switch between 0, 1, and X.

  4. Solve and read the SOP expression

    Click Solve to see colored groups, step-by-step explanations, and the final simplified SOP expression.

Karnaugh Map Solver FAQ

Quick answers about K-map input, don't-cares, wrapping groups, and SOP simplification.

What variable counts does this Karnaugh Map Solver support?

It supports 2-variable, 3-variable, and 4-variable K-maps.

Can I use don't-care terms?

Yes. Enter don't-care terms as X values, or click a cell until it becomes X. The solver can use them when they create a simpler SOP expression.

Does the map use Gray-code order?

Yes. Rows and columns are ordered with Gray code so adjacent cells differ by one variable.

Does it support wrapping groups?

Yes. Groups can wrap across left and right edges, top and bottom edges, and the four corners of a 4-variable map.

What output form does the solver generate?

The solver generates simplified SOP form, also called Sum of Products form.

Can I share a solved K-map?

Yes. The selected variable count, minterms, and don't-care terms are stored in the URL so the Share Link button can copy a database-free link.