Click cells to set 1, 0, or X (don't-care). The minimal sum-of-products (SOP) is computed live, with each prime implicant drawn as a loop on the map — wrap-around groups included. A free tool for boolean simplification and digital-logic minimization.
Need a refresher?A Karnaugh map is a visual aid for boolean simplification — it lays out a logic function so that cells that differ in exactly one variable sit next to each other, including across the top–bottom and left–right edges, which wrap. Any rectangle of 1s whose side lengths are powers of two is a valid implicant of the underlying sum-of-products, and the bigger the rectangle, the simpler the term.
Under the hood, this page runs Quine–McCluskey to enumerate every prime implicant, then Petrick's method to pick the smallest covering set when essentials don't carry the whole load. Don't-cares are folded in to grow groups when it helps, and dropped when it doesn't — the same logic minimization a digital-design textbook walks you through by hand.
Watch the corners-and-center pattern collapse into two terms. Same problem you'd see in a digital-logic homework set — same answer, in two seconds.
A Karnaugh map (or K-map) is a graphical method for simplifying a boolean function. Cells are arranged so that adjacent cells differ in exactly one variable, which means any rectangular group of 1s whose side lengths are powers of two represents a simpler boolean term. K-maps are the standard visual technique taught in digital-design and discrete-math courses for minimizing logic expressions of up to five or six variables.
Row and column labels use Gray code order — 00, 01, 11, 10 — so neighboring rows and columns differ in only one bit. For a 4-variable map, rows encode AB and columns encode CD; each cell shows its minterm index in the corner. Click a cell to cycle through 0, 1, and X (don't-care).
A don't-care is an input combination whose output you don't care about — usually because the combination can't occur in the real circuit, or because downstream logic handles either result the same way. The solver is free to treat each X as a 0 or a 1, whichever makes the resulting groups bigger. Don't-cares often dramatically shrink the final expression.
Because the leftmost and rightmost columns differ in exactly one variable, and so do the top and bottom rows. That means cells on opposite edges are adjacent in the boolean sense, even though they aren't visually next to each other. A K-map is topologically a torus: the four corners can form a single quad, and the four cells in the first and last columns can form a 1×4 block.
With five variables you get 32 cells, which is too many for a single 4×4 grid. The solver shows two stacked 4×4 boards — one for E = 0, one for E = 1. Cells in the same position on each board are adjacent (they differ only in E), so a group can span both boards. The minimization algorithm handles cross-board adjacency automatically.
It isn't — the algorithm is the same. Quine–McCluskey tabulates the minterms, repeatedly combines adjacent ones into prime implicants, and then selects a minimal cover (using Petrick's method when essentials alone can't cover everything).
We built this solver because we built a game on the same math. wrap is a two-player puzzle where the edges of the board connect — quad of four wins.