Check three things, in this order
If your chess app refuses to castle, first check whether the king and chosen rook still have castling rights. Next check that every square between them is empty. Finally check the king’s starting square, crossing square and destination for enemy attacks. Failing any one test is enough to make the move illegal.
This order separates history from the visible board. A king standing on e1 can look perfectly ready to castle even after it has moved away and returned. Conversely, a rook under attack can sometimes take part in a completely legal castle. The question is not whether the position looks dangerous; it is which condition fails.
The examples below are composed standard-chess positions. They isolate one condition at a time so you can repeat the same diagnosis on your own board. A FEN supplies the history assumptions; it does not prove those assumptions came from a real game.
Clear path, retained rights and safe king squares: O-O is legal.
Position FEN
4k3/8/8/8/8/8/8/R3K2R w KQ - 0 1Step 1: read the history, not just the pieces
Both castling rights disappear permanently when the king moves. A rook move permanently removes the right on that rook’s side. Capturing the original rook also prevents castling with it; bringing a different rook to that corner does not restore the right.
Compare the first two diagrams. Their piece placement is identical, but the second FEN has no castling rights. No amount of clearing f1 and g1 can solve that historical problem. If you imported a game, replay the earlier king and rook moves. If you typed a FEN, inspect its third field: KQkq records rights for both players, while a dash records none.
Do not “repair” a disputed position by turning the rights on merely because the pieces occupy their home squares. Correct the FEN only when you know the relevant history. Otherwise state that the rights are unknown and analyse both assumptions separately.
Same pieces, no rights: the king or rooks have already moved.
Position FEN
4k3/8/8/8/8/8/8/R3K2R w - - 0 1Step 2: inspect every intervening square
For White’s kingside castle, f1 and g1 must be empty. For the queenside castle, d1, c1 and b1 must be empty. The b-file square is easy to forget because the king does not land there, but it is still between the king and the rook.
A friendly knight on b1 prevents queenside castling. So would any other piece, friendly or enemy. You do not capture a piece by castling, and the rook cannot jump over a blocker. The same tests apply on rank 8 for Black.
A useful board exercise is to trace the entire king-to-rook interval with your finger, then separately trace only the king’s route. They are different sets of squares. Keeping them separate prevents the next common error.
The knight on b1 prevents queenside castling, even though the king will not cross b1.
Position FEN
4k3/8/8/8/8/8/8/RN2K3 w Q - 0 1Pause at any move in a diagram, then open that exact position in Chat to ask about it or in Coach to practice.
Step 3: inspect the king’s route
The king may not castle while in check, through check or into check. For White kingside, inspect e1, f1 and g1; queenside, inspect e1, d1 and c1. A piece that attacks the crossing square can prohibit castling even when it does not attack either royal piece now.
In the crossing-square example, the black rook controls f1 down the f-file. White’s king on e1 is not currently checked and g1 is safe, but O-O is still illegal. Moving the king directly to g1 in your mental picture skips the decisive test.
When checking attacks, remember that pawn attacks are diagonal rather than straight ahead. A pinned enemy piece can still attack a square for purposes of king movement. If the attack geometry is unclear, identify the exact attacker and trace its route rather than counting how many pieces stand nearby.
The rook on f8 attacks f1. White cannot castle through it.
Position FEN
4kr2/8/8/8/8/8/8/4K2R w K - 0 1Two suspicious-looking cases that are legal
An attack on b1 alone does not prevent White’s queenside castle. The square must be empty, but the king does not cross it. In the example, a black rook controls b1 while e1, d1 and c1 remain safe. O-O-O is legal.
Likewise, the rook may be under attack before castling. The restriction is on the king’s safety, not the rook’s. In the final example, the black rook attacks White’s rook on h1, but the king’s path is safe. Castling kingside moves that rook away as part of the legal move.
These are rule demonstrations, not recommendations to castle into every such position. A legal castle can still be strategically poor. Once legality is settled, inspect the opponent’s threats against the resulting king position.
b1 is attacked but empty. The king’s route remains safe.
Position FEN
1r2k3/8/8/8/8/8/8/R3K3 w Q - 0 1White’s rook is attacked, but the king’s route is safe.
Position FEN
4k2r/8/8/8/8/8/8/4K2R w K - 0 1Turn a refusal into a useful question
Copy the full FEN or import the PGN and select the move where castling was refused. Write the side you wanted to castle on. Then identify the first failing checklist item: right absent, blocker present, king checked, crossing square attacked, or destination attacked.
If none appears to fail, verify that you are using standard chess and the interface’s expected input gesture. A board editor permits arrangement changes that a play board does not. Ask Chat to explain the exact FEN, including the rights field, and use Coach when you want to compare legal plans after the rule issue is resolved.
Check your understanding
Continue learning
Sources and editorial notes
Examples are composed for teaching unless stated otherwise. Legal replay is checked with chess.js; this does not prove that every composed position arose in a real game. Demonstration lines illustrate an idea and are not claimed to be the unique best defense.
Report a correction