Games & Chance

Sudoku solver and generator

Solve any grid, get explained hints, generate puzzles in 4 levels and print.

  • Instant
  • Free
  • Private (processed locally)
  • No sign-up
00:00
  • Givens
  • Your digits
  • Solver and hints

Keyboard: 1 to 9 to fill, 0 or Delete to erase, arrow keys to move, Ctrl+Z to undo, Ctrl+V on the grid to paste a sudoku.

ℹ️ Solver: constraint propagation with bitmasks and backtracking on the most constrained cell; difficulty is graded by the human techniques required. Your game is saved in this browser only. 100% local.

Solve any sudoku online, or generate a new one

This sudoku solver cracks any 9 × 9 puzzle in a fraction of a second: type or paste your grid, press “Solve”, and the missing digits appear in purple italics. It does more than give the answer: it outlines duplicates in red, tells you when a puzzle has no solution or more than one, and estimates its difficulty from the techniques a person would need to finish it.

Would you rather work it out yourself? “Hint” fills in a single cell and explains the deduction (“Box 4: the 7 can only go in row 5, column 2…”), correcting a wrong digit first if there is one. “Check” spots your mistakes without revealing anything else, and the sudoku generator creates fresh puzzles with a unique solution, from easy to expert, with a timer and printing. There are about 6.67 × 1021 different completed grids (Felgenhauer and Jarvis, 2005), so you will not run out any time soon.

  1. Enter your puzzle

    Press “Clear grid” (the tool switches to “Enter a puzzle” mode), click a cell and type its digits on the keyboard or with the number pad (arrow keys move the selection). You can also paste 81 characters into “Paste / import a puzzle”, with 0 or a dot for empty cells, then click “Load”, or press Ctrl+V directly on the grid.

  2. Solve it or ask for a nudge

    “Solve” fills the whole grid and reports its level; “Hint” places just one digit and explains why; “Check” outlines wrong digits. “Undo” (or Ctrl+Z) steps back at any time.

  3. Or play a new puzzle

    Choose the “Difficulty”, then “New puzzle”: the timer starts, pauses when you switch tabs (or with the pause button), and a message congratulates you when the grid is correct. “Show candidates” pencils in the digits still possible in every empty cell.

  4. Print or share

    “Print” opens a clean A4 page, with the solution on page 2 if you tick “Add the solution (page 2)”. “Copy as text” copies the starting grid as 81 characters (a dot for each empty cell), to send to a friend or paste back later.

The method: constraint propagation, backtracking and levels

Each cell stores its candidates as a 9-bit mask. Placing a digit instantly removes it from the 20 cells that “see” that cell (same row, same column, same box). The solver keeps applying naked and hidden singles; when they stop working, it picks the cell, or the unit-and-digit pair, with the fewest options, tries each one and backtracks at the first contradiction. It stops as soon as it has found two solutions, which is enough to prove that the solution is not unique.

The generator starts from a random completed grid, then removes digits two at a time, symmetrically around the centre as in newspapers, checking after each removal that the solution is still unique and that the target level still holds:

  • Easy: 38 to 45 givens, singles are enough.
  • Medium: 30 to 35 givens, still singles only, but fewer footholds to get started.
  • Hard: 26 to 29 givens targeted; at least one intermediate technique (locked candidates, pairs, triples or X-Wing) becomes essential.
  • Expert: 22 to 25 givens targeted; those techniques are no longer enough, and advanced reasoning or trial and error is needed.

Sudoku solving techniques, from simplest to most advanced

TechniqueHow it worksLevel in the tool
Naked singleA cell has only one candidate left: the other eight digits already appear in its row, column or box.Easy, medium
Hidden singleIn a row, column or box, a digit has only one possible cell left, even if that cell has other candidates.Easy, medium
Locked candidatesIn a box, a digit is only possible along one row (or column): remove it from the rest of that row. The reasoning also works the other way round.Hard
Naked pair and tripleTwo cells of the same unit accept only the same two digits: those digits are removed from the other cells of the unit (three cells and three digits for a triple).Hard
Hidden pair and tripleTwo digits can only go in the same two cells of a unit: every other candidate in those cells is eliminated.Hard
X-WingIn two rows, a digit is only possible in the same two columns: it forms a rectangle and is removed from the rest of those two columns.Hard

Expert is given when none of these techniques is enough: you then need deeper reasoning (Swordfish, XY-Wing, chains) or trial and error with backtracking, which is what the solver does.

What is a sudoku solver useful for?

  • Getting unstuck on a newspaper puzzle: enter it and ask for a “Hint” rather than the full solution, so you still have the pleasure of finishing it yourself.
  • Validating a puzzle before sharing it: in “Enter a puzzle” mode, “Check” tells you whether it has a unique solution and which level it requires, handy for a newsletter, a club or a classroom.
  • Printing fresh puzzles: one puzzle per page with the solution on page 2, for the classroom, a memory workshop in a care home or a long screen-free journey.
  • Learning the techniques: every hint explains its deduction, “Solve” names the techniques the puzzle requires, and the candidate view helps you spot pairs and locked candidates.
  • Competing with friends: send everyone the same puzzle with “Copy as text” and compare your times on the timer.

Common problems and fixes

  • “No solution” for a magazine puzzle: a digit has almost always been copied wrongly. Compare row by row; a duplicate shows in red, but a mistake can also make the grid impossible without any duplicate.
  • “More than one solution”: at least one given is missing. Below 17 givens, this is unavoidable.
  • A digit cannot be changed: in “Play” mode the givens are locked. Switch to “Enter a puzzle” mode to correct the puzzle itself.
  • Pasting does not work: exactly 81 cells are needed. Spaces, line breaks and | + - separators are ignored; use 0 or a dot for empty cells.
  • The game has disappeared: it is saved in this browser’s local storage; a private window or clearing the site’s data deletes it.

Everything happens in your browser: the grid, the calculations and your game in progress never leave your device, and the autosave stays in this browser’s local storage. Limits: classic 9 × 9 sudoku only (no Killer, Sudoku X or 16 × 16); explained hints cover singles, beyond that the tool gives the digit from the solution directly.

Frequently asked questions

How does this sudoku solver work?

Each cell keeps the list of digits still possible for it, stored as a 9-bit mask. The solver first places every forced digit (a cell with a single candidate, or a digit with only one place left in a row, column or box), then, if doubt remains, tries the options of the most constrained cell and backtracks at the first dead end. Even Arto Inkala’s famous puzzle is solved in a few milliseconds, and the solver also checks whether a second solution exists.

Why does it say my puzzle has no solution, or more than one?

No solution almost always means a typo: a single wrongly copied digit is enough to make a grid impossible, even without a visible duplicate. More than one solution means at least one given is missing, or the puzzle was badly designed. A puzzle from a reputable newspaper has exactly one solution, so re-read your entry cell by cell, then run the diagnosis again with “Check” in “Enter a puzzle” mode.

What is the minimum number of clues in a sudoku?

You need at least 17. In 2012, Gary McGuire, Bastian Tugemann and Gilles Civario proved with an exhaustive computer search that no 16-clue puzzle has a unique solution. Nearly 50,000 different 17-clue puzzles are known, but having 17 or more clues guarantees nothing: it is where they are placed that makes the solution unique.

How is the difficulty level worked out?

The tool solves the puzzle the way a person would, with increasingly advanced techniques. If singles are enough, it is easy (36 givens or more) or medium; if it needs locked candidates, pairs, triples or an X-Wing, it is hard; if those techniques are not enough, it is rated expert. The techniques required therefore matter more than the number of givens.

What is the hardest sudoku in the world?

The most famous one was presented in 2012 by Finnish mathematician Arto Inkala as the world’s hardest: 21 givens, including an 8 in the top-left cell. Paste 800000000003600000070090200050007000000045700000100030001000068008500010090000400 into the import field: there is no single available at the start, yet the solver finds the unique solution, which begins 812753649, in a few milliseconds.

How do you solve a sudoku without guessing?

Start by scanning: for a given digit, pick a box where it is missing and rule out the cells that already see that digit in their row or column; if only one cell is left, you have found a hidden single. Then look for cells where only one digit is still possible, the naked singles. When nothing moves any more, pencil in the candidates (“Show candidates”) and look for pairs and locked candidates; the “Hint” button places the next digit and explains the deduction whenever a single is enough.