How a Kakuro Solver Reasons

Read this to understand how a kakuro puzzle is solved by pure logic: how a sum and a run length pin down a small set of digit combinations, how the across and down runs sharing a cell narrow each other, and how to read the technique log the solver prints.

What kakuro is, with one hook example

Kakuro (also called cross sums) is a grid of black and white cells. White cells hold digits from 1 to 9. Black cells carry clues: a number in the upper right is the sum of the white run to its right, and a number in the lower left is the sum of the white run below it. Inside any single run, no digit repeats.

Here is the whole game in one clue. Suppose a black cell shows an across sum of 16 and the run to its right is exactly two cells long. The two digits must be distinct, from 1 to 9, and add to 16. The only unordered pair that works is 7 and 9. So before you look at anything else, those two cells are limited to \{7, 9\}. That single fact, repeated and combined across the grid, is most of kakuro.

The solver at /games/kakuro-solver/ makes that reasoning explicit. Every time it fills or trims a cell, it names the clue and the rule that justified the move.

When to reach for the solver, and when not

Use the solver when you want to check that a puzzle you built has exactly one solution, when you are stuck and want the next logical step named rather than the full answer dumped on you, or when you are teaching and need a clean record of which technique cracked which clue.

Do not use it as a substitute for learning the combinations. The value of kakuro comes from recognizing that 3 in two cells is always 1+2, or that 45 in nine cells is the full set 1 through 9. If you let the solver do every step, you never build that memory. Run it after you attempt a section, then compare its log to your own reasoning.

The compact text format lets you type a puzzle fast. One line per row, cells separated by spaces: # is a plain black cell, . is a white cell, and 17\24 is a black cell with across clue 17 and down clue 24. Leave either side of the backslash empty when only one direction has a run.

The combination formula and why it works

A run is defined by two numbers: its length n (how many white cells) and its target sum S. Because the digits are distinct and drawn from 1 to 9, the count of valid digit sets is a bounded combinatorial problem. The number of white cells fixes the smallest and largest sums a run can hold.

S_{\min} = \frac{n(n+1)}{2}, \quad S_{\max} = \frac{n(19-n)}{2}

Here n is the run length, S_{\min} is the smallest reachable sum (using the lowest digits 1, 2, up to n), and S_{\max} is the largest (using the highest digits). For n = 2, that gives S_{\min} = 3 and S_{\max} = 17. Any two-cell clue outside the range 3 to 17 is impossible, and the solver rejects it.

The most useful clues are the ones with a unique combination: exactly one set of digits fits. These are the anchors. In two cells, 3 (1+2), 4 (1+3), 16 (7+9) and 17 (8+9) are unique. In three cells, 6 (1+2+3), 7 (1+2+4), 23 (6+8+9) and 24 (7+8+9) are unique. The table below lists the extreme sums for each length.

Minimum and maximum sums by run length
Length nMin sumMax sumUnique low sumUnique high sum
23173, 416, 17
36246, 723, 24
4103010, 1129, 30
5153515, 1634, 35

Cross-reference: how two runs trim each other

Every white cell sits in one across run and one down run. Its digit must be legal in both. So the candidate set for a cell is the intersection of the digits allowed by its across run and the digits allowed by its down run.

Take a cell where the across run is 16 in two cells, so its candidates from across are \{7, 9\}. Suppose the same cell's down run is 4 in two cells, whose combination is 1+3, giving candidates \{1, 3\}. The intersection of \{7, 9\} and \{1, 3\} is empty. That means the puzzle is contradictory at that cell, and the solver reports it. When the intersection has exactly one member, the cell is solved on the spot.

Pick a run length from 2 to 5 and a sum inside its legal range. The panel lists every distinct-digit combination that reaches the sum, along with the digits that appear in all of them (locked digits) and the digits that appear in none (excluded digits). For length 2 and sum 16, the only combination is 7+9, so both 7 and 9 are locked.

A worked example using the demo puzzle

Solving the corner of the default grid

Load the tool's demo (it uses the built-in field defaults). Focus on a corner where a two-cell across run summing to 16 crosses a two-cell down run summing to 17 at the top-left white cell.

  1. The across run 16 in two cells is a unique combination: 7+9. Both cells get candidates \{7, 9\}.
  2. The down run 17 in two cells is also unique: 8+9. Both cells get candidates \{8, 9\}.
  3. The shared corner cell must satisfy both runs. Intersect \{7, 9\} with \{8, 9\}. Only 9 survives, so the corner is 9. The solver logs this as a cross-reference intersection.
  4. Propagate. The other across cell must be 16 - 9 = 7. The other down cell must be 17 - 9 = 8. Two more cells solved, each logged against its clue.

Three cells are now fixed from two unique clues and one intersection, with no guessing. That is the pattern the solver repeats across the grid.

Reading the technique log

The log lists moves in the order the solver made them, and it distinguishes several techniques. Learn to tell them apart:

Unique sum combination
A run's length and sum allow only one digit set, so every cell in that run is limited to those digits at once. Example: "17 across in two cells must be 8+9."
Cross-reference intersection
A cell's across candidates and down candidates share only one digit, which becomes the answer. This is the workhorse move.
Naked single
Inside one run, a cell already has just one candidate left after eliminations, so it is filled.
Hidden single
Inside one run, some digit can go in only one of the run's cells even though that cell still shows several candidates. That digit is placed.
Uniqueness elimination
Once a digit is placed in a run, the no-repeat rule removes it from every other cell of the same run.

Backtracking (trial and error) appears in the log only when pure logic stalls. It is labeled as such. If you see it, the puzzle either needs a technique beyond the implemented set or has more than one solution. A clean puzzle should solve with no backtracking entries.

Common mistakes when building and reading puzzles

The errors below account for most rejected or multi-solution puzzles.

  • Sum outside the legal range. A two-cell run summing to 2 or 18 is impossible; the minimum is 3 and the maximum is 17. The solver rejects it rather than guess your intent.
  • A run with no clue. Every white run needs a sum clue on its black cell. A run left blank has no constraint, which usually creates many solutions.
  • Contradictory intersections. Two clues can each be valid alone yet share no digit at the cell where they cross, as in the earlier 16-across and 4-down example. That yields an empty candidate set.
  • Under-constrained grids. If the solver warns of several solutions, add or tighten a clue. It still shows one valid grid so you can see where the ambiguity sits.

A quick self-check: count your white cells and the total of all across clues. Those two totals must be equal, because every white cell belongs to exactly one across run and the across clues cover every white cell once. The same holds for the down clues.

How many combinations each sum has

The chart shows, for two-cell runs, how many valid digit pairs each sum admits. The count peaks in the middle and falls to exactly one at the extremes. Those single-count sums (3, 4, 16, 17) are your anchors.

Sums 3, 4, 16 and 17 each have exactly one pair, so they pin their cells hardest. Sums 10 and 11 each allow four pairs and give the least information.

To read a value: sum 7 shows 3 pairs (1+6, 2+5, 3+4). Sum 10 shows 4 pairs (1+9, 2+8, 3+7, 4+6); note 5+5 is not allowed because digits cannot repeat. This is why an experienced solver hunts for the 3s, 4s, 16s and 17s first.

Related solvers on this site

The same "name the technique for every move" approach appears in two neighboring tools. If you like kakuro for its digit logic, the Sudoku solver uses naked and hidden singles in the same sense, applied to rows, columns and boxes. If you prefer deducing cells from run-length clues, the Nonogram solver reasons line by line and explains each filled or crossed cell.

Frequently asked questions

Can a kakuro cell be 0 or larger than 9?

No. Every white cell holds a single digit from 1 to 9. Zero is never used, and no digit repeats within one run.

Why does the solver say my puzzle has several solutions?

Your clues do not force a single answer. Somewhere a run or intersection allows two or more consistent fillings. The solver shows one valid grid and warns you, so you can add a clue to remove the ambiguity.

What does it mean when a move is labeled trial and error?

The implemented logic techniques ran out of forced moves, so the solver assumed a candidate and tested it. A well-formed puzzle from a good source usually solves without any such labels.

Do the clue sums include the black cell?

No. A clue is the sum of the white cells in its run only. The black cell carries the number but is not counted in it.

Does anything I type get uploaded?

No. The solver runs entirely in your browser, so your puzzles and words stay on your device.