Sudoku Solver

Stuck on a sudoku? Type in the puzzle and solve it instantly, or ask for one hint at a time. Every move comes with the reason behind it, so you learn the technique instead of just copying the answer.

Type digits; arrow keys move, Tab leaves the grid, Ctrl+Z undoes. Bold = clues, gray = your answers, blue = solved, orange = hint.

Try an example

How to use the sudoku solver

  1. Enter the clues. Click a cell and type a digit; the cursor jumps to the next cell. Use the arrow keys to skip blanks, or paste the whole puzzle as 81 characters with 0 or a dot for each blank.
  2. Pick what you want. Solve fills the whole grid. Hint first just shows where to look and which technique to use; press it again (Show the digit) to fill that cell with the full reasoning. Check my work compares what you've filled in so far with the solution and outlines any mistakes. Undo steps back as far as you like.
  3. Read the steps. After solving, open the step-by-step list to see every move in an order a person could follow, with the technique used for each one.

The grid works with a keyboard alone: arrow keys move between cells, Tab moves in and out of the grid, and screen readers announce each cell's row, column, and whether it's a clue. Larger digitsmakes the numbers bigger, and the Dark button in the menu switches to a dark theme. Nothing ever pops up over the grid while you solve.

Before solving, the solver checks the puzzle itself: repeated digits are shown in red, and you'll be told if the clues allow no solution or more than one. That usually means a digit went into the wrong cell while typing.

The rules of sudoku

A sudoku is a 9 Ă— 9 grid split into nine 3 Ă— 3 boxes. Fill every empty cell with a digit from 1 to 9 so that each row, each column, and each box contains every digit exactly once. A well-made puzzle has exactly one solution and can be solved by logic alone, without guessing.

Solving techniques the hints use

Each empty cell has candidates: the digits not already used in its row, column, or box. Every technique below either places a digit or crosses candidates off until a placement appears.

Naked single

A cell where eight of the nine digits are already used by its row, column, and box. Only one digit is left, so it goes there. Most easy puzzles can be finished with this alone.

Hidden single

Look at one row, column, or box and one digit. If that digit can fit in only one empty cell of the unit, it must go there, even if the cell itself still has other candidates.

Pointing pair

Inside a box, a digit's possible cells all line up in one row or column. Whichever of them gets the digit, that row or column is taken care of, so the digit can be crossed off everywhere else in that line.

Box/line reduction

The reverse of a pointing pair: in a row or column, a digit's possible cells all sit inside one box. The digit must land in that part of the box, so it can be removed from the box's other cells.

Naked pair

Two cells in the same unit that can only hold the same two digits, say 4 and 7. One gets 4 and the other 7, so no other cell in that unit can be 4 or 7.

Hidden pair

Two digits that, within one unit, fit only in the same two cells. Those cells must take those two digits, so any other candidates in them can be crossed off.

Naked triple

Three cells in a unit whose candidates, taken together, are only three digits, such as {2,5}, {5,8} and {2,8}. The three digits are used up by those cells, so they leave every other cell in the unit.

X-wing

In two rows, a digit can only go in the same two columns. The four spots form a rectangle: each column gets the digit in one of the two rows, so it can be removed from the rest of both columns. The same works with rows and columns swapped.

Y-wing

A pivot cell that can only be A or B sees two other cells, one that is A or C and one that is B or C. Whichever digit the pivot takes, one of the two becomes C, so any cell that sees both of them can't be C.

Swordfish

An X-wing with three lines: in three rows, a digit's possible cells all fall within the same three columns. Those columns get their copy of the digit from these rows, so it can be removed from the rest of each column.

The techniques are listed from simplest to hardest, and the hints always use the simplest one that works. The easy example above can be finished with singles alone. The medium one needs box/line reductions and naked pairs along the way. The hard one goes beyond all ten techniques at one point; there the hint tells you so and gives the correct digit.

Tips for solving by hand

  • Scan for hidden singles first: pick a digit that already appears many times and check each box for the one spot it can go.
  • Pencil in candidates only when scanning stops working. Full candidate lists make pairs and pointing patterns easy to spot.
  • When you place a digit, immediately cross it off the candidates in its row, column, and box.
  • If you're stuck, use one hint rather than the full solution. Seeing which technique was needed is the fastest way to get better.
  • Playing killer sudoku? The killer sudoku calculator lists every digit combination for a cage and shows which digits it must or can't contain.

Sudoku solver FAQ

How does the sudoku solver work?

To find the answer, it tries digits cell by cell, always starting with the cell that has the fewest options, and backs up when it hits a dead end. That takes a fraction of a second. To explain the answer, it then replays the puzzle the way a person would, from singles up to X-wings, Y-wings, and swordfish, and lists each step.

Can I get a hint without seeing the whole solution?

Yes. Press Hint once and the solver only tells you where to look and which technique to use, with the area highlighted. If you still can't see it, press Show the digit: it fills in that one cell and explains every step that leads to it.

Can a hint be wrong?

No. Each hint is worked out by exact rules from the puzzle you entered, and the solver first confirms the puzzle has exactly one solution. Before release, every hint was checked against the solution on hundreds of generated puzzles. If a hint ever disagrees with a digit you placed, it's your digit that's wrong, and Check my work will outline it.

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

A proper sudoku has exactly one solution. If yours has several, a clue was probably missed or typed in the wrong cell. Compare the grid with your puzzle cell by cell.

What is the fewest number of clues a sudoku can have?

17. In 2012, mathematicians Gary McGuire, Bastian Tugemann, and Gilles Civario ran an exhaustive computer search and found that no 16-clue sudoku has a single solution, which proved 17 is the minimum.

What does R4C7 mean?

Row 4, column 7. Rows are numbered 1 to 9 from top to bottom and columns 1 to 9 from left to right. Boxes are numbered 1 to 9 the same way you read, starting at the top left.

Why does a hint say "no simple step"?

The very hardest puzzles need techniques such as chains or forcing loops that this solver doesn't explain yet. When none of the ten techniques above finds a move, the hint says so and gives you the correct digit from the solution so you can keep going.

Can I undo a mistake?

Yes, as far back as you like. Press Undo or Ctrl+Z (Cmd+Z on a Mac) to step back one change at a time, including digits filled in by a hint or by Solve.

Is my puzzle saved or sent anywhere?

No. Solving happens in your browser. Nothing you type is sent to a server.

Sources

  • McGuire, Tugemann & Civario, “There is no 16-Clue Sudoku: Solving the Sudoku Minimum Number of Clues Problem via Hitting Set Enumeration”, arXiv:1201.0749 (2012).
  • University College Dublin news, “There is no 16 clue or less Sudoku, mathematician proves” (January 2012).
  • The example puzzles are original, generated for this site and checked to have exactly one solution.