Castling is illegal whenever one of the conditions in the FIDE Laws of Chess is not met. In practice, there are two different kinds of obstacle: some make a player lose castling rights permanently, while others make castling temporarily unavailable in the current position. That distinction clears up a common misunderstanding: being in check now does not erase castling rights for the rest of the game, but having moved the king earlier does.
The quick test: four questions before castling
In standard chess, castling is legal only if all four checks below are satisfied:
- Has the king never moved? If it left its original square at any earlier point, even if it later returned, castling rights are gone.
- Has the chosen rook never moved? If that rook moved and came back, castling with it is no longer allowed. The other rook may still retain its own castling right.
- Are all squares between king and rook empty? Every intervening square must be vacant, regardless of whether the blocking piece is friendly or hostile.
- Are the king's three relevant squares free from attack? The king's starting square, the square it crosses, and its destination square must not be attacked by an opposing piece.
This follows directly from Article 3.8.2 of the FIDE Laws of Chess, which defines castling as one king move involving a rook and separates permanent loss of the right from temporary restrictions.
Losing the right is not the same as being unable to castle right now
FIDE states that castling rights are lost if the king has already moved or, for a particular side, if the corresponding rook has already moved. That loss is permanent. It does not matter if the king or rook later returns to its original square.
Two other conditions only prevent castling while they remain true: one of the king's relevant squares is attacked, or any piece stands between king and rook. If the check is resolved or the path is cleared later, castling may become possible again — provided the king and rook have not already lost the right.
Which attacked squares actually matter?
The key is to inspect the king's path, not the rook's path as a separate safety test. For White's kingside castling, check e1, f1, and g1. For queenside castling, check e1, d1, and c1. For Black, the same logic applies to e8-f8-g8 and e8-d8-c8.
If the starting square is attacked, the king is in check and cannot castle. If the transit square is attacked, the king cannot “castle through check.” If the destination is attacked, the king would finish the move in check, which is also illegal.
There is another important point in FIDE's definition of an attack: a piece is still considered to attack a square even when it is pinned and cannot legally move there because doing so would expose its own king. So, for castling, it is not safe to reason that “the piece is pinned, therefore its attack does not count.”
The rule that does not apply to the rook
The rook may be under attack and castling can still be legal. The Laws do not require the rook's starting square to be safe. The attacked-square test applies to the king's starting square, transit square, and destination square.
Queenside castling makes this especially clear. For White, b1 must be empty because it lies between the king on e1 and the rook on a1, but b1 may be attacked. The king neither starts on, crosses, nor finishes on b1. The same is true of b8 when Black castles queenside.
By contrast, d1 cannot be attacked during White's queenside castling, even though d1 is also the rook's final square, because the king crosses d1 on its way to c1. The correct question is not whether the rook is “moving through danger”; it is whether any of the king's three relevant squares is attacked.
Practical table: allowed or forbidden?
| Situation | Castling | Reason |
|---|---|---|
| The king moved earlier and returned | Permanently forbidden | Castling rights were lost when the king moved. |
| The rook on that side moved earlier and returned | Forbidden on that side | The right to castle with that rook was lost. |
| The king is in check | Forbidden now | The king's starting square is attacked. |
| The king's transit square is attacked | Forbidden now | The king cannot cross an attacked square. |
| The king's destination is attacked | Forbidden now | The king cannot finish the move in check. |
| A piece stands between king and rook | Forbidden now | The entire corridor must be empty. |
| The rook is under attack | May be allowed | An attack on the rook alone does not prevent castling. |
| In queenside castling, b1 or b8 is attacked but empty | May be allowed | That square is not part of the king's path. |
| In queenside castling, b1 or b8 is occupied | Forbidden now | There is a piece between king and rook. |
| The king was in check earlier but never moved | May be allowed later | Having been checked does not erase the right; the issue is whether the king is attacked when castling is attempted. |
A position-checking routine that prevents mistakes
When evaluating a position, use this order:
- History: do the king and chosen rook still have castling rights?
- Empty corridor: mentally remove the king and rook and check every square between them.
- King's three squares: mark the start, transit, and destination.
- Opponent attacks: check whether any of those three squares is attacked, including by a pinned piece.
For White's kingside castling, that means: rights preserved; f1 and g1 empty; e1, f1, and g1 not attacked. For White's queenside castling: rights preserved; d1, c1, and b1 empty; e1, d1, and c1 not attacked. Apply the same test on the eighth rank for Black.
An over-the-board trap: the order in which pieces are touched
In over-the-board play governed by the FIDE Laws, there is also a procedural rule. If a player deliberately touches the king and then the rook intending to castle, the player must castle on that side if it is legal. If the rook is touched first and then the king, the player may not castle on that side on that move; the touch-move rule applies. This does not change the positional requirements for castling, but it can change what the player is required to play.
In one sentence: what determines whether castling is legal?
Castling is legal when the right still exists, the space between king and rook is empty, and the king does not start, cross, or finish the move on an attacked square. The rook itself does not have to be safe from attack. That formulation turns the FIDE wording into a practical test for most standard-chess castling questions.
Primary source: FIDE Handbook — Laws of Chess, effective from 1 January 2023, especially Articles 3.1.3, 3.8.2, 3.9, 3.10, and 4.4.





