LibreChessChess, explained simply

Chess rules

Castling in Chess: Rules, Kingside & Queenside

Published Updated

LBy
Sources and chess examples are checked before publication. How LibreChess verifies its content.

Castling is the only move where you move two pieces at once: the king steps two squares towards a rook, and that rook moves to the square on the king’s other side. It often improves king safety and rook activity, but several conditions must be met and castling is not automatically the safest choice.

On this page
  1. Kingside and queenside
  2. The five rules that forbid castling
  3. What is and isn’t allowed
  4. Keep learning

Kingside and queenside

There are two ways to castle. Kingside (“short”, written O-O) is towards the h-file rook: for White, the king goes to g1 and the rook to f1. Queenside (“long”, written O-O-O) is towards the a-file rook: for White, the king goes to c1 and the rook to d1. Queenside requires three intervening squares to be empty rather than two, and the two destinations leave different pawn shelters and rook placements.

White can play O-O (kingside) or O-O-O (queenside). Move the king two squares toward a rook.

The five rules that forbid castling

Castling is legal only if every one of these is satisfied. The first two cost you the right permanently; the last three only block castling for the moment.

Memory aid: you can’t castle in check, through check, or into check — and the king and rook must both be untouched with the path clear.

What is and isn’t allowed

A few clarifications that trip people up: the rook is allowed to be attacked, and for queenside castling the rook passes over b1 or b8 — only the king’s starting, crossing, and destination squares are tested for attack. A king that was in check earlier in the game may still castle later if it did not move and all the conditions now hold. Castling is often useful for king safety, but the position decides whether and where to castle.

Can you castle out of check?No. If your king is currently in check you must answer the check another way. Castling is forbidden while in check, through check, and into check.
Can you castle if the rook is attacked?Yes. Only the king’s squares matter. An attacked rook — or, queenside, an attacked b1/b8 square the king never touches — does not prevent castling.
Can you castle if your king moved earlier and came back?No. Once the king has moved at all, castling rights are gone permanently, even if it returns to its starting square.

Play free vs Stockfish