Skip to content
Puzzle

Online sudoku: 5 levels, live generator, persistent stats

Pick a level, start solving. Guaranteed unique solution: the generator removes cells only if the puzzle stays solvable in exactly one way. Timer, on-demand hints, pencil-mark mode, undo/redo, per-difficulty statistics saved in your browser.

Time 00:00
Errors 0
Progress 0/0
Streak 0
5 9
4 8
6 2
3
3 2 5 7 1
5
1 9 3 4
2
2
3 4 1
9
8
2 6
9
9
4 8 6
5 1

How sudoku works

  1. 1

    Each row contains 1-9 once

    The 9-cell horizontal row must contain each digit from 1 to 9, no repeats.

  2. 2

    Each column contains 1-9 once

    Same rule for the vertical 9-cell columns.

  3. 3

    Each 3x3 block contains 1-9 once

    The nine 3x3 sub-grids (delimited by thick borders) follow the same rule: each contains 1 through 9, no repeats.

  4. 4

    Start with the certainties

    Look for cells where only one digit is possible given row, column and box constraints. These 'naked singles' are the first step of every solver.

  5. 5

    Use pencil marks for ambiguous cells

    Press P (or the Pencil button) and type to add small candidate digits to the cell. When only one candidate survives the constraints, commit the digit.

Why this sudoku

Generator with unique solution. Every served puzzle has exactly one correct solution: the algorithm mathematically verifies this property at every cell removal, discarding attempts that would make the puzzle ambiguous. No multi-solution puzzles that frustrate players for no good reason.

Full game experience. Timer to measure yourself, on-demand hints when you're stuck (with time penalty, like in competitive sudoku), pencil-mark mode for multi-candidate cells, unlimited undo/redo, per-difficulty statistics saved in your browser. Works offline once loaded.

Five realistic levels. From Beginner (47 clues, great for learning) to Expert (25 clues, near the theoretical uniqueness limit of 17). Levels are calibrated against standard sudoku literature scales (Sudoku Explainer, NYT difficulty rating). Honest: we don't promise impossible difficulties the generator can't keep unique.

How the generator works

Two phases. Phase 1 (full board): backtracking with shuffled 1-9 digits produces a complete valid 9x9 board in under a millisecond. Phase 2 (puzzle): shuffle the 81 cells, then for each cell try the removal and call a solver with Minimum Remaining Values (MRV) heuristic. If the solver finds more than one solution, restore the cell. Result: every puzzle has a mathematically guaranteed unique solution.

The Expert target (56 holes out of 81 cells) lands at roughly 25 clues remaining, near the practical limit of greedy removal. The theoretical minimum for uniqueness is 17 clues, but reaching it requires exhaustive search with symmetries, out of scope for a real-time generator.

Frequently asked questions

What happens if I close the page mid-puzzle?
The puzzle in progress is saved in your browser localStorage: when you reopen, you resume exactly where you left off, with the timer paused during your absence. No account needed, all stays local.
How does pencil mode work?
Press P or the Pencil button. In pencil mode, typing 1-9 adds or removes the digit as a small candidate in the cell (shown in 3x3 grid). When you commit a definitive digit, pencil marks are cleared in the cell, and that digit is also removed from the pencil marks of peer cells (row, column, box).
Why does the hint have a time penalty?
For consistency with competitive sudoku: the final time reflects real solving effort, and using assists has a cost. Penalty is 60 seconds per hint (cell revealed) and 30 seconds per check request.
What does the streak mean?
It counts puzzles solved consecutively without interruption. It breaks if you start a new puzzle without finishing the current one. Max historical streak stays saved even after a break.
Are statistics tracked per level?
Yes. The Stats modal shows played, completed, completion rate, best time and average time for each of the 5 difficulty levels. Useful to track yourself across similar levels over time.
Are puzzles different every time?
Yes. The generator starts from a random solved board on every request, then removes cells in random order. The pool of valid sudoku grids is about 6.67 × 10²¹: in practice you'll never see the same puzzle twice.
Can I print them?
Yes. The print stylesheet hides toolbar, statistics and buttons, keeping just the grid. Use Ctrl+P from your browser. For multiple puzzles per sheet, generate a new puzzle after printing the first.
Does it work offline?
Yes, once the page has loaded. The puzzle generator runs directly in the browser, and statistics and puzzles stay saved in the local localStorage, accessible without a connection.
How do I navigate the grid with keyboard?
Arrows to move between cells. Type 1-9 to fill. Backspace or Delete to clear. P to toggle pencil. Ctrl+Z to undo, Ctrl+Y or Ctrl+Shift+Z to redo. Esc to close modals.
Can I reset the statistics?
Yes. The Stats modal has a Reset statistics button at the bottom. Confirm and all counters (played, completed, best time, streak) reset to zero.

Interested in algorithms and backend performance?

The MRV solver on this sudoku is a didactic application of constraint propagation. In real consulting work I tackle similar problems: SQL queries with cardinality estimation, cache invalidation, scheduling with multiple constraints. If you have a concrete algorithmic problem in your PHP, Laravel or Symfony backend and want a senior opinion, let's talk.

Let's talk backend performance