The short answer
Across 4 independent positions, castling was best in 3 of 4 — and where it was not, it trailed by only 0.05. In other words, it was the right call in every position we looked at.
What we are testing
"Castle early" is taught as one of the three opening principles, alongside taking the centre and developing pieces. But is there measurable value in castling one move sooner? We compared castling with the other candidate moves in this Italian Game position.
Black is to move here, so the numbers are from Black’s point of view. They are all slightly negative because White, moving first, is a touch better, which is normal for an opening. What matters is the difference between the moves.
How we tested it
Testing a rule of thumb in one position cannot tell you whether you are seeing the rule or just that position. So we picked 4 positions of different character — open and closed, White to move and Black to move. In each one, every candidate is played and the resulting position is searched. All the numbers are real output, not estimates.
Position by position
| Position | Best move | Move tested | Gap |
|---|---|---|---|
| In the Italian Game (Black to move) | d6 −0.23 | O-O −0.28 | 0.05 |
| In the Four Knights (Black to move) | O-O −0.27 | O-O −0.27 | same |
| In the Queen’s Gambit Declined (Black to move) | O-O −0.15 | O-O −0.15 | same |
| Castling long instead (White to move) | O-O-O +0.51 | O-O-O +0.51 | same |
Position 1|In the Italian Game (Black to move)
1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.c3 Nf6 5.d3
The best move was d6 (−0.23). O-O scored −0.28, a gap of 0.05.
Tap a candidate move to change the board
| Move | Evaluation | Diff vs best |
|---|---|---|
| d6 | −0.23 | best |
| a6 | −0.23 | 0.00 |
| O-O | −0.28 | −0.05 |
| h6 | −0.28 | −0.05 |
| Rf8 | −1.23 | −1.00 |
| Ng4 | −1.33 | −1.10 |
Position 2|In the Four Knights (Black to move)
1.e4 e5 2.Nf3 Nc6 3.Nc3 Nf6 4.Bb5 Bb4 5.O-O
Here O-O was the best move (−0.27).
Tap a candidate move to change the board
| Move | Evaluation | Diff vs best |
|---|---|---|
| O-O | −0.27 | best |
| Bxc3 | −0.61 | −0.34 |
| d6 | −1.18 | −0.91 |
| a6 | −1.32 | −1.05 |
| Nd4 | −1.40 | −1.13 |
Position 3|In the Queen’s Gambit Declined (Black to move)
1.d4 d5 2.c4 e6 3.Nc3 Nf6 4.Bg5 Be7 5.e3 h6 6.Bh4
Here O-O was the best move (−0.15).
Tap a candidate move to change the board
| Move | Evaluation | Diff vs best |
|---|---|---|
| O-O | −0.15 | best |
| Ne4 | −0.20 | −0.05 |
| Nbd7 | −0.20 | −0.05 |
| b6 | −0.22 | −0.07 |
| dxc4 | −0.35 | −0.20 |
Position 4|Castling long instead (White to move)
1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6.Be3 e5 7.Nb3 Be7 8.f3 O-O 9.Qd2 Be6
Here O-O-O was the best move (+0.51).
Tap a candidate move to change the board
| Move | Evaluation | Diff vs best |
|---|---|---|
| O-O-O | +0.51 | best |
| a4 | +0.26 | −0.25 |
| h4 | +0.20 | −0.31 |
| Be2 | +0.19 | −0.32 |
| Rd1 | −0.27 | −0.78 |
| g4 | −0.54 | −1.05 |
Why the numbers come out this way
Black’s pieces are already on sensible squares, and White has no quick way to attack the king. Delaying the castle by a move therefore costs nothing concrete, and castling, d6 and a6 all evaluate the same.
There were clearly bad moves, though. Ng4 moves the f6 knight a second time, when it was already well placed; the engine answers 6.d4 and takes the centre. Rf8 gives up the right to castle and buries the rook. What is genuinely expensive in the opening is not a delayed castle but re-moving a piece that was already doing its job.
Exceptions
This is not an argument against castling. In positions where White has an attack, one slow move can be fatal. What the numbers show is that the principle is not absolute, and some positions grant a few moves of slack.
Principles narrow down what to calculate. Checking what the opponent can actually do right now is how you tell the strict positions from the relaxed ones.
What this does and does not show
- It shows: what the engine returned for these 4 positions, with every candidate searched to depth 20. The numbers are the raw output; none of them were adjusted afterwards.
- It does not show: anything about "all positions" — a sample of 4 is a very small slice of chess.
- The assumption: an evaluation assumes best play from both sides. Over the board, an inaccurate reply changes everything.
- Reproducing it: the positions and candidates live in
tools/generate-chess-analysis.mjs, the results inassets/chess-analysis.json. The same settings give the same numbers.
What to remember at the board
- In this position there was no need to rush the castle
- What clearly costs you is moving the same piece twice
- Giving up the right to castle to shuffle a rook also costs
- Principles are guidance, not a race for every tempo
Try it yourself
You can try the same idea in a real game. Every move is scored by the engine, so the difference between principled and careless moves shows up immediately.