Sudoku Generator

A sudoku is a 9 by 9 grid where each row, column and 3 by 3 box must hold the digits 1 to 9 exactly once. A well-made puzzle has only one solution. This generator gives 40, 32 or 26 starting digits for easy, medium and hard.

Did this solve your problem?
Prefer us on Google

How to use

  1. Choose Easy, Medium or Hard. A new puzzle is made right away. Press New puzzle for another one at the same level.
  2. Tap a square, then tap a number on the number pad. On a keyboard, click a square, type 1 to 9, use Backspace to clear it and the arrow keys to move. Bold digits are the starting clues and cannot be changed.
  3. Press Check to mark wrong digits. Digits that repeat in a row, column or box turn red as you type. Press Show solution to see the full answer, or Clear to start over.
  4. Press Print to print only the grid. Your own entries are left out unless the solution is showing, so you get a clean puzzle to solve on paper.

How it works

Every puzzle starts from a complete, valid grid that is built at random. The generator fills the grid with a backtracking search that tries the digits for each square in a shuffled order, always filling the square with the fewest possible digits first.

Then it removes digits one at a time, in random order. After each removal it counts the solutions of the grid, stopping at two. A digit is kept out only if the grid still has exactly one solution, so every puzzle is guaranteed to have a single answer. It stops once it reaches 40 clues for Easy, 32 for Medium or 26 for Hard, and it may stay a few clues above the target when no more digits can be removed safely.

Difficulty here is set by the number of starting clues. Fewer clues usually means more searching and harder logic, but it is not a measure of which solving techniques are required, so two puzzles on the same level can feel different.

Check compares your digits with the stored solution. Because the solution is unique, any digit that differs from it is wrong.

Solving tips

TechniqueHow it works
ScanningLook at a digit and mark where it cannot go, to find the only square left in a row, column or box
Naked singleA square where eight digits are already ruled out has only one choice
Hidden singleA digit that can go in only one square of a row, column or box must go there
EliminationRule out digits from squares using the rows, columns and boxes they see

FAQ

Does every puzzle have exactly one solution?

Yes. A digit is only removed if the puzzle still has one and only one solution, which the generator verifies by counting solutions after every removal.

What is the minimum number of clues in a sudoku?

No valid sudoku with a single solution has fewer than 17 clues. This was proven by computer search in 2012. The Hard level here uses about 26, which is far more forgiving.

How is the difficulty decided?

By how many digits are given at the start: 40 for Easy, 32 for Medium and about 26 for Hard. It is a simple measure, so there may be some variation between puzzles on the same level.

Can I print a puzzle for someone else?

Yes. Press Print. Only the grid is printed, without your entries, so it is a fresh puzzle. Turn on Show solution first if you want an answer sheet.

Will the same puzzle appear twice?

Practically never. The number of possible grids is enormous, and every puzzle is generated from a random start.

Is my progress saved?

No. The puzzle exists only in this page, so print it or keep the tab open if you want to finish later.