Chess960 position generator
A random Fischer Random starting position at a click, or any of the 960 by its number, with its FEN and where castling takes the king and rooks.
- a1: not yet chosen
- b1: not yet chosen
- c1: not yet chosen
- d1: not yet chosen
- e1: not yet chosen
- f1: not yet chosen
- g1: not yet chosen
- h1: not yet chosen
Position number
–
········
FEN
X-FEN, read by most Chess960 programs
Choosing a position…Shredder-FEN, castling written as the rooks' files
Choosing a position…About Chess960
Chess960 is chess with the pieces behind the pawns shuffled before the game. Everything else, from how the pieces move to checkmate, stalemate and the clock, is the chess you know. What changes is the opening: with 960 possible starting positions, nobody can prepare long lines in advance, and both players have to think from the first move.
What Chess960 is
In Chess960, also called Fischer Random Chess, the pawns start on their usual squares, but White's king, queen, rooks, bishops and knights are placed on the first rank in a random order, within three rules. Black's pieces stand directly opposite them, so both sides start from the same position. Then the game is played by the ordinary rules of chess, with one extension: castling, which has to work from any starting square of the king and rooks.
Bobby Fischer, the former world champion, proposed it in 1996. His aim was to keep the game about play rather than memory: in the standard position, strong players arrive at the board with opening lines prepared many moves deep, while in Chess960 the position is usually one neither player has seen before. The setup rules were chosen so that every position still feels like chess: each side has a bishop for each colour of square, and the king can castle both ways.
FIDE's Laws of Chess include rules for Chess960, FIDE has held a World Fischer Random Chess Championship, and Lichess and Chess.com both offer it as a game mode. The standard starting position is one of the 960, number 518, so ordinary chess is a special case of it.
The setup rules
White's eight pieces go on the first rank, at random, so that:
- the two bishops stand on squares of opposite colours, one on a light square (b1, d1, f1 or h1) and one on a dark square (a1, c1, e1 or g1);
- the king stands somewhere between the two rooks, so it has a rook on each side to castle with;
- Black mirrors White: each black piece stands on the same file as its white counterpart, on the eighth rank. The pawns fill the second and seventh ranks as usual.
Those rules allow exactly 960 back ranks. The light-squared bishop has 4 squares and the dark-squared bishop 4. The queen takes one of the 6 squares left, and the knights two of the remaining 5, which can be done in 10 ways. The last three squares must hold a rook, the king and a rook, in that order, because the king has to be between the rooks. 4 × 4 × 6 × 10 = 960. Every arrangement is a different position: since there is one king and one queen, no back rank reads the same from h to a as from a to h, so the 960 come in 480 mirror pairs, such as 0 and 959.
Castling in Chess960
Castling is the one rule Chess960 has to extend, because the king and rooks can start almost anywhere. FIDE's rule keeps the result of castling the same as in ordinary chess, whatever the starting squares:
- Castling with the h-side rook, written O-O and still called kingside castling, puts the king on g1 and the rook on f1 (g8 and f8 for Black).
- Castling with the a-side rook, written O-O-O and still called queenside castling, puts the king on c1 and the rook on d1 (c8 and d8 for Black).
The usual conditions apply, stated so that they work from any squares:
- neither the king nor that rook has moved before in the game;
- every square between the king's starting and final squares, and every square between the rook's starting and final squares, the final squares included, is empty apart from the king and that rook;
- the king is not in check, and does not cross or land on a square an enemy piece attacks.
Some castling moves look unusual. If the king already stands on g1, castling O-O moves only the rook, from h1 to f1. If the a-side rook starts on d1, castling O-O-O moves only the king, to c1. And a piece standing on the destination square has to move out first, even when it is the other rook: in position 0 (BBQNNRKR) the king starts on g1 and the rooks on f1 and h1, so White cannot castle O-O until the f1 rook has gone.
Over the board, the cleanest way to castle is to take the king off the board, move the rook to its square, then put the king on its square; FIDE's Chess960 rules recommend this order. Saying that you are castling before you touch anything avoids any doubt when the king or rook only moves one square, where castling could look like an ordinary move. Online, many apps let you castle by moving the king onto its own rook, and chess engines write a Chess960 castle that way too. The generator above lists, for each position, where both castling moves go and which squares must be cleared first.
How the numbers work
Each position has a number from 0 to 959, in the scheme Reinhard Scharnagl devised, which most chess software uses, Lichess included. So “position 518” means the same back rank everywhere. To turn a number into a position, divide it again and again and use the remainders. Here is position 518:
- The light-squared bishopDivide by 4: 518 = 4 × 129 + 2. The remainder (0 to 3) picks b1, d1, f1 or h1, so remainder 2 puts the bishop on f1.
- The dark-squared bishopDivide the quotient by 4: 129 = 4 × 32 + 1. The remainder picks a1, c1, e1 or g1, so 1 puts the bishop on c1.
- The queenDivide by 6: 32 = 6 × 5 + 2. The remainder counts the empty squares from a1, starting at 0: the empty squares are a1, b1, d1, e1, g1 and h1, and number 2 is d1.
- The knightsThe last quotient, 5, is a row of the knight table: -N-N-, the second and fourth of the five squares left (a1, b1, e1, g1, h1). The knights go on b1 and g1.
- Rook, king, rookThe three squares left, a1, e1 and h1, take a rook, the king and a rook, in that order. The result is RNBQKBNR, the standard position.
Reading a position back to its number runs the same steps in reverse: number = 4 × (4 × (6 × knights + queen) + dark bishop) + light bishop. Position 0 is BBQNNRKR, with every choice at its first option, and 959 is RKRNNQBB, every choice at its last. Type any number into the generator to see its position, or open position 518 to check the example.
- 0NN---
- 1N-N--
- 2N--N-
- 3N---N
- 4-NN--
- 5-N-N-
- 6-N--N
- 7--NN-
- 8--N-N
- 9---NN
Playing over the board
Set out the pawns as usual, then White's pieces from a1 to h1 in the order the generator shows, and Black's pieces opposite them. Before the clock starts, both players should check that the bishops are on opposite colours, the king is between the rooks and every black piece faces its white counterpart. Write the position number on your scoresheets: it records the starting position in one figure, and in a PGN file the position is given with a SetUp tag and a FEN tag, as for any game that does not start from the standard position.
With no screen to hand, an ordinary six-sided die draws a fair position just as well:
- Light-squared bishopRoll: 1 to 4 picks b1, d1, f1 or h1. Roll again on a 5 or 6.
- Dark-squared bishopRoll: 1 to 4 picks a1, c1, e1 or g1. Roll again on a 5 or 6.
- QueenRoll: 1 to 6 picks one of the six empty squares, counting from the a-file.
- First knightRoll: 1 to 5 picks one of the five empty squares. Roll again on a 6.
- Second knightRoll: 1 to 4 picks one of the four empty squares. Roll again on a 5 or 6.
- Rooks and kingThe three empty squares take a rook, the king and a rook, from left to right.
Every one of the 960 positions is equally likely this way. If you play a short match, agree before the first game whether you keep one position with colours reversed, which is the fairest test of a position, or draw a new one for every game.
Tips for the opening
Without memorised lines, the opening is about the ideas behind them, and those still hold: put pawns in the centre, bring out the pieces, get the king safe and connect the rooks. What changes is where the dangers and the easy moves are. A few habits help in any position:
- Look for loose pawns before your first move. In the standard position every pawn starts defended by a piece. In 600 of the 960 positions at least one pawn starts with no defender at all: in position 0 it is the e2 pawn, which neither knight, the queen nor the king covers. Know where yours are and where your opponent's are.
- Open your bishops' diagonals. In position 0 the bishop on a1 looks along the long diagonal at g7, the pawn in front of Black's king, and the bishop on b1 looks at h7. One pawn move, b3 for the bishop on a1, opens its diagonal, and a bishop aimed at the king early can decide the opening.
- Plan where your king will live. Castling may need the queen, a knight or even a rook out of the way first, so decide early which side you want and clear it. In some positions the king is already safe where it stands, and castling can wait.
- Mind knights in the corner. A knight on a1 or h1 has one square to go to at the start, so it takes longer to bring into play; plan its route.
- Read the position from Black's side. Both players start from the same setup, so every target you find in your opponent's camp is also a target in yours.
After the game, go through the opening as you would any other: where did a piece stand badly, which pawn did you leave loose, how long did castling take? Those lessons carry over from one position to the next, even though the position itself will rarely come up again.
Frequently asked questions
Is Chess960 the same as Fischer Random Chess?
Yes. Bobby Fischer proposed the variant in 1996 and it was first known as Fischer Random Chess. Chess960, after its number of starting positions, is the name FIDE's rules and most chess sites use today.
Why are there exactly 960 starting positions?
The light-squared bishop has 4 squares to choose from and the dark-squared bishop 4 more. The queen then takes one of the 6 empty squares, and the two knights two of the 5 left, which can be done in 10 ways. The rooks and the king fill the last three squares in the only legal order, rook, king, rook. 4 × 4 × 6 × 10 = 960.
Is the normal starting position one of the 960?
Yes. In the standard numbering it is position 518, RNBQKBNR. A random draw lands on it once in 960 draws on average, and the game is then ordinary chess.
How does castling work in Chess960?
The king and rook end on the same squares as in ordinary chess: castling with the h-side rook (O-O) puts the king on g1 and the rook on f1, castling with the a-side rook (O-O-O) puts the king on c1 and the rook on d1, and Black castles the same way on the eighth rank. Neither piece may have moved, every square either one crosses or lands on must be empty apart from the two of them, and the king may not be in check, cross an attacked square or end on one.
Does Black get the same position as White?
Yes. Black's pieces stand directly opposite White's: if White has a knight on b1, Black has a knight on b8. Both sides start from the same position, so neither gets a better one by chance.
Can I analyse a Chess960 position on Aback Chess?
You can open any position on the analysis board, which plays by the standard rules. In 18 of the 960 positions the king starts on e1 with the rooks on a1 and h1, and castling there is the same in both games, so it works as usual. Every other position opens without castling rights, because the standard rules cannot castle from it; every other move follows the rules.
What is the difference between X-FEN and Shredder-FEN?
Both are FEN with castling made clear for Chess960. X-FEN keeps the usual K, Q, k and q, which mean the rook on the king's h-side or a-side, so a Chess960 starting position reads like any other FEN. Shredder-FEN writes the files of the rooks that can still castle instead, such as HAha for the standard position. The generator gives both.