Karnaugh Map Calculator

A Karnaugh map, or K-map, is a visual method for simplifying Boolean expressions by arranging the outputs of a truth table in a grid so that adjacent cells differ in only one variable. Grouping the cells that are 1 lets you read off a simpler expression than the raw sum of minterms, which means fewer logic gates in hardware. This calculator handles the two-variable case, with inputs A and B, where the map is a small two-by-two grid covering the four input combinations 00, 01, 10 and 11. You enter the desired output, 1 or 0, for each of the four rows, and the calculator finds the minimized sum-of-products expression. It does this by checking the standard simplification patterns: an all-ones map reduces to 1, an all-zeros map to 0, a whole row or column that is 1 reduces to a single literal such as A or NOT B, and otherwise it combines the remaining minterms. The result is the simplest equivalent expression for the function you entered. Every figure is computed deterministically from the four outputs you provide, never guessed, so the same map always gives the same minimized expression. The method and a worked example that reconciles to the calculator default appear in full below.

A two-variable K-map groups adjacent 1 cells to simplify the function. With the default outputs for AB = 00, 01, 10, 11 set to 0, 0, 1, 1, both 1 cells lie in the A = 1 column, so the function minimizes to A.

Source: US National Institute of Standards and Technology (NIST). As at 25 June 2026.

Number of 1 cells--
Minimized expression--

Formula

Two-variable map cells: (A=0,B=0), (A=0,B=1), (A=1,B=0), (A=1,B=1)
A full column of 1s in A reduces to A; in NOT A reduces to NOT A
A full row of 1s reduces to B or NOT B; group adjacent 1s to simplify

The four outputs are placed on the map. The calculator checks for an all-ones map (1), an all-zeros map (0), a complete A, NOT A, B or NOT B group, and otherwise builds the sum of the remaining minterms, giving the simplest sum-of-products form.

Worked example

Minimize the function whose outputs for AB = 00, 01, 10, 11 are 0, 0, 1, 1.

  1. The two 1 cells are at A=1,B=0 and A=1,B=1
  2. Both lie in the column where A = 1, regardless of B
  3. Grouping them, B drops out and the function is just A
  4. Minimized expression: A

These are the calculator's default outputs, so the minimized expression A matches the widget exactly.

Karnaugh Map Calculator: frequently asked questions

What is a Karnaugh map?

A Karnaugh map is a grid arrangement of a truth table where adjacent cells differ in only one variable. Grouping adjacent 1 cells lets you simplify a Boolean function by eliminating variables.

How many cells does a two-variable map have?

Four, one for each combination of the two inputs A and B: 00, 01, 10 and 11. The outputs you place in these cells define the function.

Why does a full column reduce to a single variable?

If every cell in the A = 1 column is 1, the output is 1 whenever A is 1 regardless of B, so B drops out and the expression is just A.

What happens if all cells are 1 or all are 0?

An all-ones map reduces to the constant 1 and an all-zeros map to the constant 0, since the output never depends on the inputs.

Is the result the simplest form?

For two variables, yes. The calculator returns the minimal sum-of-products expression, which uses the fewest literals for the function you entered.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.