Sudoku Generator
Pick a difficulty and get a fresh 9×9 sudoku with exactly one solution. Play it on the page with notes and hints, or print it with an answer key. Free, no sign-up.
Needs locked candidates (pointing and claiming) as well.
Type a number from 1 to 999999 to get the same puzzle again.
Preparing a puzzle…
How to Use the Sudoku Generator
- 1. Choose a difficulty. Easy needs only singles; Expert needs an X-Wing or more. The line under the buttons says what each level asks of the solver.
- 2. Press New puzzle. Every puzzle has a six-digit puzzle number. Type a number into the box and press Make puzzle from this number to get the same puzzle again — handy for giving a whole class the same puzzle or for rebuilding an answer key later.
- 3. Play on the page. Select a square and type 1–9, or use the number pad. Switch on Notes to pencil in candidates, use Undo, and turn on Highlight mistakes if you want instant feedback. Hint fills the selected square with its correct digit.
- 4. Or print it. Print puzzle gives a clean grid; Print puzzle and answers adds a second page with the solution. The controls and this explanation are hidden when you print.
How the Puzzles Are Made and Checked
Each puzzle starts from a complete, valid grid built by randomised backtracking. The generator then removes givens one at a time (or in 180° pairs when Symmetric givens is on) and, after every removal, runs a solver that counts solutions and stops as soon as it finds a second one. A removal is kept only if the puzzle still has exactly one solution. So "unique" is something the page has proved for the puzzle in front of you, not an assumption.
The same number, difficulty and symmetry setting always rebuild the same puzzle, because the generator runs from a seeded random sequence rather than from the browser's unseeded random generator.
How Difficulty Is Rated
The number of givens is a poor guide to difficulty — plenty of 24-given puzzles fall to simple scanning, and some 30-given puzzles are brutal. This generator rates a puzzle the way a person would solve it. A rater works through the grid, always taking the easiest available step first, and records the hardest technique it was forced to use.
| Level | Hardest technique needed | What it means |
|---|---|---|
| Easy | Naked and hidden singles | A square has only one possible digit, or a digit has only one possible square in a row, column or box. |
| Medium | Locked candidates | A digit confined to one line within a box (pointing), or to one box within a line (claiming), clears that digit from the rest of the line or box. |
| Hard | Naked and hidden pairs and triples | Two or three squares in a unit share the same two or three candidates, so those digits can be removed from the unit's other squares. |
| Expert | X-Wing, or harder | A digit appears in exactly two squares of each of two rows and the squares line up in two columns, which removes it from the rest of those columns. |
Expert puzzles are searched for an X-Wing first. If none turns up, the page accepts a puzzle the rater cannot finish and says so — "rated beyond Expert" — because it may need chains or trial and error.
The rating appears under the grid in plain words (for example, Rated Hard — the hardest technique needed was naked pairs and triples). If the generator cannot land on the level you asked for within its attempt limit, it shows the puzzle it found with its true rating instead of mislabelling it.
Sudoku Facts Worth Knowing
- Origin. The modern puzzle appeared in 1979 as "Number Place" in Dell Magazines, credited to the American architect Howard Garns. The Japanese publisher Nikoli popularised it from 1984 under the name Sudoku.
- How many grids. There are 6,670,903,752,021,072,936,960 valid completed grids (Felgenhauer and Jarvis, 2005), so the supply of puzzles is not a worry.
- Fewest givens. A computer search by McGuire, Tugemann and Civario (2012) showed that no uniquely solvable sudoku has fewer than 17 givens. Puzzles from this generator usually have between 23 and 38, depending on difficulty.
Frequently Asked Questions
- How do I know a generated sudoku has only one solution?
- Because the generator checks it. After each given is removed, a backtracking solver searches for solutions and stops at two. If it ever finds a second one, the removal is undone. The finished puzzle is one the solver proved has exactly one solution, which is what makes it solvable by logic alone in the first place.
- How is the difficulty of a sudoku decided?
- By the hardest technique a human-style solver needs: singles for Easy, locked candidates for Medium, pairs and triples for Hard, and an X-Wing or beyond for Expert. The solver always tries the simplest technique first, so the rating is the hardest step it could not avoid — not a count of givens and not a guess.
- What is the minimum number of clues in a sudoku?
- Seventeen. A computer search published by McGuire, Tugemann and Civario in 2012 showed that no puzzle with 16 givens has a unique solution. Most printed puzzles have more, because 17-clue puzzles are very hard to solve by hand.
- Can I print the sudoku with the answers?
- Yes. Press Print puzzle and answers and the print preview contains the blank puzzle on page one and the solved grid on page two, with the givens in bold. Press Print puzzle for the grid alone. Your browser's print dialog lets you choose Letter or A4 paper.
- Is it cheating to guess in sudoku?
- A well-made sudoku never needs a guess; every step can be deduced. Easy, Medium and Hard puzzles here are solvable with the named techniques and no trial and error. A puzzle labelled "beyond Expert" is the exception — it needs more than the techniques this page can check, so trial and error may be the fastest route.
- Can I get the same puzzle again?
- Yes. Every puzzle shows a puzzle number. Enter that number, keep the same difficulty and symmetry setting, and press Make puzzle from this number. Teachers can note the number on a worksheet and rebuild the answer key later.
- Does this tool store or send my puzzles?
- No. Puzzles are generated and checked in your browser, and nothing is uploaded or saved. Closing or reloading the page clears your progress, so print or copy the puzzle first if you want to keep it.