The eight queens puzzle asks you to place eight queens on an 8x8 board so that none attacks another: never two in the same row, column or diagonal. There are 92 solutions, but only 12 are truly different, because the rest come from rotations and mirror images. Here you build your own with conflict highlighting, solve random challenges with queens already fixed, browse every solution from 4x4 to 12x12 and watch the solver count the results for N = 4 to 14.
How to use
From the first queen to a full board
In the Play tab, pick a board size and click squares to place or remove queens. Queens that attack each other turn red and are joined by a line.
Stuck? Use Hint to see where the next queen of some solution goes, or generate a random challenge with queens already fixed and complete the rest.
In the Solutions tab browse them all and filter the fundamental ones. In the Solver tab watch backtracking at work and count the solutions for any N from 4 to 14.
History
From Bezzel and Nauck to Dijkstra
Max Bezzel published the eight queens puzzle in 1848, in a German chess magazine. In 1850 Franz Nauck published the first solutions and generalized the question to N queens on an N x N board. Gauss also worked on the problem, and the historical literature (Campbell, 1977) shows that popular stories about what he found contain errors that get repeated from book to book.
In 1972 Edsger Dijkstra used the eight queens to demonstrate structured programming, with a depth-first search algorithm with backtracking. Ever since, the puzzle has been a staple of algorithms courses.
Numbers
How many solutions exist at each size
The number of solutions grows fast and irregularly, with no known closed formula. The Solver tab computes each value on the spot and checks it against the OEIS. The fundamental counts (up to rotation and reflection) come from OEIS A002562.
Turn a peaceful eight queens board by 90 degrees, or mirror it: the queens stay at peace. A square has 8 symmetries (4 rotations and 4 reflections), so each solution usually comes with 7 relatives. Grouping the relatives, the 92 solutions of 8x8 form 12 families.
Eleven families have 8 members. The twelfth is special: the solution equals its own image turned by 180 degrees, so it has only 4 distinct members. The sum closes: 11 x 8 + 4 = 92. In the Solutions tab, every solution shows its whole family beside it.
Embed
Use this tool on your site
Paste the code into your HTML and the tool shows up on your page, without J-Kit's navigation and ads. It still runs in the browser of whoever visits your site.
<iframesrc="https://jkit.tools/embed/en-US/eight-queens-puzzle"width="100%"height="600"style="border:0"loading="lazy"referrerpolicy="no-referrer-when-downgrade"title="Eight Queens Puzzle (and N Queens)"></iframe><p style="font-size:12px;margin:6px 0 0">Tool by <a href="https://jkit.tools/en/tools/eight-queens-puzzle">J-Kit</a></p>
Cite
Cite or link to this tool
Using it in a paper, class or post? Copy the link or a ready-made reference. The access date is today's.
<a href="https://jkit.tools/en/tools/eight-queens-puzzle">Eight Queens Puzzle (and N Queens)</a>
References
Sources and references for this tool
These references help contextualize formulas, standards, APIs and limitations used on this page. They do not replace professional validation when a result has legal, financial, medical or operational impact.
There are 92 solutions on the 8x8 board. If rotations and reflections count as the same, 12 fundamental solutions remain (OEIS A002562). Eleven of them generate 8 solutions each and one, symmetric under a 180 degree turn, generates only 4: 11 x 8 + 4 = 92.