How to Make a Sudoku Puzzle - Building One by Hand with a Unique Solution
The most reliable way to make a Sudoku puzzle by hand is to start from a finished grid, remove digits two cells at a time, and re-solve the puzzle yourself after every removal. When you can no longer finish it, you put the last two cells back. This article walks through the process on a 4x4 grid first, then follows one 9x9 example from a full grid down to a 28-clue puzzle, and closes with a checklist for confirming a unique solution.
Remove, then re-solve
If you try to build a Sudoku by writing digits onto an empty grid, you will almost always get stuck. Digits placed early contradict each other later, or the grid ends up with many possible answers. The order that works by hand is the reverse one. First make a completed grid with all 81 cells filled, then take digits away. After each removal, look only at the remaining clues and solve the puzzle again from scratch, without guessing. If you can finish, leave the cells empty; if you get stuck, put back the cells you just removed. The strength of this method is that the finished puzzle is guaranteed to have a unique solution. Solving it without guessing means every cell was forced, because only one digit could go there, so no second answer can slip in. The flip side is that a single trial placement during the re-solve breaks that guarantee. The sections below run through the method on a 4x4 grid and then move on to 9x9.
A full loop on a 4x4 grid
A 4x4 Sudoku places the digits 1 to 4 once in every row, every column and every 2x2 box. There are only 288 completed 4x4 grids, and a puzzle takes a few minutes to make, which makes it ideal practice. Write 1 2 3 4 in the first row, shift it by two to get 3 4 1 2 in the second row, and for the third and fourth rows split each row above into two pairs and swap the two digits within each pair (1 2 becomes 2 1) to get 2 1 4 3 and 4 3 2 1. That is a completed grid. Next, remove cells in pairs that face each other across the center. The puzzle in the table keeps six clues; starting with row 1, column 4, which can only be 4, every cell falls into place one at a time. The table also shows a failed attempt with two more clues removed. Those four clues contain only 2 and 3, so swapping every 1 and 4 in the empty cells gives a second valid answer. On a 4x4 grid, three clues are never enough: checking every set of three cells across all 288 completed grids found no set that gives a unique solution.
| Row | Completed grid | Puzzle with 6 clues | Failed attempt with 4 |
|---|---|---|---|
| Row 1 | 1 2 3 4 | □ 2 □ □ | □ 2 □ □ |
| Row 2 | 3 4 1 2 | 3 □ 1 □ | 3 □ □ □ |
| Row 3 | 2 1 4 3 | □ 1 □ 3 | □ □ □ 3 |
| Row 4 | 4 3 2 1 | □ □ 2 □ | □ □ 2 □ |
In the six-clue puzzle, row 1, column 4 is 4, then row 1, column 1 is 1 and row 1, column 3 is 3, and the rest follows from cells with a single candidate. The four-clue attempt has no 1 or 4 among its clues, so the grid with every 1 and 4 swapped also satisfies the rules.
Making a 9x9 completed grid by hand
Filling an empty 9x9 grid by trial and error is slow. A faster route is to write one regular pattern and then scramble it with moves that never break the rules. For the pattern, put 1 to 9 in the first row, shift it by three for the second row (4 5 6 7 8 9 1 2 3), and by three again for the third row (7 8 9 1 2 3 4 5 6). Rows 4 to 6 repeat rows 1 to 3 shifted by one, and rows 7 to 9 shift by one more. Every row, column and box now holds 1 to 9 exactly once. The pattern is far too obvious, though, so three kinds of shuffle follow. The first relabels the digits, for example turning every 1 into 5, every 2 into 3 and every 3 into 8, across all nine digits at once. The second swaps rows within the same band of three rows. The third swaps columns within the same stack of three columns. Each move only reorders the contents of rows, columns or boxes, so the grid stays valid. The grid below was built by applying the three moves in turn. The one thing to avoid is moving a row into a different band, which changes what each box contains and breaks the grid.
- Rows 2 and 3, swapped within their band
Digits were relabelled 1 to 5, 2 to 3, 3 to 8, 4 to 1, 5 to 9, 6 to 2, 7 to 6, 8 to 4 and 9 to 7. Rows 2 and 3, 4 and 6, and 7 and 8 were swapped, as were columns 1 and 3, 5 and 6, and 7 and 9.
Removing two cells and re-solving
With the completed grid ready, remove cells in pairs that sit opposite each other across the center cell (row 5, column 5): row 1, column 1 with row 9, column 9; row 2, column 6 with row 8, column 4; and so on. The clues then form a 180-degree symmetric pattern, which gives the puzzle a tidy look. Symmetry is optional, but working in pairs also halves the number of attempts. Counting the center cell on its own, there are 41 such groups; fix an order and try each one once. After every removal, solve again from the clues alone. Reusing the pencil marks from the previous re-solve hides the effect of the cells you just removed. The table lists part of the actual record for this example. The first 20 groups could all be removed, and the solver first got stuck at the group that would leave 40 clues. That group went back, the next one was tried, and after all 41 groups the puzzle had 28 clues. The solution counts in the table come from a small checking program written for this article. When you make a puzzle by hand you will not know the count, and you do not need to: the rule is simply to put cells back whenever you get stuck.
| Cells removed | Clues left | Re-solving by hand | Solutions | Decision |
|---|---|---|---|---|
| r2c6 and r8c4 | 79 | Finishes | 1 | Remove |
| r5c5 (center) | 74 | Finishes | 1 | Remove |
| r4c6 and r6c4 | 42 | Finishes | 1 | Remove |
| r3c1 and r7c9 | 40 | Gets stuck | 2 | Put back |
| r2c9 and r8c1 | 40 | Finishes | 1 | Remove |
| r4c5 and r6c5 | 30 | Gets stuck | 2 | Put back |
| r5c2 and r5c8 | 28 | Gets stuck | 1 | Put back |
| r1c7 and r9c3 | 28 | Finishes | 1 | Remove |
rXcY means row X, column Y. The re-solve used only two techniques: filling a cell that has one candidate, and filling the only place a digit can go in a row, column or box. The r5c2 and r5c8 pair still left one solution, but those two techniques stalled, so it went back.
Which cell to put back when two solutions appear
The group that stalled at 40 clues shows how a second solution arises. With row 3, column 1 and row 7, column 9 removed, six cells (r7c3, r7c9, r8c3, r8c4, r9c4 and r9c9) held only 2s and 8s in an alternating arrangement. Every row, column and box among them contains exactly two of the six, so swapping all the 2s and 8s keeps the grid valid. When all six cells are empty, nothing else on the grid decides which arrangement is right. This is the classic shape behind a second solution. The fix is to keep at least one cell of such a swappable set as a clue. In this example, putting the 8 back in row 7, column 9 fixes the arrangement of 2s and 8s. When you get stuck while making a puzzle, look near the place where you stalled for a set of cells where two digits could trade places; it usually points to the cell to restore. The smallest such set is four cells where two rows meet two columns, the same shape the unique rectangle technique looks for.
- Empty cells where 2 and 8 could swap
- Clue put back (8)
Without the 8 in row 7, column 9, the grid with 2 and 8 swapped across the five shaded cells and r7c9 would also be a solution. The puzzle can be solved to the end using only single-candidate cells and the only place a digit can go.
A checklist for a unique solution
Before handing a puzzle to someone else, run through the checks below in order. The first one is the decisive test: if the re-solve finishes without guessing, a unique solution is guaranteed. The others are warning signs you can spot by eye before re-solving. If the clues use seven or fewer different digits, the two missing digits can be swapped throughout any solution, so the puzzle cannot be unique. For the same reason, an empty swappable set of four cells means two or more solutions. There is also a lower limit on clues: a computer search published in 2012 showed that no 9x9 puzzle with 16 or fewer clues has a unique solution. Having 17 or more does not make a puzzle unique, so the clue count only ever rules puzzles out. Finally, check for copying mistakes. A single wrong digit when copying from the completed grid means you hand out a different puzzle from the one you re-solved.
| Check | What to look at | If it fails |
|---|---|---|
| Can it be finished without guessing? | Re-solve from the clues alone and fill every cell without a single trial placement | Put back the last pair removed |
| Do the clues use at least 8 digits? | No two of the digits 1 to 9 are missing from the clues | Restore a cell holding one of the missing digits |
| Is any swappable rectangle empty? | Four cells where two rows meet two columns, spread over two boxes, holding two digits in alternation | Put back one of the four cells |
| Are there at least 17 clues? | With 16 or fewer, the solution cannot be unique | Put back a removed pair |
| Does it match the completed grid? | Compare every clue on the puzzle sheet with the completed grid | Copy it again from the completed grid |
Difficulty comes from the re-solve rules
How hard a hand-made puzzle is depends less on the number of clues than on which techniques you allow yourself during the re-solve. In this example the re-solve used only single-candidate cells and the only place a digit can go, so the finished puzzle is an easy one that those two techniques can solve. The r5c2 and r5c8 pair kept a unique solution but stalled those techniques, so it went back. Had naked pairs or pointing pairs been allowed, that pair might have stayed out, and the puzzle would have been harder. To make a harder puzzle, decide the techniques first and arrange the removal order so that at least one spot cannot be passed without them. For a child or a first-time solver, restrict the re-solve to the single easiest technique. The clue count is a result, not a goal. Chasing fewer clues for their own sake tends to push you into trial placements during the re-solve.
Common mistakes and how to spot them
The first mistake is placing a digit during the re-solve because it is probably right. Even if the grid fills up, you may simply have copied the answer from memory, which proves nothing about uniqueness. Makers know the answer, so this one is hard to notice; keep the completed grid face down while re-solving. The second is resuming the re-solve from where you left off. With the old pencil marks still in place, the removed digits linger in your head and you believe cells are forced when they are not. Always start from a grid holding nothing but the clues. The third is breaking the completed grid by swapping rows across bands or columns across stacks. Count 1 to 9 in each of the nine boxes after every swap and the error shows up. The fourth is building a puzzle by adding clues while solving, without checking along the way. That method also works, but unless you re-solve after each addition, a contradiction can surface much later and force a long backtrack.
Going further with your puzzle
If you are unsure about a puzzle you made, the best test is to let someone else solve it. You already know the answer, so whether a fresh solver can finish without guessing checks both uniqueness and difficulty at once. To read more about how two solutions arise, the article on the unique rectangle covers the shape where swapping two digits splits the answer. The mathematical side, such as the minimum number of clues and the total number of completed grids, is covered in the article on Sudoku mathematics, and the meaning of symmetric clue layouts in the article on symmetry. In the glossary, the entries for unique solution, given cell and symmetric puzzle define the terms used here.