Castling in chess
Updated
To castle, move your king two squares toward a rook, then put that rook on the square the king just crossed. You can only castle if neither piece has moved yet, the squares between them are empty, and your king is not in check, doesn't pass over an attacked square and doesn't land on one.
Kingside and queenside
You can castle on either side, but only once per game. It is the only move in chess where you move two pieces at once, and the only time the king moves two squares.
Black castles the same way on the other side of the board: kingside the king goes e8 to g8 and the rook h8 to f8; queenside the king goes e8 to c8 and the rook a8 to d8. Queenside castling moves the rook three squares instead of two, because there is one more square between the king and that rook.
Try it
The king is selected. Tap g1 to castle kingside or c1 to castle queenside, then reset and try the other side.
When you can't castle
Castling is not allowed if any of these is true:
- Your king has already moved, even if it moved back to its starting square.
- The rook has already moved. Castling with the other rook may still be possible if that one hasn't moved.
- A piece stands between the king and the rook, yours or your opponent's.
- Your king is in check right now.
- The king would pass over an attacked square: f1 or d1 for White, f8 or d8 for Black.
- The king would land on an attacked square, because that would be moving into check, which is never allowed.
One detail catches people out: the rook may cross an attacked square. When castling queenside the rook passes over b1 (b8 for Black), and it doesn't matter if an enemy piece attacks that square. Only the king's path counts.
Why castle?
Castling does two jobs in one move. It tucks your king into the corner behind a wall of pawns, away from the centre where the fighting starts, and it brings a rook from the corner toward the middle where it can join the game. That is why most opening advice says to castle early, once your knight and bishop on that side are out of the way.
A king that stays in the centre is a target, especially against attacking players like Rosa the Gambiteer, who loves to throw pawns at a king.
Questions people ask
- Can you castle out of check?
- No. If your king is in check you must get out of check another way. Once the check is over you may castle on a later move, as long as the king and that rook still haven’t moved.
- Can you castle if the rook is attacked?
- Yes. Only the king’s squares matter: the square it starts on, the square it passes over and the square it lands on.
- Can you castle queenside if b1 is attacked?
- Yes. When castling queenside only the rook passes over b1 (b8 for Black), and the rook is allowed to cross an attacked square.
- Can you castle if the king moved and came back?
- No. Once the king has moved at all, castling is gone for the rest of the game, on both sides.
- Which piece do you touch first?
- The king. Castling counts as a king move. In over-the-board games, picking up the rook first can count as a rook move under the touch-move rule.