Sudoku Generator

Make sudoku puzzles in seconds, at exactly the difficulty you want, from very easy puzzles for beginners to very hard puzzles for experts.

Every puzzle has exactly one solution and is checked to be solvable at its stated level, so your solvers always get a fair puzzle.

Sudoku enthusiasts can go further and choose exactly which solving techniques a puzzle needs, from X-Wings to alternating inference chains.

The sudoku generator is included with Crossword Compiler, along with crosswords and many other puzzle styles.

Quick and easy

Choose the size of grid and a difficulty level, and a new puzzle appears almost instantly. If you'd like a different one, just generate again: there is an endless supply. You can also have the starting numbers arranged in a neat symmetric pattern, like a traditional newspaper sudoku.

Need lots of puzzles for a book, magazine or website? Generate and save a whole batch in one go.

Difficulty levels

A puzzle's difficulty isn't just about how many numbers are given at the start. What really matters is how clever the solver has to be. Each level is defined by the solving techniques needed to finish the puzzle without guessing:

  • Very easy: lots of starting numbers, and every step is obvious. Great for children and beginners.
  • Easy: fewer starting numbers, but still only needs the simplest steps: finding the only number that fits a square, or the only square where a number can go.
  • Medium: needs a little more thought, for example noticing that a number in a box must be in a particular row.
  • Hard: the solver needs to spot pairs and groups of squares that share the same possible numbers.
  • Advanced: needs techniques beyond Hard, such as hidden pairs, X-Wings, Y-Wings or Swordfish. A good challenge for regular sudoku fans.
  • Very hard: can't be finished by logic alone, even using all the advanced techniques including chains. At some point the solver must try a number and see where it leads, but it's kept short and fair, starting from a square with only two possibilities.
  • Custom: choose your own mix of techniques (see below).

Sizes, letters and more

  • Any size: the standard 9x9 grid, small 4x4 and 6x6 puzzles for children, or giant 12x12, 16x16 and 25x25 grids. Boxes can be rectangular as well as square.
  • Letters or words: use letters instead of numbers, or your own symbols or words, for themed and educational puzzles.
  • Hidden words: type a word or pattern into the grid yourself, for example along a diagonal, and the generator makes a puzzle whose solution includes it.
  • Check any sudoku: type in a sudoku from anywhere to check that it has exactly one solution, see how hard it is, and find out which solving techniques it needs.

Custom difficulty for sudoku experts

With custom difficulty you choose exactly which solving techniques a puzzle is allowed to use, and which it must use. For example, you can:

  • Make puzzles that are guaranteed to need an X-Wing, for solvers who are learning that technique.
  • Put together a puzzle book that introduces one new technique per chapter.
  • Make tough puzzles that need chains or unique rectangles, but never any guessing.
  • Make puzzles that need backtracking, with limits on how deep and how long the trial and error can be.

The generator only makes puzzles that can be solved with the techniques you allow. If you also choose required techniques, it makes sure the puzzle actually needs them.

Sudoku solving techniques

These are the solving techniques the generator and checker understand, from the simplest to the most advanced. In the descriptions, a house means a row, column or box, and a square's candidates are the numbers that could still go in it.

Naked singles and hidden singles

The starting point for every sudoku. A naked single is a square where only one number is possible, because every other number already appears in its row, column or box. A hidden single is a number that has only one possible place left in a row, column or box, even though that square may have other candidates. Easy puzzles can be solved with these alone.

Locked candidates (pointing and claiming)

Sometimes all the places where a number could go in a box lie in a single row or column. The number must then be in that part of the line, so it can be crossed off everywhere else in that row or column (pointing). It also works the other way round: if a number's possible places in a row or column are all inside one box, it can be crossed off the rest of that box (claiming, also called box/line reduction). In the program this is called sector elimination, and it is what makes a puzzle Medium.

Naked pairs, triples and quads

If two squares in the same house both have only the same two candidates, say 3 and 7, then those two squares must hold the 3 and the 7 between them. Neither number can go anywhere else in that house, so they can be crossed off the other squares. The same works for three squares sharing three candidates (a naked triple) or four squares sharing four (a naked quad). These are the techniques that make a puzzle Hard.

Hidden pairs, triples and quads

The mirror image of naked subsets. If two numbers can only go in the same two squares of a house, those squares must hold those two numbers, so every other candidate can be removed from them. Hidden subsets are often harder to spot because the squares still show other candidates. Hidden triples and hidden quads work the same way with three or four numbers.

Multiple lines (double pairs)

An extension of locked candidates that looks across a row (or column) of boxes. For example, if in two boxes side by side a number can only go in the same two rows, then the number must use up those two rows in those boxes. In the third box of the band it must be in the remaining row, so it can be crossed off the other two. This is sometimes called double pairs. On larger grids the same idea works with more boxes and lines.

X-Wing

Take a single number. If in two different rows it can only go in the same two columns, those four squares form the corners of a rectangle. Whichever way round it goes, the number will fill both columns using those two rows, so it can be crossed off everywhere else in those two columns. The same works with rows and columns swapped. The X-Wing is one of the best-known advanced techniques.

Swordfish

A bigger X-Wing using three rows and three columns. If in three rows a number can only go in the same three columns (not necessarily in every one of them), it must fill those three columns from those rows, so it can be crossed off the rest of those columns. X-Wing and Swordfish are both examples of fish patterns.

Y-Wing (XY-Wing)

This uses three squares that each have exactly two candidates. A middle "pivot" square has candidates X and Y. It sees two "pincer" squares, one with X and Z and the other with Y and Z. Whichever number the pivot takes, one of the pincers must be Z. So any square that sees both pincers can't be Z.

XY-Chain

A longer version of the Y-Wing: a chain of squares with two candidates each, where each square shares a number with the next. If the chain starts and ends with the same number Z, one of the two ends must be Z, so Z can be crossed off any square that sees both ends.

Alternating inference chains (AIC)

The most general chain technique. An AIC links candidates using two kinds of link. A strong link means "if this one is false, that one must be true", for example when a number has only two possible places in a house. A weak link means "they can't both be true". By alternating strong and weak links along a chain, you can prove that at least one of the two ends must be true, and cross off anything that conflicts with both. Well-known patterns such as the Skyscraper, Two-String Kite and short X-Chains are all short AICs. You can choose how long the chains are allowed to be.

Unique rectangle

A technique that relies on the puzzle having only one solution. If four squares at the corners of a rectangle, spread over two rows, two columns and two boxes, all ended up with the same two numbers, those numbers could be swapped round to give a second solution: a "deadly pattern". Since a proper sudoku has only one solution, you can make deductions that avoid it. The generator only uses this after confirming that the puzzle really does have a single solution.

Backtracking (trial and error)

When logic alone can't finish a puzzle, the solver picks a square, tries one of its candidates and follows the consequences. If that leads to a contradiction, the other candidate must be right. Very hard puzzles need this, but the generator keeps it fair: the first trial is in a square with just two candidates, and the trial and error is kept short. With custom difficulty you can choose how much backtracking is allowed.

Accurate difficulty ratings

Like a human solver, the program always uses the simplest technique that makes progress, and only uses a harder one when it has to. If a puzzle can be solved without long chains, it is rated that way, so you get an honest rating of the hardest step a solver really needs.

When you check a sudoku, you see its difficulty rating, which techniques were needed and how many times each was used.

Back to Top