← The Chronicle · Learn the Moves
When Can You Castle? A Legal-Move Checklist

In standard chess, castling moves the king two squares towards a rook. That rook moves to the square the king crossed. Together they count as one move.[1]
For White, kingside castling puts the king on g1 and rook on f1. Queenside puts them on c1 and d1. Black uses the matching squares on rank eight.[1]
Check three things

Read the diagram description
White king e1 and rook h1; Black king a8 and rook h8. The open h-file attacks the rook, not the king route. Composed position A: White can castle kingside although h1 is attacked.[1] The king’s e1–f1–g1 route is safe.[1]
View full illustration (opens in a new tab)
First, has the king or that rook moved before? Returning home does not restore a lost castling right. Second, is every square between them empty? Third, is the king’s starting, crossing and destination square safe?[1]
Kingside, White checks e1, f1 and g1 for attacks. Queenside, it checks e1, d1 and c1. The b1 square must be empty for queenside castling, but it need not be safe.[1]
Compare the pictures
In Position A, Black attacks White’s rook on h1. The king’s route is safe and the pieces have not moved, so White can castle kingside.

Read the diagram description
White king e1 and rook h1; Black king a8 and rook f8. The open f-file attacks f1, crossing square for castling. Composed position B: White cannot castle kingside because f1, the king’s crossing square, is attacked.[1]
View full illustration (opens in a new tab)
In B, Black’s rook attacks f1 instead. That is the king’s crossing square, so White cannot castle kingside.
In C, b1 is attacked but empty. With the king’s route safe and the stated rights, White can castle queenside. These are separate practice setups, not recommended moves from a recorded game.
Do not ignore a pinned attacker
An enemy piece can count as attacking a square even when moving it would expose its own king.[1] Read the guide to pins for examples.

Read the diagram description
White king e1 and rook a1; Black king h8 and rook b8. The open b-file attacks b1, outside the king route. Composed position C: b1 is empty but attacked.[1] White can castle queenside because e1, d1 and c1 are safe.[1]
View full illustration (opens in a new tab)
Try changing one condition on a spare board. Can you explain why castling becomes legal or illegal? In a tournament, ask the arbiter if the procedure is unclear.
Sources
Related stories

Learn the Moves
Check, Checkmate and Stalemate: What Is the Difference?
Learn the difference between check, checkmate and stalemate with three exact positions, legal replies and a short practice check.
Read the story →
Learn the Moves
Can a Pinned Piece Give Check? Absolute and Relative Pins Explained
Pinned does not always mean frozen. Three exact positions separate legal moves, attacks and material risk.
Read the story →