A truth table defines a Boolean function completely, but the expression read directly from the table is usually far from the simplest one. Karnaugh maps are the classic tool for simplification: minterms are placed on a grid where neighbouring cells differ by one variable, groups of ones are circled, and each group becomes one product term in a minimal expression. Doing this by hand is a learned skill and mistakes are easy, especially with four variables where the grid wraps around its edges. This solver takes the variable count and the list of minterms and returns a minimal sum of products expression, computed by exact cover search over all valid groupings. The result is the simplest form to implement, using the fewest gates in a real circuit.
Quick Answer: Choose the variable count, enter the minterms as numbers separated by commas, and click Minimise to get the simplest expression.
Free Online Tool
Karnaugh Map Solver
Minimal sum of products from minterms, for 2 to 4 variables.
How to Use the Karnaugh Map Solver
- Choose how many variables your function has, from two to four.
- List the minterms, which are the input combinations where the function outputs one, as numbers separated by commas.
- Remember the numbering: with variables in order, the first variable is the most significant bit of each minterm number.
- Click Minimise to compute the minimal sum of products expression.
- Read the result as a sum of product terms, where a letter with an apostrophe means the negation of that variable.
Key Features
- Exact minimisation by search over all valid groupings, not a greedy approximation.
- Support for two, three and four variable functions, covering the standard Karnaugh map sizes.
- Constant results handled: a function true for all inputs minimises to one, and for none to zero.
- Product term notation with apostrophes for negated variables, matching textbook style.
- Clear input validation for out of range minterms and duplicate entries.
Best Practices and Tips
- Double check minterm numbering before minimising, since one wrong number changes the whole expression.
- Groups in a Karnaugh map must contain one, two, four or eight cells, which is why minimisation follows powers of two.
- A minimal expression is not always unique. Different groupings can give equally simple results, and any minimal form is correct.
- Verify the result by generating its truth table and comparing it with your original function.
Common Mistakes to Avoid
- Numbering minterms with the wrong variable order, which silently minimises a different function.
- Including minterms where the function is zero, which adds terms the function does not need.
- Forgetting that wrap around groups count in Karnaugh maps, so edge cells can group with each other.
Frequently Asked Questions
What is a minterm?
A minterm is one row of a truth table where the function outputs one, identified by the number formed by reading the input values as a binary number. With variables A and B, the row where A is zero and B is one is minterm one. Listing all such rows completely defines the function.
What does minimised mean here?
A minimised sum of products uses the fewest product terms, and among those, the fewest literals in total. Fewer terms and literals mean fewer gates when the function is built as a circuit, which is the practical payoff of simplification.
Why do groups use powers of two?
Grouping two cells that differ in one variable eliminates that variable from the term, grouping four eliminates two variables, and so on. Only power of two sized groups eliminate variables cleanly, which is why Karnaugh map groups are always one, two, four or eight cells.
Can this solver handle don’t care conditions?
This version minimises from minterms only, where every unspecified combination is treated as zero. Don’t care conditions can give even simpler results, but they need extra input, so they are left out to keep the tool’s input unambiguous.
