Castling in standard chess is one king move that also relocates a rook. The king moves two squares towards the rook, then the rook moves to the square the king crossed. It is legal only if neither that king nor that rook has previously moved, the squares between them are empty, and the king is not in check or passing through or landing on an attacked square.

The rule comes from article 3.8.2 of the FIDE Laws of Chess, which took effect on January 1, 2023 and remain listed in the federation's official handbook. The explanation below concerns the standard starting position, rather than the separate castling procedures for Chess960.

Standard chess castlingWhite's final squaresBlack's final squares
KingsideKing g1, rook f1King g8, rook f8
QueensideKing c1, rook d1King c8, rook d8

How do kingside and queenside castling work?

For White to castle kingside, the king goes from e1 to g1 and the rook from h1 to f1. The f1 and g1 squares must be vacant before the move. In the initial position they are occupied by a bishop and knight, so those pieces must first move out of the way.

Queenside castling sends White's king from e1 to c1 and the rook from a1 to d1. Here, b1, c1 and d1 must all be empty because they lie between the king and the rook. Black follows the same pattern on the eighth rank. In either direction, it is the king that moves two squares, although the rook travels a different distance on each side.

The notation is 0-0 for kingside and 0-0-0 for queenside castling in the FIDE laws. Both count as a single move by the player. Moving the king and rook as two separate turns would not reproduce a legal castling move and could also destroy the remaining right to castle.

Can you castle after being in check?

Having been in check earlier does not automatically remove castling rights. The question is how that check was answered and what the position is now. If a player blocked the attack with another piece or captured the attacker without moving the king or relevant rook, the earlier check alone does not prevent a later legal castle.

A king that has already moved loses its right to castle permanently, even if it returns to its starting square. A rook that has moved cannot later participate in castling merely by returning home. Moving one rook does not, by itself, remove the possibility of castling with the other rook if the king has never moved.

Being in check now is different. The king cannot escape that check by castling. It must also be safe on the square it crosses and on its destination. For White's kingside castle, those tests apply to e1, f1 and g1. For White's queenside castle, the king's path is e1, d1 and c1.

Can you castle if the rook is attacked?

An attack on the rook's starting square is not itself a ban on castling. The special safety tests concern the king's starting square, crossing square and destination. The rook still has to be the original eligible rook, and every square between it and the king must be empty.

That distinction answers a common queenside puzzle. White's b1 square must be empty, because it lies between the a1 rook and e1 king. But an enemy attack on b1 alone does not prohibit the move: the king does not pass through b1. An attack on d1 or c1 would prohibit it.

FIDE's definition of an attacked square also matters. Under article 3.1.3, a piece can attack a square even when moving there would expose its own king. A player should therefore not assume that an apparently pinned enemy piece can simply be ignored when checking the king's route.

Which piece should you touch first when castling?

On a physical board, use one hand and move the king first. Article 4.4 says that deliberately touching a rook and then the king prevents castling on that side on that move, with the ordinary touch-move requirement applying. Touching the king and a rook commits the player to castle on that side if it is legal.

If that intended castle is illegal, the laws generally require another legal king move, which can include castling with the other rook. If the king has no legal move, the player may make another legal move. Learning the eligibility checks before touching either piece helps avoid that problem in a tournament.

For readers comparing unusual sporting rules, our guides also explain tennis tie break serve order, badminton scoring changes and football's offside rule. Each sport has its own tests; a familiar-looking position can still require a careful look at the governing rule.