K-Map Solver — Interactive Karnaugh Map, SOP/POS & Truth Table.
Click cells on a 2-, 3-, or 4-variable Gray-code Karnaugh Map (0, 1, or Don’t Care X) to compute exact minimal Sum-of-Products (SOP) and Product-of-Sums (POS) Boolean expressions instantaneously.
Rules for grouping K-Map cells and minimizing digital logic circuits.
1. Power-of-Two Group Sizes Only
Every valid K-Map rectangle must contain 1, 2, 4, 8, or 16 adjacent cells. Larger groups eliminate more variables: a group of 2 cancels 1 variable, a group of 4 cancels 2 variables, and a group of 8 cancels 3 variables.
2. Edge Wrap-Around & Corners
A Karnaugh map behaves like a torus: the top and bottom rows are adjacent, the left and right columns are adjacent, and all four corner cells (m0, m2, m8, m10) form a single 4-cell group (B'D').
3. Leveraging Don't Care (X) States
In BCD decoders or state machines where certain binary inputs never occur, setting those cells to X lets the minimizer absorb them into larger groups without forcing extra terms to cover them.
K-Map Group Size vs. Variables Eliminated (4-Variable Map)
Group Size (Cells)
Variables Eliminated
Literals Remaining in Term
Example Term
1 cell
0
4 literals
A'BC'D
2 cells
1
3 literals
A'BD
4 cells
2
2 literals
BD
8 cells
3
1 literal
A
16 cells
4
Constant 1
1
Frequently Asked Questions
How does this K-Map solver minimize Boolean expressions?
It runs the exact Quine-McCluskey prime implicant algorithm on your 2-, 3-, or 4-variable Karnaugh map, finds all essential prime implicants, and outputs both the minimal Sum of Products (SOP) and minimal Product of Sums (POS) forms.
How do I enter Don’t Care (X) conditions on the Karnaugh map?
Click any cell on the K-Map or any row in the synced Truth Table to cycle through 0 → 1 → X. Don’t Care cells are automatically grouped with 1s (for SOP) or 0s (for POS) whenever doing so creates a larger power-of-2 implicant and simplifies the logic gate count.
Why are K-Map headers ordered 00, 01, 11, 10 instead of binary order?
Karnaugh maps use Gray code (00, 01, 11, 10) so that every horizontally or vertically adjacent cell—including wrap-around edges—differs by exactly one bit, allowing adjacent 1s to cancel a variable.
When should I use SOP (Sum of Products) vs. POS (Product of Sums)?
SOP groups the 1-minterms and maps directly to AND-OR (or NAND-NAND) gate networks. POS groups the 0-maxterms and maps directly to OR-AND (or NOR-NOR) networks—pick whichever produces fewer literals and gates.
Can I solve classic digital-logic homework problems like a 7-Segment BCD decoder?
Yes. Click the "4-Var 7-Segment a (BCD)" preset to see how marking invalid BCD inputs (10–15) as Don’t Care (X) dramatically reduces the minimized Boolean circuit.
Does this K-Map solver run offline?
Yes. All Quine-McCluskey minimization and truth-table updates execute instantaneously in your browser.