Eight Queens

Place eight queens so none can attack another.

How to play Eight Queens

Tap squares: no two queens may share a line

Click a square to place or remove a queen. Your goal is to place all eight so that no two attack each other: no shared row, column, or diagonal. Any queen currently under attack is flagged, so adjust until all eight sit safely. Solve it as fast as you can.

One queen per row, no exceptions

Since two queens can't share a row, a solved board has exactly one queen on each of the eight rows, and, by the same reasoning, one per column. That reframes the puzzle usefully. You're not scattering eight queens across 64 squares; you're choosing which column the queen goes in for row one, then row two, and so on, making sure no diagonal ever lines two of them up. Working row by row from the top keeps you honest and heads off the most common mess, which is doubling two queens into a column without noticing.

Watching the diagonals

Rows and columns are easy to police. Diagonals are what actually bite. Two queens attack along a diagonal whenever the rows they sit on differ by the same amount as their columns, so a queen two rows down and two columns over from another is staring right at it.

Backtracking by hand

If you want a method rather than inspiration, do exactly what a computer would do. Work one row at a time from the top. In each row, put the queen on the leftmost square no earlier queen attacks. When you reach a row with no safe square at all, don't shuffle the lower rows: go back up one row, slide that queen right to its next safe square, and continue down again. If it has no further safe square either, back up another row. The routine feels slow for the first minute, and then suddenly the board is full. This exact loop of place, test, and retreat is called backtracking, and it is guaranteed to walk you to a solution without one lucky guess. Call it mechanical if you like, but it teaches the puzzle's real lesson: when you're stuck, change the most recent decision first, and only dig deeper into the past when that fails.

The staircase that almost works

There's a tempting pattern most people discover on their own: place the queens a knight's move apart. Row one takes column one, row two takes column three, then columns five and seven, then the pattern wraps around to columns two, four, six and eight for the last four rows. Every row and column is covered once, and the knight spacing dodges nearly every diagonal. Nearly. The first queen sits on the corner of the board's long diagonal, and the last queen lands on the far corner of the same diagonal, seven rows and seven columns away. Two flagged queens, one tidy idea dead. The fix is a less tidy order. Try this sequence of columns for rows one through eight: 1, 5, 8, 6, 3, 7, 2, 4. Check it queen by queen and you'll find no shared row, column, or diagonal anywhere. Better still, use it as a rescue rather than a recipe: solve as far as you can, and peek at the next number only when genuinely stuck.

A chess puzzle Gauss couldn't resist

The Eight Queens problem was posed in 1848 by Max Bezzel, a German chess composer, in a chess newspaper. Two years later Franz Nauck published the complete set of answers and pushed the question out to bigger boards, and Carl Friedrich Gauss followed Nauck's work closely, corresponding about the count. There are 92 distinct solutions on the standard board. Fold in rotations and mirror images and they collapse to just 12 truly different shapes: eleven of those twelve each produce eight variations, while one is so symmetric it produces only four, which is where the odd total of 92 comes from. The puzzle became a favourite teaching example in computer science too, as the classic demonstration of backtracking. The general version, n queens on an n-by-n board, has solutions for every size from four up, and computers have counted the arrangements as far as the 27-by-27 board, where the answer runs to roughly 235 quadrillion.

Eight Queens leaderboard

Top scores. Log in to compete.

  1. Loading leaderboard…

Eight Queens: frequently asked questions

How many solutions are there?

The eight-queens puzzle has 92 distinct solutions (12 unique up to symmetry).

How is my best measured?

By your fastest time to reach a fully safe arrangement of all eight queens.

How many solutions are there?

There are 92 ways to place the eight queens safely on a standard board. Many are rotations or reflections of one another, though. Strip those out and just 12 fundamentally different arrangements remain. You only need to find one to win.

What's the best way to start?

Place one queen per row, working from the top down, and pick a column for each that no earlier queen attacks. Because a solution has exactly one queen in every row and every column, that structure removes a huge amount of guesswork before you even weigh up diagonals.

Why do diagonals cause the most trouble?

Rows and columns are simple to track, but two queens also attack when the gap between their rows equals the gap between their columns: a diagonal line. Those clashes are easy to overlook, and they're usually what forces you to reposition a queen placed several moves before.

What do I do when a queen is flagged?

A flagged queen is under attack from another. Rather than clearing the board, slide it to a safe square in its own row, or back up to an earlier row whose placement is boxing you in. The flags turn the puzzle into a steady process of adjustment.

Is there a pattern that helps me remember a solution?

Yes. Queens spaced a knight's move apart dodge most diagonals, though the neat zigzag version fails because the first and last queens land on the same corner-to-corner diagonal. A working order to memorise, read as columns for rows one to eight, is 1, 5, 8, 6, 3, 7, 2, 4.

Does it only work on an 8x8 board?

The famous version uses eight queens on the eight-by-eight chessboard, and that's this game. The idea generalises (placing N queens on an N-by-N board) and solutions exist for every size from four upward, but eight is the classic challenge.

Is Eight Queens free to play?

Yes. Eight Queens is completely free on Inkplay, with no download, no sign-up, and no in-game purchases. Open the page and play instantly on desktop or mobile.

Can I play Eight Queens unblocked?

Yes. Eight Queens runs entirely in your browser with no download, install, or plugins, so it loads instantly and keeps working even on school or work networks where bigger game sites get blocked.

More games to play

In the mood for more? Try 2048, Memory Match, Lights Out, Minesweeper, or browse all puzzle games and the full games list on Inkplay.

This game has been removed

It's no longer available. Try one of our other games instead.

Browse games