Sudoku Board Generator

Builds a valid, fully-solved 9x9 Sudoku grid from a base pattern varied by random band, row, and digit permutations, then blanks out a requested number of cells to produce a printable puzzle grid. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-27

Overview

Introduction

This tool generates a random, valid 9x9 Sudoku grid and turns it into a puzzle by blanking out a chosen number of cells.

It's a decorative/practice generator: every full grid it builds is a genuinely valid Sudoku solution, but the blanking step is simple random removal rather than a solver-verified puzzle design.

What Is Sudoku Board Generator?

A generator that produces a complete, rule-following 9x9 Sudoku grid (every row, column, and 3x3 box contains 1-9 exactly once), then replaces a requested number of cells with '.' to present as a solvable puzzle.

The underlying grid comes from a well-known deterministic construction, varied with random symmetry-preserving shuffles so repeated generations look different.

How Sudoku Board Generator Works

A base grid is built with the formula (row*3 + floor(row/3) + col) mod 9 + 1, which always produces a valid Sudoku Latin square.

Random shuffles of the three bands, the rows within each band, the three stacks, the columns within each stack, and the 1-9 digit labels are applied; each of these operations preserves Sudoku validity.

Finally, a random selection of cells (up to your requested blanks count) is replaced with '.' to form the puzzle.

When To Use Sudoku Board Generator

Use it to quickly generate a Sudoku grid for printing, practice, or embedding in a text-based document.

It's also handy for testing Sudoku-solving code with grids that are always guaranteed to have started from a valid solution.

Features

Advantages

  • Every full (0-blank) grid it produces is a genuinely valid, rule-following Sudoku solution.
  • Fast, purely client-side generation with no external puzzle database.
  • Plain monospace text output that copies and pastes cleanly anywhere.

Limitations

  • Does not guarantee a unique solution for the blanked puzzle: it's a simplified generator, not a full backtracking constraint solver, so some blank counts could in principle admit more than one valid fill.
  • Blanking is purely random, so difficulty is not tuned or rated.
  • Capped at 64 blanks (out of 81 cells) to always leave at least some starting clues.

Examples

A fully solved grid (0 blanks)

Input

0

Output

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

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

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

With 0 blanks, the full valid grid is shown (exact digits vary run to run since bands/rows/digits are randomly permuted).

A puzzle with blanks

Input

40

Output

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

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

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

With 40 blanks, roughly half the cells are replaced with '.', leaving a printable puzzle grid.

Best Practices & Notes

Best Practices

  • Use a monospace font/context so the space-separated columns stay visually aligned.
  • Click Regenerate a few times if you want a fresh layout without changing the blanks count.

Developer Notes

The base grid uses the standard row-shift Latin square formula, then applies Fisher-Yates shuffles to bands, in-band rows, stacks, in-stack columns, and the digit labels (all Sudoku-validity-preserving symmetries) before uniformly sampling which cells to blank.

Sudoku Board Generator Use Cases

  • Printing a quick Sudoku puzzle for practice
  • Seeding test fixtures for Sudoku-solving or Sudoku-validating code
  • Generating placeholder puzzle content for a demo or mockup

Common Mistakes

  • Assuming a generated puzzle has exactly one solution; it isn't solver-verified.
  • Viewing the output in a proportional font, where columns won't align.
  • Requesting more than 64 blanks, which is rejected to keep at least some starting clues.

Tips

  • Set blanks to 0 to get a complete, valid solved grid instead of a puzzle.
  • Lower blank counts (around 30) tend to look like 'easy' puzzles; higher counts (55+) look sparser and harder.

References

Frequently Asked Questions