0

Sudoku Generator

Generate a fresh, playable Sudoku puzzle with a real backtracking solver that verifies every puzzle has exactly one solution.

Difficulty is set by clue count: Easy ~36–40 given digits, Medium ~30–35, Hard ~24–29. Every puzzle is verified to have exactly one solution.

Buy Me a Coffee at ko-fi.com
Processing... 0%
Building solution grid
Removing clues
Verifying uniqueness

Result

A puzzle that just blanks out random cells from a finished Sudoku grid is not a real Sudoku puzzle — it can easily end up with more than one valid way to fill it in, which is not how the game is supposed to work. This generator avoids that shortcut. It first builds a complete, valid 9×9 grid using a genuine backtracking fill (the same technique used to solve Sudoku, run in reverse, with candidate order shuffled at every cell so the solution varies between generations). It then removes cells one at a time in random order, and after every single removal it runs a second backtracking solver that counts solutions and stops as soon as it finds two. If removing a cell would allow more than one solution, that cell goes back and a different one is tried instead.

Difficulty is set the honest way: by how many starting digits remain, which is the standard, widely used convention for grading Sudoku puzzles. Easy leaves roughly 36 to 40 clues, Medium roughly 30 to 35, and Hard roughly 24 to 29 — each generation picks a random target inside that band, so two 'Hard' puzzles from this tool are not identical. This tool does not claim to grade puzzles by which human solving technique (naked singles, hidden pairs, X-Wing, and so on) they require; clue count is a simpler, honest, and commonly used measure, and is what actually drives the difficulty here.

The puzzle renders as a real interactive grid: type digits directly into the blank cells (only 1–9 is accepted), then use "Check my answer" to highlight which entries are correct or wrong without giving away the solution, or "Reveal solution" to fill in the rest when you are done or stuck. The puzzle and its solution can each be downloaded as a separate PNG image or printed on their own page — everything, including the solving engine, runs locally in your browser with nothing ever uploaded.