Karnaugh Map Solver
Simplify a Boolean function with a Karnaugh map. Pick 2, 3 or 4 variables, enter the minterms and any don’t cares, and get the minimal sum-of-products expression — worked out in your browser, nothing is sent anywhere.
Your function
Example loaded: f(A, B, C, D) = Σm(0, 2, 5, 7, 8, 10, 13, 15). Press Simplify to see the answer.
Simplified expression
Karnaugh map
Prime implicants used
Worked Example
Take f(A, B, C, D) = Σm(0, 2, 5, 7, 8, 10, 13, 15). The minterms where B and D are both 0 are 0, 2, 8 and 10, so they group into B'D'. The minterms where B and D are both 1 are 5, 7, 13 and 15, so they group into BD. Every minterm is covered, and no single literal covers them all, so the minimal sum of products is B'D' + BD.
Common Mistakes
Forgetting that the map wraps around. The left and right edges of a Karnaugh map are adjacent, and so are the top and bottom edges. The four corners form one group of four, even though they look far apart on the page.
Grouping 1s that are not adjacent. A group must be a rectangle of 1, 2, 4 or 8 cells that differ in exactly one variable at a time. Two 1s on a diagonal are not a group — they share no variable in common.
Leaving a minterm uncovered. Every minterm must sit inside at least one chosen group. Check the map after simplifying: each 1 should be inside a group, and every group should be a prime implicant.
Treating don't cares as minterms. A don't care (X) can be used to make a group bigger, but it never has to be covered. Using one is optional — it only helps if it removes a literal from the answer.
Related Tools
Try the Algebra Calculator for step-by-step equation solving, check a value with the Percentage Calculator, or browse every tool in the Tools hub.
Frequently Asked Questions
What is a Karnaugh map?
A Karnaugh map is a grid that lays out every combination of the input variables so that neighbouring cells differ in only one variable. Groups of 1s on the map show which variables can be dropped, giving the simplest Boolean expression.
What are minterms?
A minterm is one input combination where the function is 1. Writing Σm(0, 2, 5, 7) means the function is 1 for the binary combinations 0000, 0010, 0101 and 0111, and 0 everywhere else (unless a don't care says otherwise).
What is a don't care?
A don't care is an input combination whose output does not matter — it will never happen, or nobody cares what it is. The solver may treat it as 1 or 0, whichever makes the expression simpler.
What does the prime (') mean?
A' means NOT A — the variable is 0. So B'D' means B is 0 and D is 0, while BD means B is 1 and D is 1. The plus sign (+) means OR.
How many variables can I use?
Two, three or four. A 2-variable map has 4 cells, a 3-variable map has 8, and a 4-variable map has 16. Five or more variables need a different method, such as Quine-McCluskey by hand or a computer algebra tool.