Chess 8 Queens Puzzle - Classic Board Challenge

The 8 Queens Puzzle lives at the intersection of chess and mathematics. Understand queen movement, algebraic notation, and the rich history of this 180-year-old chess problem.

The Chess Connection

The 8 Queens Puzzle was born from chess. In 1848, chess composer Max Bezzel published the original problem in a German chess magazine: place 8 queens on a standard 8×8 chessboard such that no queen threatens any other. The puzzle spread rapidly among mathematicians and chess enthusiasts, and within a few years the great mathematician Carl Friedrich Gauss was corresponding about it.

The puzzle uses the chessboard as its medium for a reason — the 8×8 grid and the queen's movement rules are already familiar to millions of chess players worldwide. The queen is the most powerful piece in chess precisely because she combines the movement of a rook (horizontal and vertical) with the movement of a bishop (diagonal). This power is what makes the puzzle so challenging: placing one queen blocks an enormous number of squares, and placing eight queens that do not interfere with each other requires genuine ingenuity.

Unlike most chess problems, the 8 Queens Puzzle has no opponent. There is no mate in N, no combination to find, no opponent's king to trap. It is a pure constraint-satisfaction puzzle — a solo meditation on spatial relationships. This makes it accessible to anyone who knows the rules of chess (and even to those who do not, since you only need to learn how one piece moves).

Today the puzzle exists as both a chess curiosity and a foundational problem in computer science. It appears in every introductory algorithms textbook as the canonical demonstration of backtracking search. Every programmer who has taken a data structures course has almost certainly implemented an 8 Queens solver. Try the puzzle yourself at the 8×8 interactive board.

Queen Movement in Chess

The queen is universally regarded as the most powerful piece in chess. Understanding her movement is the only prerequisite for solving the 8 Queens Puzzle.

The queen can move any number of squares in any of eight directions:

  • Horizontal (rank): Left or right along the same row (rank in chess terminology). From e4, the queen can reach a4, b4, c4, d4, f4, g4, or h4 in a single move.
  • Vertical (file): Up or down along the same column (file in chess terminology). From e4, the queen can reach e1, e2, e3, e5, e6, e7, or e8.
  • Diagonal: Along any of the two diagonals passing through her square. From e4, the diagonals run through d3-c2-b1 and f5-g6-h7 (main diagonal) and through d5-c6-b7-a8 and f3-g2-h1 (anti-diagonal).

In the 8 Queens Puzzle, we say two queens "attack" each other if one queen could capture the other in a single move according to chess rules — meaning they share a rank, file, or diagonal. The challenge is to place all 8 queens so that no pair attacks each other.

Note that in the puzzle, queens do not actually move — they are all placed simultaneously, and we only care about whether their lines of attack overlap. The chessboard is used purely as a spatial grid. The queen movement rules define the constraints: one queen per rank, one queen per file, and one queen per diagonal.

The 8 Queens Challenge on a Chessboard

The standard 8 Queens Puzzle uses the full 8×8 chessboard with its 64 squares (alternating light and dark, though color is irrelevant to the puzzle). You must place exactly 8 queens — one in every row (rank) — so that no two queens share a file (column) or diagonal.

The 8 Queen Puzzle has exactly 92 distinct solutions. These 92 solutions reduce to 12 "fundamental" or "essentially different" solutions when you account for the 8-fold symmetry of the square board (4 rotations × 2 reflections). The other 80 solutions are geometrical transformations of these 12.

To get a feel for the scale: there are 4,426,165,368 ways to place 8 non-attacking queens if we only require that no two share a rank and file (i.e., one per rank and one per file). Of these, only 92 also satisfy the diagonal constraint. That is roughly 1 in 48 million valid rank-and-file arrangements — which illustrates how tight the diagonal constraint is.

On the actual chessboard, a convenient convention for tracking solutions is to list, for each rank from 1 to 8, which file the queen is placed on. For example, the solution "1 5 8 6 3 7 2 4" means rank 1 has a queen in file 1 (a1), rank 2 in file 5 (e2), rank 3 in file 8 (h3), and so on. This one-dimensional encoding is how most computer implementations represent solutions.

Chess Notation for Queens Puzzle Solutions

Standard chess uses algebraic notation to identify squares: files are labeled a–h (left to right from White's perspective) and ranks are labeled 1–8 (bottom to top). Squares are named by combining file and rank: a1 is the bottom-left corner, h8 is the top-right corner, and e4 is the center of the board.

Using this notation, a Queens Puzzle solution can be written as an ordered list of squares — one per rank. For example, one of the 92 solutions expressed in algebraic notation is:

Qa1   Qe2   Qh3   Qf4   Qc5   Qg6   Qb7   Qd8

This notation (Q + square) is the standard way to record queen moves in chess games. Reading the solution above: a queen on a1, a queen on e2, a queen on h3, a queen on f4, a queen on c5, a queen on g7, a queen on b7, and a queen on d8.

You can verify this is conflict-free: every file (a, e, h, f, c, g, b, d) appears exactly once, confirming no file conflicts. Every rank (1–8) has exactly one queen, confirming no rank conflicts. And checking the diagonals: no two queens satisfy |rank difference| = |file difference|.

If you enjoy chess notation, try solving the 8 Queens Puzzle and recording your solution in algebraic notation. It is a satisfying way to bridge the puzzle world and the chess world, and it forces you to think about the board in the structured way that strong chess players do naturally.

Historical Context and Famous Players

The 8 Queens Puzzle has attracted the attention of some of the greatest mathematical minds in history:

Max Bezzel (1848)

The chess composer and problem editor who first published the 8 Queens problem in the Berliner Schachzeitung. Bezzel found the problem while studying queen endings and was struck by the difficulty of mutual non-attack placement.

Franz Nauck (1850)

Extended the problem to find all 92 solutions for the 8×8 board and generalized it to N queens on an N×N board — what we now call the N-Queens Problem.

Carl Friedrich Gauss (1850)

The legendary mathematician attempted to find all solutions and found 72 of the 92. He corresponded extensively with astronomer Heinrich Schumacher about the problem. Even Gauss, one of the greatest mathematicians who ever lived, found it non-trivial to enumerate all solutions by hand — which gives you a sense of how challenging exhaustive search is without a computer.

Edsger Dijkstra (1972)

The computer scientist famous for Dijkstra's algorithm used the 8 Queens Problem in his seminal paper on structured programming as a classic example of backtracking. His presentation of the problem helped cement its place as a canonical CS teaching example.

The puzzle's enduring appeal across 180+ years, from chess problem collections to computer science textbooks to viral social media games, speaks to something fundamental about the human attraction to constrained spatial puzzles.

Frequently Asked Questions

Is the 8 Queens Puzzle a real chess puzzle?

Yes and no. It originated from chess in 1848 and uses the chessboard and queen movement rules. However, it is not a chess puzzle in the traditional sense (which involves finding a winning sequence of moves). It is a placement puzzle — you place all 8 queens simultaneously and there is no opponent, no checkmate, and no sequence of moves. It is best described as a mathematical puzzle inspired by chess.

How does the queen move in chess?

The queen can move any number of squares in any direction: horizontally (along ranks), vertically (along files), or diagonally. She cannot jump over other pieces. This combination of rook and bishop movement makes her the most powerful piece on the board, controlling up to 27 squares from a central position on an empty 8×8 board.

What is algebraic notation and how is it used for Queens Puzzle solutions?

Algebraic notation is the standard system for recording chess moves and positions. Files are labeled a–h (left to right) and ranks 1–8 (bottom to top). Each square is named by its file and rank (e.g., e4, a1, h8). For the Queens Puzzle, solutions can be recorded as a list of squares — one per rank — showing where each queen sits. For example: Qa1, Qe2, Qh3, Qf4, Qc5, Qg6, Qb7, Qd8.

How many solutions does the 8 Queens Puzzle have?

The 8 Queens Puzzle has exactly 92 distinct solutions on the 8×8 chessboard. Of these, 12 are "fundamental" solutions — the rest are obtained by rotating or reflecting the board. The first complete enumeration was done by Franz Nauck in 1850. You can explore all 92 solutions at the solutions page.