To castle in chess:

  • the squares between the king and the rook (castle) must be empty.
  • neither the king nor the rook must have moved.
  • the king must not be in check, move through check, or castle into check.*
  • whether or not the rook is being attacked at the time of castling does not matter.
  • the king moves exactly two squares towards the rook and the rook moves to the opposite side of the king.
  • in kingside castling, the king moves to g1 (white) or g8 (black) and the rook moves from h1 to f1 (white) or h8 to f8 (black).
  • in queenside castling, the king moves to c1 (white) or c8 (black) and the rook moves from a1 to d1 (white) or a8 to d8 (black).

The objective of castling in chess is to bring the king behind a wall of protective pawns and to bring the rook into play at the same time.


*: to clarify this rule, this means that, for instance, if the White King is going to castle kingside, moving from e1 to g1, there must be no Black pieces that threaten any of the squares e1, f1 or g1. Similarly, if the White King were to castle queenside, there must be no Black pieces that threaten the squares e1, d1 or c1.