KenKen Solver - Free Online KenKen Calcudoku Puzzle Solver

What Is KenKen?

KenKen is an arithmetic logic puzzle invented in 2004 by Japanese math teacher Tetsuya Miyamoto - the name roughly means "cleverness squared". It is known internationally as Calcudoku or Mathdoku, and it has appeared in The New York Times since 2009. The puzzle is played on an N×N grid: every row and every column must contain the digits 1 to N exactly once, but instead of boxes there are cages - dotted groups of cells with a target and an operation (+, −, × or ÷) that the digits inside must satisfy.

KenKen is Sudoku's arithmetic cousin: you never guess, you combine Latin-square elimination with factor and sum arithmetic until the grid completes. This free KenKen solver accepts your givens and cage layout, solves the grid exhaustively, and reports whether the solution is unique.

KenKen Rules

  1. Rows and columns. Each row and each column contains every digit from 1 to N exactly once. There are no boxes.

  2. Cage targets. The digits in a cage must combine with the printed operation to give the target: + adds them, × multiplies them.

  3. Subtraction and division cages contain exactly two cells: subtract the smaller from the larger, or divide the larger by the smaller, to hit the target.

  4. Repeats are allowed inside a cage as long as they are not in the same row or column.

  5. Single-cell cages simply give away their digit.

How to Use the KenKen Solver

  1. Choose a grid size. Tap 4×4 up to 7×7.

  2. Enter the givens. Type any starting numbers into the grid.

  3. Enter the cages. In the Cages box write one cage per line: the cells in spreadsheet coordinates, a colon, then the operation and target. For example A1 A2: +6 means A1 and A2 add to 6; B4 C4: -2 is a two-cell difference of 2; A1: =5 gives A1 the value 5.

  4. Check the parse. Malformed lines, overlapping cages and out-of-range targets are flagged as you type.

  5. Press Solve. Empty cells fill in green and the status line reports whether the solution is unique.

  6. Reset or explore. Clear wipes everything; Example deals a random puzzle with a guaranteed unique solution.

What the Solver Tells You

When the puzzle is solvable, the grid completes in green and the solver reports whether the answer is unique. Below, a 5×5 puzzle with eight givens and twelve cages - including an A1 = 4 gift, a B1 C1 B2 B3 × 30 product cage and an A4 A3 − 1 difference cage - solves to a single grid:

KenKen solver completing a 5×5 puzzle with twelve arithmetic cages, solved cells in green

If the cages contradict each other or the givens collide, the solver says so directly:

KenKen solver flagging a cage target out of range

How the KenKen Solver Works

The engine is a backtracking search with minimum-remaining-values branching - the same skeleton as our killer sudoku solver, tuned for KenKen's four operations. For every empty cell it builds a candidate mask from the row and column bitmasks, then applies cage pruning:

  • Sum cages (+): the running total plus the target can no longer be reached - candidates that overshoot the target, or leave too little for the remaining cells (each contributes at least 1), are rejected.

  • Product cages (×): the running product must always divide the target evenly - any candidate that breaks divisibility is rejected, which prunes enormously.

  • Difference and division cages (−, ÷): two-cell cages are checked exactly as soon as both cells are known.

The search continues until it has found two solutions or the grid is exhausted, which is how the uniqueness verdict is produced. Everything runs in your browser; even a cage-only 6×6 puzzle with no givens resolves in about a millisecond.

Worked Example: A 5×5 KenKen

Here is the Example generator's 5×5 puzzle - eight single-cell gifts plus twelve arithmetic cages. The completed grid (bold = givens, green = solved) is:

45213
53421
21534
32145
14352

The cages make the logic concrete. B1 C1 B2 B3 × 30: four distinct-ish digits multiplying to 30 factors as 5 × 2 × 3 × 1 - and since B1 is given as 5, the cage is half-solved from the start. A4 A3 − 1 says those two column-A cells differ by exactly one, which with A1 = 4 and A2 = 5 given pins column A to 4, 5, 2, 3, 1. D4 E4 × 20 can only be 4 × 5 in a 5×5 grid, and once row 4 reads 3, 2, 1, 4, 5 the ∏-cage arithmetic cascades through the rest of the grid.

Tips for Solving KenKen

  • Harvest single-cell cages first. They are givens in disguise - place them and ripple the row/column eliminations.

  • Factor product targets. A × cage of 30 in a 5×5 grid can only contain digits from {1, 2, 3, 5, 6, 10...} that fit - listing factorisations of the target instantly bounds every cell in the cage.

  • Bound sum cages. A + cage with k cells holds at least 1+2+...+k minus repeats and at most N+(N-1)+... - extremes pin the digits.

  • Subtract from row totals. There is no 45 rule (no boxes), but a row whose cages cover all N cells totals N(N+1)/2 - the same trick works per row and column.

  • Two-cell − and ÷ cages are pairs. A − 3 cage in a 5×5 holds {1,4}, {2,5}, {3,6}...; cross out the pairs the column already used.

  • Remember repeats are legal. Unlike Killer Sudoku, a cage may contain the same digit twice when the cells are in different rows and columns - do not over-prune.

Is KenKen Good for Your Brain?

KenKen was designed as a teaching tool, and it shows: the puzzle drills mental arithmetic (addition, multiplication, division) inside a logic scaffold, and the cage arithmetic builds factoring fluency - instantly seeing that 30 = 5 × 3 × 2 × 1 - alongside systematic elimination. Miyamoto's stated goal was to make students think hard without realising they are drilling math, which is exactly what a daily KenKen does.

Frequently Asked Questions

What is KenKen?

A Japanese arithmetic logic puzzle: fill an N×N grid so every row and column contains 1 to N, while the digits inside each dotted cage combine with +, −, × or ÷ to the cage target. Also known as Calcudoku or Mathdoku.

Who invented KenKen?

Math teacher Tetsuya Miyamoto created it in 2004 as a hands-on teaching tool, and the puzzle appeared in The New York Times from 2009.

How is KenKen different from Killer Sudoku?

Killer Sudoku keeps the 3×3 boxes, forbids repeats inside cages and only uses addition. KenKen has no boxes, allows four operations (with two-cell − and ÷) and permits cage repeats when the cells are in different rows and columns.

Can digits repeat inside a KenKen cage?

Yes - as long as the repeated digits are not in the same row or column. Row and column rules always win.

How do subtraction and division cages work?

They contain exactly two cells. For − the target is the larger minus the smaller; for ÷ the target is the larger divided by the smaller, which must divide evenly.

Can a KenKen puzzle have multiple solutions?

Loose cage layouts can. Well-made puzzles are unique, and this solver tells you which case you are in.

What grid sizes does the solver support?

4×4, 5×5, 6×6 and 7×7 - the range most books and apps publish.

Is this KenKen solver free?

Completely free with no sign-up. Solving runs entirely in your browser after the page loads, so it even works offline.

More Logic Puzzles to Explore

Enjoy arithmetic grids? Try the Killer Sudoku Solver, warm up with the classic Sudoku Solver, or play our free Sudoku game.