Skip to content

Sudoku solver step by step, free online

Type in a puzzle and solve it at once, or press Step by step and watch it solved one named technique at a time, with the cells and candidates each move touches. It handles 4x4 to 16x16 grids, flags repeated digits, tells you when a puzzle has no solution or several, and can generate a puzzle rated by the hardest technique it needs. It runs in your browser and nothing is uploaded. Below: how to solve a Sudoku step by step, every technique with a diagram, and what the free Android app adds, including the camera scan that cannot run on this page.

Sudoku solver

Enter a puzzle, solve it, or watch it solved one named technique at a time.

3
6
2
9
7
3
4
6
9
8
4
1
2
3
1
3
5
2
4
8
3
7
6
9
5
1
3
2
8
4
7
1
3
2
1
5
2
4
3
3
5
4
8
1

Select a cell, then type a digit. Arrow keys move, Backspace clears.

Camera scanning does not run on this page: type the grid in, or use a link. The Android app reads a printed Sudoku from a photo (it is marked Beta in the app), see the app below.

Scan a Sudoku with your phone

This page needs the grid typed in. The Android app reads a printed Sudoku from a photo and solves it, and it also takes manual input, works offline and explains its steps:

  • Scan a Sudoku from a photo or pick one from the gallery; the app reads the printed numbers by OCR and solves the grid (the Scan option is marked Beta in the app)
  • Solves 4x4, 6x6, 9x9, 12x12 and 16x16 grids, from easy to expert
  • Step-by-step solving that shows the logic behind each move, cell by cell
  • Manual entry on a keypad that reshapes itself to the grid size
  • A result screen with the solving time, the number of steps, the techniques used and a difficulty, and a warning when the solution may not be unique
  • A history of the puzzles you solved
  • Colour themes from Dawn to Eclipse, a language menu, animation speed and haptic feedback settings
  • Works fully offline; nothing needs a connection
Get it on Google Play
  • Sudoku Lens app: Scan screen with a round scan icon on a pale blue background, asking you to take or choose a sudoku photo
    Scan a puzzle from a photo
  • Sudoku Lens app: home screen with Manual Input, Scan marked Beta, Learn and Recent
    Type it, scan it or learn how
  • Sudoku Lens app: manual input on a 9x9 grid with size buttons for 4x4, 6x6, 9x9 and 16x16 and a round number pad
    A keypad that fits the grid
  • Sudoku Lens app: Solved dialog with the time, 81 steps, the techniques used and a difficulty, plus a note that the solution may not be unique
    Time, steps and difficulty
  • Sudoku Lens app: a completed 9x9 grid with the digits the solver found shown in blue
    The finished grid
  • Sudoku Lens app: theme picker with Dawn, Morning, Afternoon, Aurora, Dusk, Twilight, Midnight and Eclipse, and a language menu
    Eight themes
  • Sudoku Lens app: dark themes with the language menu, animation speed slider and a haptic feedback switch
    Language, speed and haptics

How to solve a Sudoku step by step

A Sudoku asks you to fill the grid so that every row, every column and every box holds each digit once. In the usual 9x9 grid the digits are 1 to 9 and the boxes are 3x3. Solving is deduction: you look for a cell or a digit that the rules leave only one place for, write it in, and the next one appears.

  1. Check the clues. No digit may repeat in a row, column or box. Type the puzzle into the tool above; a repeat turns red at once, and a typo is the most common reason a puzzle looks impossible.
  2. Write the candidates. For each empty cell, list the digits that are not yet in its row, column or box. Press Candidates in the tool to see them.
  3. Place the singles. A cell with one candidate, or a digit with one possible cell in a row, column or box, goes in straight away. Update the candidates after each digit.
  4. Remove candidates with pairs and lines. When the singles run out, look for pairs of cells that share two candidates, and for a digit that is locked into one line of a box.
  5. Try the rarer patterns. X-Wing and XY-Wing remove candidates across the whole grid and often unlock a stuck puzzle.
  6. Guess last. If no technique applies, pick the cell with the fewest candidates, try a digit and follow it until it either solves the puzzle or breaks a rule. The Step by step button labels such a move as a guess.

The tool above does this loop for you. Press Step by step and each press applies one technique, names it, and marks the cells and candidates it touches.

Sudoku techniques, explained with diagrams

Cells are named by row and column: R3C5 is row 3, column 5. In every diagram, blue cells form the pattern, a green cell receives a digit, and red struck-through digits are the candidates the technique removes. The diagrams are not drawn by hand. Each one is a real puzzle, and the board is whatever the solver in the tool above has on screen when that technique first applies.

Naked single

A cell whose row, column and box already contain every digit but one. Its candidate list has a single entry, so that digit goes in.

At the start of the puzzle. R2C7 has only one candidate left, 7. Every other digit already appears in its row, column or box.

Hidden single

A digit that fits in only one cell of a row, column or box, even if that cell still lists other candidates. Scan each unit digit by digit. In this tool an Easy puzzle is one that naked and hidden singles solve on their own.

At the start of the puzzle. In row 2, 5 fits in only one cell, R2C8. It has to go there.

Naked pair

Two cells in one row, column or box that hold the same two candidates and nothing else. One cell takes the first digit and the other takes the second, so neither digit can sit anywhere else in that unit. Remove them from the other cells of the unit.

At the start of the puzzle. R1C9 and R3C8 can only hold 5 and 7 between them, so those 2 digits belong to those 2 cells. Remove 5 and 7 from the other cells of box 3.

Hidden pair

Two digits that appear in only two cells of a unit. Those cells must hold exactly those two digits, so every other candidate in them can go.

After 4 easier steps in the same puzzle. In column 7, 1 and 4 fit only in R3C7 and R6C7. Those 2 cells must take those 2 digits, so remove every other candidate from them.

Pointing pair

Inside a box, a digit is only possible in cells that all lie on one row or column. The digit of that box is therefore on that line, and the rest of the line outside the box cannot hold it. With three cells it is a pointing triple.

After 1 easier steps in the same puzzle. In box 2, 7 can only go in R1C6 and R3C6, all in column 6. So the 7 of box 2 sits in column 6, and no other cell of column 6 can be 7.

Box-line reduction

The mirror image, also called claiming. In a row or column, a digit is only possible in cells that all sit in one box. The box gets that digit from this line, so the box's other cells lose it.

After 3 easier steps in the same puzzle. In column 9, 6 can only go in R7C9 and R8C9, all inside box 9. So the 6 of column 9 is in box 9, and no other cell of box 9 can be 6.

X-Wing

A digit that appears in exactly two cells of each of two rows, and those cells share the same two columns. The digit must fill one diagonal of the rectangle or the other, so both columns are used up and the digit leaves every other cell of them. It works the same way with rows and columns swapped.

After 21 easier steps in the same puzzle. Look at 7 in rows 1 and 4: it can only go in columns 2 and 7. Each of those rows needs its own 7, so together they use up all of those columns. Remove 7 from the other cells of those columns.

XY-Wing

Three cells with two candidates each: a pivot holding A and B, and two cells that see the pivot and hold A and C, and B and C. Whichever digit the pivot takes, one of the other two cells becomes C, so a cell that sees both of them cannot be C.

After 4 easier steps in the same puzzle. R8C9 holds 6 or 7. If it is 6, R8C3 becomes 9; if it is 7, R9C7 becomes 9. Either way one of R8C3 and R9C7 is 9, so no cell that sees both can be 9.

The solver also knows naked and hidden triples and Swordfish, which are the same ideas with three cells or three lines. It names them when they apply. Many more techniques exist: sudokuwiki.org, for one, lists dozens, grouped as Basic, Tough, Diabolical and Extreme (strategy families).

Sudoku difficulty levels

There is no standard scale. This tool rates a puzzle by the hardest technique its solution needs, using the techniques above, in the order a person tries them.

How the tool rates a puzzle
LevelTechniquesMeaning
EasyNaked single, Hidden singleEvery step is a single: a cell with one candidate or a digit with one possible cell.
MediumNaked pair, Hidden pair, Pointing pair, Box-line reductionNeeds pairs, or a digit locked into a line or a box, at least once.
HardNaked triple, Hidden triple, X-Wing, XY-Wing, SwordfishNeeds a triple, an X-Wing, an XY-Wing or a Swordfish at least once.
ExpertGuessThese techniques run out before the grid is full, so the solver has to guess.

Expert here means that this list of techniques ran out, not that no person could solve the puzzle: stronger techniques exist, and another site may call the same puzzle Hard.

The generator builds a puzzle in two moves. It removes clues from a full grid as long as the solution stays unique, then puts clues back until the solver finishes at your chosen level. Small grids leave little room for hard techniques, so a 4x4 or 6x6 puzzle may come out easier than you asked; the tool reports the rating it got.

Does a Sudoku have only one solution?

A well-made Sudoku has exactly one. If two solutions existed, no chain of logic could choose between them and the solver would have to guess. Setters check uniqueness with a computer search, and so does the Solve button: it looks for a second solution and tells you if one exists.

  • One solution: the puzzle is proper. Solve and Step by step both finish.
  • Several solutions: too few clues, or the wrong ones. The tool shows the first solution it found and says there are more. Add a clue to pin it down.
  • No solution: the clues break no rule on sight but cannot all hold together, or a cell has no candidate left. The tool says so instead of showing a grid.

How few clues can a proper 9x9 puzzle have? Seventeen. Wikipedia reports that McGuire, Tugemann and Civario proved in 2014, with an exhaustive computer search, that no puzzle with 16 clues has a single solution (Mathematics of Sudoku). The same search code that powers this page counts 288 different complete 4x4 grids with 2x2 boxes.

What to do when you are stuck

  • Rewrite all candidates from scratch; one missed elimination hides a single.
  • Re-check the clues you typed. A wrong clue makes an easy puzzle look brutal.
  • Press Step by step on a copy of the puzzle to see which technique comes next, then look for the same pattern in your own notes.

16x16, 12x12 and other Sudoku grid sizes

Bigger grids follow the same rules with more digits and larger boxes. A 16x16 puzzle needs 16 symbols, so printed ones use the digits 1 to 9 and then the letters A to G. Searches for a 16x16 solver with letters are common; type the letters straight into the grid above.

Grid sizes in this tool
GridBoxSymbolsSolveGenerate
4x42 rows by 2 columns1 to 4YesYes
6x62 rows by 3 columns1 to 6YesYes
9x93 rows by 3 columns1 to 9YesYes
12x123 rows by 4 columns1 to 9, A to CYesYes
16x164 rows by 4 columns1 to 9, A to GYesNo

Check the box lines of your puzzle before you type it in. This tool lays out 6x6 boxes as 2 rows by 3 columns and 12x12 boxes as 3 by 4, a common layout, and does not read puzzles whose boxes run the other way. The search never freezes the page: it works in short slices and stops after eight seconds on a grid with too few clues.

Solve a Sudoku from a photo

Reading a printed grid takes an OCR step that finds the digits in a picture. This page does not include one, so there is no camera button here: type the grid in, or open a shared link. The Sudoku Lens app does the scanning on your phone. Its listing says to take or choose a clear photo from a newspaper, a book, a screen or a printout, and the app recognises the printed numbers and solves the grid. In the app's own menu the Scan option is marked Beta, so check the recognised digits before you trust the answer.

A scan that misreads one digit usually gives a puzzle with no solution or with several. Type the grid into the tool above and it tells you which.

What the Android app adds, and what to know first

  • Camera scan and gallery import for 9x9 and the other sizes, plus manual entry on a keypad that reshapes itself to the grid size.
  • Step-by-step solutions that walk through the grid cell by cell, and a history of solved puzzles.
  • Themes and languages. The theme picker in the screenshots shows eight named themes from Dawn to Eclipse and a language menu; the listing text mentions five colour themes in light and dark mode.
  • Offline. The listing says it solves on the device, with no internet.
  • Ads. Google Play marks the app as containing ads. Its Data safety section lists device or other IDs, shared with third parties; read it on the listing before you install.

Its solver is a different program from the one on this page, so the technique names and difficulty ratings can differ. For a puzzle with too few clues, the app's result screen also warns that the solution may not be unique, the same note this tool gives.

Questions

How do I solve a Sudoku step by step?

Check the clues for repeats, write the candidates for every empty cell, place the singles, then look for pairs, pointing pairs and box-line reductions, and only guess when none applies. The Step by step button on this page applies one named technique per press and marks the cells it touches.

What are the main Sudoku solving techniques?

Naked and hidden singles solve easy puzzles. Medium puzzles add naked and hidden pairs, pointing pairs and box-line reduction. Harder ones need triples, X-Wing, XY-Wing or Swordfish. The guide on this page shows each with a diagram.

Can a Sudoku have more than one solution?

A proper Sudoku has exactly one, and a 9x9 puzzle needs at least 17 clues for that. A grid with too few clues can have several. The solver here looks for a second solution and says so if it finds one.

What should I do when I am stuck on a Sudoku?

Rewrite the candidates from scratch, re-check the clues for a typo, then run Step by step on a copy of the puzzle to see which technique comes next. Guess only when no technique applies.

How do I solve a 16x16 Sudoku?

The rules are the same with 16 symbols. Printed 16x16 puzzles use the digits 1 to 9 and the letters A to G. Pick 16x16 in the tool, type the clues with the keyboard or the pad and press Solve.

Can I solve a Sudoku from a photo on this page?

No. Reading digits from a picture needs OCR, which this page does not include, so you type the grid in. The Sudoku Lens Android app scans a printed puzzle from a photo or the gallery; the app marks Scan as Beta.

How is the difficulty of a Sudoku rated here?

By the hardest technique the solver needs: Easy for singles only, Medium for pairs, pointing and box-line, Hard for triples, X-Wing, XY-Wing and Swordfish, Expert when those run out and it has to guess. Other sites use other scales.

Is the Sudoku Lens app free?

Yes. It is free with ads and solves on the device without internet. Google Play lists device or other IDs in its Data safety section, so read it before you install.

Photograph a puzzle, get the answer

Free on Android, with ads. Solves on the device without internet; the Scan option is marked Beta in the app.

Get it on Google Play

Facts from the Google Play listing, last checked .