Skip to contentHoliday sale: 20% off + free shipping over $50, through December 31
SLEIGHT
← The Library

Eight Queens Puzzle: The Rules, a Solution and All 92 Answers Explained

Dec 2, 2026 · The Editors

The eight queens puzzle asks you to place eight queens on a chessboard so that no two attack each other. One complete solution, why there are 92 answers and 12 truly different ones, how to solve it by hand, the n-queens version, and its history.

The eight queens puzzle asks you to place eight queens on a standard chessboard so that no two queens attack each other: no two in the same row, the same column or the same diagonal. It has 92 solutions, which reduce to 12 truly different ones once you count rotations and mirror images as the same. One solution is: a1, b5, c8, d6, e3, f7, g2, h4.

The rules

A queen attacks along its row, its column and both diagonals, as far as the board goes. With eight queens on an eight-by-eight board, every row and every column must hold exactly one queen. The hard part is the diagonals. You win when all eight queens are placed and none can capture another. How each piece moves is covered in how do chess pieces move.

A complete solution

Columnabcdefgh
Row of the queen15863724

Check it on a board: each column has one queen, each row number appears once, and no two queens share a diagonal. Rotate the board a quarter turn, or look at it in a mirror, and you get another valid solution. That is how 12 basic solutions become 92.

How to solve it by hand

The method most people use is called backtracking, and it is the same idea computers use.

  1. Place a queen in column a, on row 1.
  2. Move to column b and place a queen on the lowest row that is not attacked.
  3. Carry on, column by column.
  4. When a column has no safe square, go back to the previous column and move that queen up to its next safe square.
  5. Repeat until all eight are placed.

Done carefully, starting from a1, you reach the solution above. It takes patience rather than insight, which is why the puzzle became a standard first exercise in computer programming.

Tip: every solution puts exactly one queen in each column and each row, so writing the answer as eight row numbers, one per column, makes checking much easier.

How many solutions are there?

BoardSolutionsTruly different
4×421
5×5102
6×641
7×7406
8×89212
10×1072492

The general version, placing n queens on an n×n board, is the n-queens puzzle. It has solutions on every board except 2×2 and 3×3, and the number grows very fast as the board grows.

A short history

The puzzle was published by the German chess composer Max Bezzel in 1848. Franz Nauck published solutions in 1850, and the mathematician Carl Friedrich Gauss took an interest in it around the same time. In the twentieth century it became a classic in computer science, used to teach backtracking search, and it still appears in programming courses today.

Set it up on a real board

The puzzle is far more satisfying with pieces you can slide about. A standard set has only one queen per side, so use any eight pieces as queens: pawns, checkers or coins. The three-in-one chess, checkers and backgammon set comes with checkers and extra queens, and a magnetic folding chess set holds a half-finished attempt in place. For another puzzle of pure position and patience, try a wooden maze strategy game, and for the other great chessboard puzzle, the knight's tour.

Frequently asked questions

Is there a solution to the eight queens puzzle?

Yes. There are 92 solutions on a standard board, or 12 if rotations and reflections count as the same. One is a1, b5, c8, d6, e3, f7, g2, h4.

How do you solve the 8 queens puzzle?

Place queens one column at a time on the lowest safe row. When a column has no safe square, go back and move the previous queen up. This method, backtracking, always finds a solution.

Why are there 92 solutions to the eight queens puzzle?

There are 12 basic solutions. Rotating the board and reflecting it turns most of them into eight versions each; one is symmetrical and gives only four, which makes 92.

What is the n-queens puzzle?

The same puzzle on an n×n board with n queens. It can be solved on every board except 2×2 and 3×3.