Castling
Everyone knows how to castle. The trouble usually shows up as "wait, why can't I castle right now?" - the confusion is rarely the move itself, but the conditions that block it. And once in a while it is an attacking move, not just a way to tuck the king away.
When castling is an attack
Castle queenside and the rook jumps onto the d-file. If that file is open and the enemy king is sitting on it, one castling move is both a king escape and a check.
Two things happen at once. The white king slips to c1 and gets safe, while the rook arrives on d1 and checks the d8 king down the open d-file. If you think of castling as purely defensive, this is the kind of move you miss.
When you can't castle
Run through these in order to check whether castling is legal:
- Have the king and that rook stayed put the whole game? (Moving away and back still counts as moved.)
- Are all the squares between the king and rook empty?
- Is the king not currently in check?
- Are the squares the king passes over and lands on both safe from attack?
Point 4 trips people up the most. Only the king's squares matter - the rook is allowed to pass over an attacked square. That is why queenside castling is still legal when b1 (or b8) is attacked: b1 is a square only the rook crosses.
Kingside vs. queenside
- Kingside (O-O): king to g1 (g8), rook to f1 (f8). Only two squares to clear, so it is usually quicker and safer.
- Queenside (O-O-O): king to c1 (c8), rook to d1 (d8). One more square to clear, but the rook lands straight onto the central d-file. The check in the board at the top of this page is exactly that rook at work.
How rare is castling in puzzles
Out of the 212,300 puzzles in this site's database, only 61 have castling in the solution. Only two measured tags run smaller, underpromotion at 32 and Boden's mate at 56, and the easiest of the castling puzzles starts at rating 1512. This looks like the same structure as en passant, but 61 is a much smaller sample than en passant's 346, so it doesn't carry the same weight. "The rule is easy but rarely considered as a candidate" is a plausible read, but at this sample size it can't be separated from two others: a small sample can miss easy positions by chance, and some of these puzzles also require calculating what comes after the castle, not just spotting that it's legal.
Practice: Real Puzzles
All three boards below come from those 61 puzzles. Think first, then step through with ►. Even knowing "the answer is castling," you need to see why it works move by move before it shows up in your own games.
1. Answer pawn-grabbing with king safety (Black to move, rating 1512)
White's queen grabs a pawn with Qxg7 while Black's king still sits on e8. The answer is O-O-O: the king tucks away on c8 and the a8 rook lands on d8, buying king safety and rook activity with a single move for the price of one pawn. When White greedily takes another pawn with Bxa6, the b7 bishop simply recaptures, and Black ends up ahead (a bishop for two pawns). Trading a pawn hunt for king safety is the most common shape of castling puzzles.
2. Castling while under attack (White to move, rating 1885)
Pick a move, or use the arrow keys.
Moves
Black's knight has just crashed into h2 with the queen already on h3. The kingside looks like it is collapsing, and the instinct is to react there. White's answer is the calm O-O-O: the king leaves for c1, and the h1 rook stays exactly where it is needed, eyeing the knight that jumped into h2. When Black grabs another pawn with Qxf3, Rxh2 collects the knight, and after the queen trade (Qxe2 Nxe2) White is simply up material. One castling move solved defense and counterattack at the same time.
3. Their king loses the right; yours cashes it in (White to move, rating 1934)
White is down four points of material and Black's queen has infiltrated all the way to a1, with moves like Rd1+, Qxb1+, and Qxc3+ hanging over the position if White does nothing. The sequence is instructive: first Bb5+ forces Kf8, permanently deleting Black's castling rights, and then White calmly plays O-O, hiding the king on g1 and bringing the f1 rook into play. Within two moves, one king lost its castling right and the other used its own. The pawn already on b7 is White's trump for the fight ahead, and sorting out the king comes first.
Common misconceptions
- "You can't castle if the rook is attacked." Wrong - the rules apply to the king, not the rook.
- "Just avoid check." The square the king passes through must be safe too, not only the landing square.
- "As long as the rook hasn't moved." If the king has moved even once, both sides are gone for good; if a rook moved, that side is gone.
How ChessMotifStats treats it
Here castling sits where king safety and tactics overlap. Training separates two questions: "can I castle right now?" (the conditions) and "does castling give a check or activate the rook?" (the tactic). Castling is often missed not for want of knowing the rule, but because it was never considered as a candidate attacking move in the first place.
A few quick questions
Q. Can I castle while the rook is under attack? Yes. The conditions apply only to the king. It doesn't matter if the rook is attacked, or if a square the rook crosses is attacked.
Q. Can I castle out of check? No. You have to deal with the check first. You also can't castle if the king would pass over an attacked square.
Q. If I move my king and put it back, can I still castle? No. The moment the king moves, both castling rights are gone.
References
- Lichess, puzzle theme Castling (the source of this site's puzzle tags). https://lichess.org/training/themes
- Statistics produced by
scripts/analyze-theme-stats.mjs --theme castling; the run is recorded indocs/data/castling-stats.md.
Start training: Castling training
Related: Back Rank Mate · En Passant · All tactics