Karnaugh Map Solver LogoKarnaugh Map Solver

Karnaugh Map Solver (K-Map Calculator)

Simplify Boolean functions instantly using K-Maps, truth tables, Boolean expressions, minterms, or maxterms. Get exact SOP/POS results step by step.

How would you like to define your K-map?

Variables
00
01
11
10
00
01
11
10

Click cells to toggle between 0, 1, and X (don't care)

Simplified K-Map Result

Map Groupings

00
01
11
10
00
01
11
10

The function is constant; the entire map or no cells are grouped.

Simplified Expression

F = 0

Original Groups Breakdown

No groups needed (F = 0).
Terms
0
Literals
0
Gates
0

Gate-Level Circuit Diagram

F0GND

Synchronized Truth Table

Updates automatically based on your K-Map input.

ABCD
m
Output
0000
m0
0001
m1
0010
m2
0011
m3
0100
m4
0101
m5
0110
m6
0111
m7
1000
m8
1001
m9
1010
m10
1011
m11
1100
m12
1101
m13
1110
m14
1111
m15

How it works

From a boolean function to a minimized, gate-level circuit in four steps.

  1. Choose your variables

    Pick 2, 3, 4, or 5 variables to match the boolean function you're minimizing.

  2. Enter your function

    Type a boolean expression, list minterms or maxterms, or fill in the truth table directly.

  3. Read the grouped map

    Pairs, quads, and octets are outlined automatically as the solver finds the largest valid groups.

  4. Get the minimized result

    Copy the simplified SOP or POS expression, view the gate-level circuit, or export a PDF.

What you'll see

A preview of the tool's main views. Scroll to browse.

Karnaugh Map

A gray-code grid with pair, quad, and octet groups outlined directly on the cells.

Truth table input

Cycle every row between 0, 1, and don't-care without leaving the keyboard.

Expression parser

Type boolean notation like AB' + C and see it converted straight into the map.

Circuit diagram

The minimized expression rendered as AND, OR, and NOT gates with routed wires.

Step-by-step trace

Every Quine-McCluskey pass and Petrick's method decision explained in plain language.

Advanced Karnaugh Map Solver for Digital Logic

Our solver is a state-of-the-art Karnaugh map calculator designed for digital logic and Boolean expression simplification. It handles any Boolean function of 2–5 variables and operates with academic rigor. We use the full Quine–McCluskey minimization algorithm (with Petrick’s method) to guarantee each solution is provably minimal. In practice this means the final expression has the fewest terms and literals possible, yielding the simplest SOP or POS form. The result is a reliable, optimal simplification that EE/CS instructors trust – not a heuristic guess.

Five Input Methods, One Simplified Result

The solver offers five synchronized input methods: an interactive K-map grid, truth table, Boolean expression, minterm list, or maxterm list. Any change in one view instantly updates all others and the simplified result (all inputs support don’t-care entries). This flexibility lets you work however you prefer and quickly verify your work. You can also toggle between SOP and POS output without re-entering data. The multi-input approach ensures one consistent answer across map, table, and equation modes.

Exact Minimization via Quine–McCluskey

Under the hood, the solver performs a rigorous minimization – not a shortcut. It enumerates all prime implicants using the Quine–McCluskey method and applies Petrick’s technique for any remaining tie-breaking. In short, it finds the absolute minimum Sum-of-Products or Product-of-Sums expression for your function. The practical benefit is the fewest logic gates and smallest circuit for your design. This exact algorithmic approach ensures the solution is mathematically optimal every time.

Educational Focus with Step-by-Step Solutions

Beyond just an answer, our solver is built as a learning aid. Every result includes a complete Quine–McCluskey derivation – prime implicants, essential terms, and any Petrick-method steps – so that the Karnaugh map and algebra “stay one story”. Each grouping is highlighted and explained, aligning the map with the algebraic simplification. You can download a detailed PDF report of the solution, which includes the K-map visualization, each intermediate step, and even an auto-generated logic circuit diagram.

Frequently Asked Questions

What is a Karnaugh map (K-Map)?
A K-map is a grid-based representation of a Boolean truth table where adjacent cells differ by one bit (Gray-code order). Grouping adjacent 1s (or 0s) in powers-of-two (1,2,4,8…) yields simplified terms. In practice, it’s a visual method for minimizing Boolean expressions into the simplest SOP/POS form.
How many variables can this solver handle?
It supports 2–5 input variables. (A 4-variable map is a 4×4 grid; a 5-variable map is drawn as two adjacent 4×4 grids.) K-maps for more than 5 variables become impractically large, so this tool is optimized for up to five inputs.
What are “don’t-care” conditions?
Don’t-care conditions (marked X) are input combinations whose output doesn’t matter (e.g. invalid or unused states). The solver treats each X as 0 or 1 in whichever way produces a simpler solution. They are optional placeholders – including a don’t-care can enlarge groups and reduce literals, but the minimization never requires covering them.
What is Petrick’s Method?
Petrick’s Method is an algebraic technique used after the Quine–McCluskey steps. When more than one minimal cover of prime implicants exists, Petrick’s method systematically picks the combination with the fewest terms. In other words, it guarantees the final expression remains minimal if any tie-breaking is needed.
What export options are available?
You can download the full solution as a PDF report, which includes all Karnaugh map groupings, derivation steps, and the final expressions. Additionally, the truth table or K-map grid can be exported in standard formats (e.g. CSV for the table, PNG for the map) for documentation. The solver even generates a logic circuit diagram from the minimized expression for quick visualization.
When should I use SOP vs. POS form?
SOP (Sum of Products) is found by grouping 1s to form OR’ed AND terms, while POS (Product of Sums) groups 0s to form AND’ed OR terms. Both represent the same function, but one may yield fewer gates depending on the function (for example, POS is often simpler when there are many 1s). Our tool computes both forms and lets you compare to pick the most compact implementation.

Available Languages