Chess OpensOpen the trainer
1.Article

How to Castle in Chess: Rules, Timing, and Common Mistakes

How to castle in chess: the exact rules for kingside and queenside castling, when you can't castle, when you should, and the mistakes that cost games.

By
Chess Opens
Published
Reading time
4 min
2.Read

In short

  1. Castling moves the king two squares toward a rook, and the rook jumps to the square the king crossed.
  2. You can't castle if the king or that rook has moved, if any square between them is occupied, or if the king is in check, passes through check, or lands in check.
  3. The rook may be attacked, and in queenside castling the b-file square may be attacked; only the king's squares matter.
  4. Castle early in most openings, usually within the first ten moves.

Castling is the only move in chess where two pieces move at once, and it’s one of the most important moves you’ll make in any game. It gets your king to safety and brings a rook toward the center in a single turn. Here’s exactly how castling works, when you can’t do it, and when you should.

How castling works

There are two kinds of castling.

Kingside castling (O-O): the king moves two squares toward the h-rook (e1 to g1 for White), and the rook jumps over to the square the king crossed (h1 to f1).

After 4.O-O: White's king is on g1 and the rook on f1.8a7b6c5d4e3f2g1h
After 4.O-O: White's king is on g1 and the rook on f1.1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.O-O

Queenside castling (O-O-O): the king moves two squares toward the a-rook (e1 to c1), and the rook jumps to d1.

After 5.O-O-O: White's king is on c1 and the rook on d1.8a7b6c5d4e3f2g1h
After 5.O-O-O: White's king is on c1 and the rook on d1.1.d4 d5 2.Nc3 Nc6 3.Bf4 Bf5 4.Qd2 Qd7 5.O-O-O

On a chess website or app, you castle by moving the king two squares toward the rook. The rook moves automatically.

The rules: when you can’t castle

You may castle only if all of these are true:

  1. Neither the king nor that rook has moved earlier in the game (even if they’ve moved back).
  2. All squares between the king and the rook are empty.
  3. The king is not in check.
  4. The king doesn’t pass through a square attacked by an enemy piece.
  5. The king doesn’t land on a square attacked by an enemy piece (that would be moving into check, which is never legal).

These rules come from the official FIDE Laws of Chess, the rulebook used for rated games worldwide.

Example: castling through an attacked square

White can't castle kingside here: Black's a6 bishop attacks f1, the square the king must cross.8a7b6c5d4e3f2g1h
White can't castle kingside here: Black's a6 bishop attacks f1, the square the king must cross.1.e4 b6 2.Nf3 Ba6 3.g3 e6 4.Bg2

White’s king and rook haven’t moved, and f1 and g1 are empty, but the bishop on a6 controls f1. The king would pass through an attacked square, so O-O is illegal until White blocks the diagonal (with d3, c4 or a piece on e2, for example).

Common castling myths

  • “You can’t castle if the rook is attacked.” False. The rook can be under attack.
  • “You can’t castle queenside if b1 is attacked.” False. The king never touches b1; only c1 and d1 matter for White (c8 and d8 for Black).
  • “You can castle once per side.” Each player can castle only once per game, kingside or queenside.
  • “You can castle with a promoted rook.” No. Castling is only with a rook that has been on its original square all game.

When should you castle?

In most openings, castle early, usually within the first ten moves. A king in the center is exposed once the e- or d-file opens, and a castled king also connects your rooks. This is one of the core chess opening principles.

Kingside or queenside?

Kingside castling is faster (only two pieces need to move out of the way: the knight and bishop) and is the most common choice.

Queenside castling needs three pieces moved (knight, bishop and queen), puts the king slightly further from the corner, and leaves the a-pawn undefended by the king. But it brings the rook straight to the d-file, which can be very useful.

Opposite-side castling

When the players castle on opposite sides, both can push the pawns in front of the opponent’s king without weakening their own. These positions often become races. The Sicilian Dragon’s Yugoslav Attack is a famous example; see the Dragon guide.

Opposite-side castling in the Dragon: White attacks on the kingside, Black on the queenside.8a7b6c5d4e3f2g1h
Opposite-side castling in the Dragon: White attacks on the kingside, Black on the queenside.1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 g6 6.Be3 Bg7 7.f3 O-O 8.Qd2 Nc6 9.O-O-O

When not to castle (yet)

  • When it walks into an attack. If your opponent has pieces and pawns aimed at your kingside, castling there may be dangerous.
  • When the center is closed. If no files can open, the king is often safe in the middle for a while, and you can choose the right side later.
  • In the endgame. Once the queens are off, the king becomes an active piece. It often belongs in the center.

Common castling mistakes

  1. Castling too late. Leaving the king in the center while the position opens is one of the most common ways to lose quickly.
  2. Pushing pawns in front of the castled king. Moves like h3, g4 or …h6 and …g5 weaken your shelter. Only do it with a purpose.
  3. Moving the king or rook early by accident. A casual Ke2 or Rf1 removes castling rights for the rest of the game.
  4. Castling into a pin or a fork. Always check what your opponent’s pieces are aiming at before you castle.

Practice

Every line in the Chess Opens trainer includes castling at the right moment; stepping through openings like the Italian Game is a good way to get a feel for the timing. For the bigger picture of what to do in the opening, read chess opening principles and common chess opening mistakes. Wikipedia’s Castling article covers the history of the rule.

Practice it in Chess Opens

Learn the Italian Game move by move

Step through the Italian Game with the reason behind every move, then play it from memory against the trainer. Free, no sign-up.

Questions

Q1Can you castle out of check?

No. If your king is in check, you must deal with the check first. You can castle later, as long as the king and rook still haven't moved.

Q2Can you castle if the rook is attacked?

Yes. Only the king's squares matter: the king can't be in check, can't pass through an attacked square and can't land on one. The rook can be under attack, and in queenside castling the b1/b8 square can be attacked too.

Q3Can you castle after moving your king back to its original square?

No. Once the king has moved, castling is no longer allowed for the rest of the game, even if the king returns to its starting square. The same applies to each rook.

Q4How do you castle on a chess website?

Move the king two squares toward the rook (for example e1 to g1). The site moves the rook automatically. On most sites you can also drag the king onto the rook.

3.Next