Karnaugh Map Minimizer illustration

Karnaugh Map Minimizer

Enter a boolean function of 2 to 5 variables — click truth-table rows, toggle cells directly on the Karnaugh map, or paste a minterm list — and the tool computes the minimal sum-of-products using the Quine–McCluskey algorithm with full don't-care support, then picks a guaranteed minimal cover with Petrick's method. Each chosen group is drawn on the map as a colored outline, including the wrap-around groups that make K-maps confusing on paper, and essential prime implicants are called out separately. A product-of-sums view minimizes the zeros instead, and a literal/gate count shows what the simplification saves in actual hardware.

Runs 100% in your browser — nothing you paste leaves your device.

Notes

  • The map axes use Gray code ordering (00 01 11 10) so that any two adjacent cells — including edges that wrap around — differ in exactly one variable. That is the whole trick: adjacent 1s can merge.
  • Don't-care cells (X) are free wildcards: the minimizer uses them as 1s when that grows a group, and ignores them otherwise. They come from input combinations that can never occur, like BCD codes 10-15.
  • Essential prime implicants cover at least one minterm no other prime implicant covers, so every minimal solution must contain them. Petrick's method handles whatever they leave uncovered.
  • Groups must be power-of-two sized rectangles (1, 2, 4, 8, 16 cells): each doubling eliminates one variable from the term.
  • Runs 100% in your browser — nothing you paste leaves your device.