TeachMeChess.app

Chess rules

How to Castle in Chess

Castling is a single move in which the king moves two squares toward a rook on its starting rank and that rook moves to the square the king crossed.

Castling is the only move in chess that moves two pieces. Its purpose is practical: it gets the king away from the centre and brings a rook into the game. Each player may castle once per game.

Kingside castling (written O-O): the king goes from the e-file to the g-file and the h-rook goes to the f-file. Queenside castling (written O-O-O): the king goes to the c-file and the a-rook goes to the d-file.

See it on the board

  1. Kingside castling: the king goes from e1 to g1 and the h1 rook hops to f1.
  2. Queenside castling: the king goes from e1 to c1 and the a1 rook hops to d1.
  3. Here White cannot castle kingside: the king would pass through f1, which the black rook attacks. Queenside castling is still fine.

When you can and cannot castle

  1. The king has not moved earlier in the game.
  2. The rook you are castling with has not moved earlier in the game.
  3. Every square between the king and that rook is empty.
  4. The king is not in check at the moment. (Having been in check earlier does not matter.)
  5. The king does not pass over a square attacked by an enemy piece.
  6. The king does not end on a square attacked by an enemy piece.

Practise it: Castling lesson

Common questions

Can you castle out of check?

No. If your king is in check you must deal with the check another way. You may castle on a later move if the king has not moved.

Can you castle if the rook is attacked?

Yes. Only the squares the king stands on, crosses and lands on matter. The rook may be attacked, and in queenside castling it may pass over an attacked b-file square.

Can you castle after moving the king back to its starting square?

No. Once the king has moved, the right to castle is lost for the rest of the game.

Which piece do you touch first?

In over-the-board play under FIDE rules, castling is a king move: touch the king first and use one hand. On this site, move the king two squares and the rook follows.

Official rule and variations

This page describes the rule as set out in the FIDE Laws of Chess (in force from 1 January 2023), Article 3.8 (the king). You can read the official text in the FIDE Handbook. Teach Me Chess is not affiliated with FIDE.

In Chess960 (Fischer Random) the pieces start on different squares and castling works differently. Casual house rules sometimes allow castling out of check — that is not part of the official rules.

More rules: What Is En Passant in Chess? · Pawn Promotion in Chess · What Is Stalemate in Chess? · What Is Checkmate in Chess? · All chess rules

Written by the Teach Me Chess editorial team · Last reviewed · How we write and check our lessons