How does castling work in chess?
To castle, you move your king 2 squares towards one of your rooks, and that rook jumps over the king to the square right next to it. It’s one move, and you can only do it if neither piece has moved and your king isn’t in check, doesn’t cross an attacked square and doesn’t end in check.
Day 7 of Chess from Zero, the free academy, teaches this on the board. Start with day 1
How do you castle in chess?
Castling is the only move in which you move 2 pieces, and it counts as a single move.
- Move your king 2 squares sideways, towards the rook you castle with.
- Put that rook on the square the king just crossed, so it lands right next to the king on the other side.
- Over the board, move the king first. If you touch the rook first, you may not castle with it on that move.
Short vs long castling
You can castle on either side. Castling short, on the king’s side, is written O-O: the white king goes to g1 and the rook from h1 to f1. For Black, the king goes to g8 and the rook to f8.
Castling long, on the queen’s side, is written O-O-O: the white king goes to c1 and the rook from a1 to d1. For Black, the king goes to c8 and the rook to d8. Either way the king moves exactly 2 squares.
When can you castle?
You may castle only when all of these are true at the moment you castle.
- Your king has never moved in this game.
- The rook you castle with has never moved.
- There are no pieces between the king and that rook.
- Your king isn’t in check.
- The king doesn’t pass over a square an enemy piece attacks.
- The king doesn’t end up in check.
Can you castle out of check?
No. While your king is in check, you can’t castle. Get out of check first by moving the king, blocking or capturing the attacker.
If you block or capture, your king hasn’t moved, so you can still castle later. If the king steps away, you’ve lost the right to castle for the rest of the game, even if he walks back to his square.
Can you castle through check?
No. The king may not pass over a square an enemy piece attacks, and he may not land on one. When castling short, that means f1 and g1 must be safe for White, or f8 and g8 for Black.
This rule is only about the squares the king uses. If only one side is blocked this way, you may still be able to castle on the other.
Can you castle if the rook is attacked?
Yes. The rule about attacked squares is only for the king. Your rook may be attacked, and it may pass over an attacked square.
That matters when castling long. The rook crosses b1, or b8 for Black, but the king never does, so an attack on b1 doesn’t stop O-O-O. Only d1 and c1 must be safe for the king.