In short
To castle, move your king two squares towards one of its rooks, then put that rook on the square the king crossed. You may castle only if neither the king nor that rook has moved, every square between them is empty, your king is not in check, and the king does not pass through or land on a square the enemy attacks. Kingside castling is written O-O, queenside O-O-O.
Castling is the only move in chess where two pieces move at once, and the only time the king moves more than one square. It does two jobs in one turn: it tucks the king away from the centre, where the files open first, and it brings a rook towards the middle of the board where it can join the game. In most openings both players castle early, before the middlegame begins.
1How do you castle in chess?
Move the king two squares sideways towards the rook you are castling with. Then lift that rook over the king and place it on the square right next to it, the one the king just crossed. That is the whole move. There are two ways to do it, one with each rook.
| Kingside (short) | Queenside (long) | |
|---|---|---|
| Notation | O-O | O-O-O |
| White king | e1 to g1 | e1 to c1 |
| White rook | h1 to f1 | a1 to d1 |
| Black king | e8 to g8 | e8 to c8 |
| Black rook | h8 to f8 | a8 to d8 |
| Squares that must be empty | f and g | b, c and d |
2The castling rules: when can you castle?
The FIDE Laws of Chess set out the conditions. Some take the right away for the rest of the game; others only stop you castling for now.
- 1The king has never moved. Once the king moves, even if it comes back to its square, you can never castle on either side.
- 2The rook you castle with has never moved. If the h1 rook has moved, you cannot castle kingside, but you may still castle queenside with the a1 rook if it has not moved.
- 3Every square between the king and that rook is empty. Pieces of either colour in the way stop you castling.
- 4Your king is not in check at the moment you castle.
- 5The king does not pass through a square attacked by an enemy piece. Kingside that is f1 (f8 for Black); queenside it is d1 (d8).
- 6The king does not land on an attacked square. That would put it in check, which no move may do.
3Can you castle out of check?
No. If your king is in check, castling is not one of your legal replies. Answer the check another way: move the king, block, or capture the checking piece. If you deal with it without moving the king, your castling rights are still intact, and you can castle on a later move once you are no longer in check.
4Can you castle through check?
No. The king may not cross a square an enemy piece attacks. When castling kingside, that square is f1 for White and f8 for Black. It does not matter that the king does not stop there: the rule treats castling through an attacked square as if the king had been in check on the way.
5Can you castle if the rook is attacked?
Yes. The rules about attacked squares apply only to the king: the square it starts on, the square it crosses and the square it lands on. The rook may be attacked, and it may cross an attacked square. That matters most on the queenside, where the rook passes over b1 (or b8), a square the king never touches.
The same logic means you may castle when the rook itself is under attack. Castling can even be the way to rescue a rook that is attacked in the corner, since it moves the rook off that square.
6How to castle on a real board and online
Over the board, castle by moving the king first: pick up the king, put it two squares over, then move the rook with the same hand. Under the FIDE Laws, touching a piece commits you to moving it, so if you touch the rook first you may be held to a rook move and lose the chance to castle on that turn. Each move is made with one hand.
On an online board, drag or click your king two squares towards the rook and the rook jumps over on its own. If the board will not let you, one of the six conditions is not met: look for a piece in the way, a check, or an enemy piece covering the squares the king needs.
7Castling notation: O-O and O-O-O
Kingside castling is written O-O, queenside O-O-O, with capital letter O rather than zero in standard algebraic notation and in PGN files. You will see 0-0 and 0-0-0 with zeros in many books and on scoresheets; they mean the same thing. If castling gives check, add + as with any move: O-O+ is possible when the rook arrives on f1 and checks a king on the f-file.
8Castling rights in FEN
A FEN string records which castling moves are still possible in its third field. K means White can castle kingside, Q White queenside, k Black kingside and q Black queenside. The starting position has KQkq; a dash means neither side can castle. The field records the permanent rights only. It shows that the king and rook have not moved, not whether castling is legal this move, so a FEN can say K while the king is in check.
9When should you castle?
In most openings, early. The centre is where the first pawn exchanges happen and where files open, and a king left on e1 can be caught by checks along the e-file or the diagonals towards it. Opening principles usually put it simply: develop your knights and bishops, then castle, then connect your rooks. Delay is fine when the centre is closed by pawns and no line can open soon, but delay should be a decision, not an oversight.
- Kingside castling is quicker, because only two pieces, a knight and a bishop, need to leave the back rank. That is one reason it is the usual choice.
- Queenside castling needs the queen out of the way too, and it leaves the king on c1, a little less sheltered: the a2 pawn is often left unprotected. Players often follow it with Kb1 to tuck the king further in.
- In exchange, queenside castling puts the rook on d1, often straight onto a central file, which makes it attractive in sharp openings.
- When the two sides castle on opposite wings, both usually throw their pawns forward at the other king. Those games are races, and speed matters more than material.
- In the endgame, with queens off, the king is usually better in the centre, and castling can waste time.
10Common castling mistakes
- Moving the king early without a reason. A king move, even one forced by a check you could have blocked, gives up castling for the rest of the game.
- Moving the h-rook. A rook lift from h1 to f1 or g1 before castling loses the kingside right, often without the player noticing until later.
- Castling into an attack. If the opponent's pieces and pawns are already aimed at your kingside, castling there can make things worse. Look at what is pointed at g1 or g8 before you go.
- Pushing the pawns in front of the castled king. g4 or h4 can be strong in the right position, but each pawn move in front of the king loosens its cover for good.
- Trying to castle out of check, or through an attacked square. The board will not let you online, and over the board the arbiter will make you take it back.