ecocodes

Castling in named opening lines

Most names are given before the king moves. The exceptions are revealing.

Most named lines end before anyone castles. Of the 3,865 lines in the list, 2,952 finish with both kings still on their starting squares; White has castled in 665, Black in 600, and both in 352. When castling does happen it is nearly always kingside: queenside castling appears in only 27 lines.

Why most lines stop short of castling

The answer is mostly a matter of length. The median named line is 9 plies long, that is, it ends around move 5. In the lines where White does castle, the median castling move is move 6; for Black it is move 5. So most names are attached before the point at which castling typically appears in the list.

The link with length is clear when the lines are split. Among lines of 15 plies or more, 75% include castling by at least one side; among shorter lines the share is 14%.

Castling by volume

  1. Volume A12%102 of 823
  2. Volume B11%88 of 781
  3. Volume C26%321 of 1250
  4. Volume D30%195 of 644
  5. Volume E56%207 of 367
Share of named lines in which at least one side has castled, by ECO volume.

Volume E stands out: 56% of its lines include castling, against 12% in volume A and 11% in B. Volume E also has the longest lines, with a median of 12 plies, which leaves more room for castling before a name is reached.

Which king, volume by volume

The volumes differ sharply in which side has castled when the name is reached:

VolumeOnly White castledOnly Black castledBoth castled
A332346
B341935
C2121396
D289968
E694107

In volume C, White alone has castled in 212 lines and Black alone in only 13. Volumes D and E show the opposite: Black alone has castled in 99 lines of D and 94 of E, White alone in 28 and 6. In the open games of volume C the white king tends to be the first one tucked away within the named moves; in the queen’s pawn games of D and E it is the black king.

Openings where castling is part of the line

By opening name, the share of lines that include castling ranges widely. Among names with at least fifty lines, King’s Indian Defense (84%), Ruy Lopez (65%) and Grünfeld Defense (59%) have the highest shares, while Queen’s Pawn Game (5%) and Indian Defense (0%) have the lowest. Sixty-seven codes go further: every line filed under them ends with both kings castled, from A39 to E99.

The latest castling in any named line comes on move 13 for White, in Semi-Slav Defense: Meran Variation, Rellstab Attack, and on move 13 for Black, in Italian Game: Giuoco Piano, Therkatz-Herzog Variation.

Who castles first

In the 352 lines where both kings castle, Black is first in 182 and White in 170. The near-even total hides differences between volumes. Black castles first in 32 of 46 such lines in volume A; 21 of 35 such lines in volume B; 5 of 96 such lines in volume C; 38 of 68 such lines in volume D; 86 of 107 such lines in volume E.

The earliest castling in the list is White’s on move 4 in King’s Indian Attack: Wahls Defense, and Black castles on move 4 in that same line, the earliest for Black too.

Queenside castling and opposite sides

White castles queenside in 25 lines, Black in 2. In 19 lines the kings end up on opposite wings. By opening name they come from Sicilian Defense (12), Queen’s Gambit (2), Alekhine Defense (1). The table lists the first ten.

LineCodeWhite castlesBlack castles
Alekhine Defense: Four Pawns Attack, Tartakower VariationB03short, move 11long, move 10
Sicilian Defense: Richter-Rauzer Variation, Classical VariationB64long, move 8short, move 8
Sicilian Defense: Richter-Rauzer Variation, Classical VariationB64long, move 8short, move 8
Sicilian Defense: Richter-Rauzer Variation, Classical VariationB65long, move 8short, move 8
Sicilian Defense: Richter-Rauzer Variation, Rauzer AttackB65long, move 8short, move 8
Sicilian Defense: Dragon Variation, Classical Variation, Grigoriev VariationB72long, move 9short, move 8
Sicilian Defense: Dragon Variation, Yugoslav Attack, Modern LineB76long, move 9short, move 8
Sicilian Defense: Dragon Variation, Yugoslav AttackB78long, move 10short, move 7
Sicilian Defense: Dragon Variation, Yugoslav Attack, Chinese DragonB78long, move 10short, move 7
Sicilian Defense: Dragon Variation, Yugoslav Attack, Old LineB78long, move 10short, move 7

Lines in which both kings are castled are most frequent in volume E (107) and volume C (96), and rarest in volume B (35). Just over half of volume B is the Sicilian Defense, whose named lines in this list mostly end before either side castles: only 17% of its 400 lines include castling.

Castling as the naming move

In 105 lines the castling move is itself the last move of the line, so the name is given at the very moment the king moves. Fifty-five of these end with White castling and 50 with Black castling. Of the 25 lines in which White castles queenside, 18 carry the name Sicilian Defense, which makes queenside castling by White largely a Sicilian matter in this list.

On the code pages

Each code page states whether and when each side has castled at the end of its reference line, and the table of lines marks every line that ends with a castled king. These are facts about the named sequence only; in a real game the moves after the name may change everything.

Sources

Opening names and move sequences: lichess-org/chess-openings (CC0), retrieved 2026-10-28. All counts replayed and computed by ecocodes with python-chess; definitions on How to read a code page.

Related pages