Play the Eight Queens puzzle on boards from 4 by 4 to 12 by 12, with live conflicts, a count of the solutions still possible, hints and every solution behind it.
Queens 0 of 8
Attacking pairs 0
Solutions possible 92
Click a square to place a queen
Basic solutions found 0 of 12
Solved at this size 0
All solutions 92
Place one queen on every row so that no two queens share a row, a column or a diagonal. Click or tap a square to put a queen on it, and click it again to take it off. A queen that is attacked by another queen gets a rose ring and an exclamation mark, so you never have to tell colours apart. Turn on the shading to see which squares the queens attack: they are hatched. "Solutions possible" counts the solutions that still contain every queen you have placed, found by checking the full list. A hint points at a square that keeps at least one solution possible. Hints and shown solutions mean the board does not count toward your basic solutions. Arrow keys move around the board, Enter or Space places or removes a queen.
The page holds the complete list of solutions for each size, found by a search that places queens one row at a time and never extends a position in which two queens attack. The counts are 2, 10, 4, 40, 92, 352, 724, 2680 and 14200 for 4 to 12 queens. "Solutions possible" filters that list by your queens, a hint is a queen of the first solution in that filter, and "Basic solutions" are solutions that cannot be turned into each other by rotating or flipping the board: there are 1, 2, 1, 6, 12, 46, 92, 341 and 1787 of them. Nothing is guessed and nothing is uploaded. A board with too few squares to read on a narrow screen offers fewer sizes.
As-is, no warranty. These apps are free under their listed license and run entirely in your browser. Use at your own risk — don't blame me if your PC catches fire, your dog runs away, or the math turns out wrong. Verify anything that actually matters. None of this is professional financial, medical, legal, or engineering advice.
Put one queen on each row of the board so that no two queens attack each other. A queen attacks every square in its row, in its column and along both diagonals, as far as the board goes. The board can be any size from 4 by 4 to 12 by 12, and you need as many queens as the board is wide. The default is the classic 8 by 8 board with 8 queens.
When all queens are placed and none attack another, the board is solved. A solved board, or a shown solution, locks until you press Clear board. A hint or a shown solution means the board is not counted toward your finds.
On the keyboard, the arrow keys move around the board, Home and End jump to the ends of a row, and Enter or Space places or removes a queen. Every square is announced with its row, its column and what is on it, and the status line says what each move did and how many pairs attack. On a narrow screen the size menu greys out sizes whose squares would be under 28 pixels wide, so 11 and 12 are greyed out on the narrowest phones; a size that arrives in a shared link stays available.
Turn a solution a quarter turn, or flip it, and you get another solution. The 92 solutions of the 8 by 8 board are really 12 different boards, each seen from up to 8 angles. The page counts those 12 as you find them, for the size you are on: Basic solutions found goes up when you solve the board without a hint and the pattern is new, and the message tells you if you had already found it. The count of finds lasts for the visit. How many times you solved each size is kept on your device.
The engine searches for solutions one row at a time. It keeps three sets of taken lines, columns and the two kinds of diagonal, as bits of a number, so the free squares in the next row come from one operation. A branch that has no free square is dropped at once. It runs the first time a size is used and the list is kept, in dictionary order, one column per row.
Everything on the page comes from that list:
The test suite checks the engine rather than trusting it:
| Queens | Solutions | Basic solutions |
|---|---|---|
| 4 | 2 | 1 |
| 5 | 10 | 2 |
| 6 | 4 | 1 |
| 7 | 40 | 6 |
| 8 | 92 | 12 |
| 9 | 352 | 46 |
| 10 | 724 | 92 |
| 11 | 2680 | 341 |
| 12 | 14200 | 1787 |
Nothing is uploaded and there is no account. The only thing kept is how many times you solved each size without help, as small whole numbers in a small JSON object in your browser’s local storage. Clearing site data removes it. The page address carries the size and the shading switch.
Free to play, no ads, nothing uploaded. These games are original and are not affiliated with any other game or brand.