Karnaugh Map Solver
Solve Boolean functions with a visual K-map, truth table and hand-style simplification steps. Enter an expression or minterms, add don't-care conditions, inspect Gray-code groups, and get minimal SOP and POS results.
More symbolswords, brackets & alternatives
Also supports implicit AND: AB and A(B + C). ≠ is XOR; =, == and ≡ are equivalence (IFF).
Rows and columns follow Gray code (00, 01, 11, 10 …). Each cell shows its decimal minterm index.
How to solve a Karnaugh map
The solver follows the same core process used in a handwritten K-map solution.
Karnaugh Map Solver: guide and formulas
What is a Karnaugh map?
A Karnaugh map (K-map) is a visual method for simplifying Boolean expressions. It arranges truth-table outputs in Gray-code order so adjacent cells differ in one input variable. By grouping adjacent 1s, you can eliminate changing variables and derive a shorter sum-of-products expression.
How are K-map groups formed?
Valid groups contain a power-of-two number of cells: 1, 2, 4, 8, 16 or 32. Groups should be as large as possible, may overlap, and may wrap across the left/right or top/bottom edges. Every required 1 must be covered. A don't-care cell may be treated as either 0 or 1 when it helps simplify the function.
How do I get a term from a group?
Compare the binary values of the cells in a group. A variable that remains 1 appears uncomplemented; a variable that remains 0 appears complemented. A variable that changes is removed. For example, a group where A=1 and B changes produces the term A.
What are SOP and POS?
Sum of Products (SOP) groups the 1 cells and ORs the resulting product terms. Product of Sums (POS) groups the 0 cells and ANDs the resulting sum clauses. Both represent the same Boolean function and may have different visual groupings.
What are don't-care conditions?
Don't-care terms are input combinations for which the output is irrelevant or unspecified. They are marked X and can be included in a group if doing so reduces the number of literals or groups. They do not need to be covered.
Frequently asked questions
Karnaugh map and Boolean simplification help.
Can this solve any K-map?
It supports 2 to 6 variables and both SOP and POS minimization. It can start from a Boolean expression, minterms, maxterms and don't-care terms.
Does it show handwritten-style steps?
It shows the truth table, Gray-code map, candidate prime implicants, essential groups, any remaining coverage and the final expression. This is a structured digital version of the usual hand-solving workflow.
Can groups overlap or wrap around the edges?
Yes. K-map adjacency wraps at the map edges, and selected groups may overlap when needed to cover all required cells.
Why can the final answer differ from my grouping?
Boolean functions can have multiple equally minimal groupings. The displayed solution is one valid minimum-cost cover; another correct handwritten solution may use different groups but produce an equivalent expression.
Is the K-map solver free?
Yes. It runs in your browser without an account. Your Boolean expression is not sent to a server.