GenerateRandomSearch

KenKen Generator

A Latin square divided into cages, each with a target and an operator. Where Sudoku gives you fixed digits, this gives you arithmetic: a cage marked 12× holds cells that multiply to twelve, and working out which cells hold what is the puzzle. Every grid here is solved exhaustively before you see it, and any layout with a second answer is thrown away rather than shipped.

What this generator does

Builds a random Latin square, divides it into contiguous cages of one to three cells, derives each cage's target from the values it covers, and then solves the result exhaustively. A layout with more than one solution is discarded and another tried.

How to use this tool

  1. Choose the grid size — four and five are the usual sizes.
  2. Fill each row and column with 1 to the grid size, once each.
  3. Make every cage reach its target using the operator shown.
  4. Reveal the answer to check, or seed the puzzle to print the same one twice.

Understanding the controls

Grid size
Between 3 and 8. Eight is the ceiling because the exhaustive solve reaches two and a half seconds at nine, and grows factorially from there.
Seed
Any word reproduces exactly the same puzzle, which is what makes a printed set or a shared challenge possible.
Show the answer
Reveals the completed Latin square that every cage was derived from.

Common use cases

  • Arithmetic practice that is a puzzle rather than a worksheet
  • A Sudoku alternative where the constraint is a calculation
  • Printable puzzles for a class, all from one seed
  • Building up from three-by-three to something genuinely difficult
  • Testing a solver against grids with a guaranteed single answer

How this generator works

The solver fills cells one at a time, rejecting any value already used in that row or column, and testing each cage as soon as its last cell is filled. It stops as soon as it finds a second solution, which is all that is needed to reject a layout. Single-cell cages are simply given values, and two-cell cages may use subtraction or division, which ignore the order of the pair.

Randomness and fairness

The square, the cage shapes and the operators are random; the single answer is proved, not assumed. Seeded puzzles reproduce exactly and are therefore explicitly not cryptographically secure. Without a seed the browser's cryptographically secure generator is used.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Cages hold at most three cells, so the very large cages some published puzzles use do not appear.
  • Difficulty is not graded — a puzzle with one answer is not necessarily a gentle one.
  • Eight by eight is the ceiling, set by how long the uniqueness proof takes rather than by the puzzle itself.
  • The grid is drawn with cage targets in the corner rather than with the heavy cage outlines a printed puzzle uses.
  • Puzzles are not stored between visits, so seed anything you want to print.

Privacy and your data

Puzzles are generated and solved entirely in your browser. No seed, puzzle or solution is transmitted or kept between visits.