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.
In short
- Castling moves the king two squares toward a rook, and the rook jumps to the square the king crossed.
- 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.
- The rook may be attacked, and in queenside castling the b-file square may be attacked; only the king's squares matter.
- 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).
Queenside castling (O-O-O): the king moves two squares toward the a-rook (e1 to c1), and the rook jumps to d1.
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:
- Neither the king nor that rook has moved earlier in the game (even if they’ve moved back).
- All squares between the king and the rook are empty.
- The king is not in check.
- The king doesn’t pass through a square attacked by an enemy piece.
- 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’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.
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
- Castling too late. Leaving the king in the center while the position opens is one of the most common ways to lose quickly.
- 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.
- Moving the king or rook early by accident. A casual Ke2 or Rf1 removes castling rights for the rest of the game.
- 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.
Keep reading
Chess Opening Principles: 10 Rules That Win More Games
The 10 chess opening principles every player should know: control the center, develop, castle, and more. Each one explained with a diagram and examples.
The 8 Best Chess Openings for Beginners (and Why They Work)
The best chess openings for beginners, for White and Black: the Italian, London, Queen's Gambit, Caro-Kann and more, with diagrams and simple plans.
What Is a System Opening? Pros, Cons, and the Best Ones
What a system opening is, how it differs from a normal opening, the best systems for each side (London, KIA, Colle, King's Indian), and their pros and cons.