Skip to content
Aback Chess
Sponsors

How to castle in chess: castling rules explained

How to castle in chess: every castling rule, kingside and queenside, whether you can castle out of or through check, notation, FEN rights and when to castle.

Rules9 min readUpdated

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)
NotationO-OO-O-O
White kinge1 to g1e1 to c1
White rookh1 to f1a1 to d1
Black kinge8 to g8e8 to c8
Black rookh8 to f8a8 to d8
Squares that must be emptyf and gb, c and d
In both cases the king moves exactly two squares and the rook ends on the square beside it, on the inside.
1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5After 1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5, the Giuoco Piano. The knight and bishop have left f1 and g1, so White can castle kingside: the king goes to g1 and the rook to f1.Open on the board
1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.O-OAfter 4.O-O. The king stands on g1 behind its pawns, and the rook on f1 is ready for the centre files.Open on the board
1.d4 d5 2.Nc3 Nc6 3.Bf4 Bf5 4.Qd2 Qd7 5.O-O-OQueenside castling. With the knight, bishop and queen gone from b1, c1 and d1, White played 5.O-O-O: the king went to c1 and the rook to d1, straight onto the open d-file.Open on the board

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.

  1. 1The king has never moved. Once the king moves, even if it comes back to its square, you can never castle on either side.
  2. 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.
  3. 3Every square between the king and that rook is empty. Pieces of either colour in the way stop you castling.
  4. 4Your king is not in check at the moment you castle.
  5. 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).
  6. 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.

The bishop on b4 checks the king on e1. White still has the right to castle kingside, but cannot use it now: O-O is not a legal move while the king is in check.Open on the board

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.

The bishop on a6 attacks f1, the square the king would cross. White cannot castle kingside here, even though the king is not in check and f1 and g1 are empty.Open on the board
The rook on g8 attacks g1, the king's landing square. Castling kingside would put the king in check, so it is illegal.Open on the board

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 bishop on h7 attacks b1, which the rook crosses when castling queenside. O-O-O is still legal here: only the king's squares, e1, d1 and c1, must be free of attack.Open on the board

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.

1.e4 e5 2.Ke2After 1.e4 e5 2.Ke2 the white king has moved, so White's castling rights are gone for the rest of the game, even if the king returns to e1. The FEN's castling field now reads kq: only Black can still castle.Open on the board

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.

Try it on the board

Play a computer opponent at your level and castle in a real game: the board only lets you castle when the rules allow it.

Frequently asked questions

Can you castle after your king has been in check?

Yes, as long as the king did not move to get out of check. If you blocked the check or captured the checking piece, your castling rights are unchanged, and you can castle once you are no longer in check.

Can you castle if the king moved and came back?

No. Any king move removes both castling rights for the rest of the game, even if the king returns to its original square. The same applies to a rook: once it has moved, you can never castle with it.

Can you castle when the rook is under attack?

Yes. The attacked-square rules apply only to the king's squares. The rook may be attacked, and on the queenside it may also pass over an attacked b1 or b8 square.

Can you castle with a promoted rook?

No. A promoted rook appears on the far rank, so it could only reach your king's rank by moving, and a rook that has moved can never castle. The FIDE Laws also require the rook to stand on the same rank as the king.

Is castling a king move or a rook move?

The FIDE Laws treat it as a king move. That is why you should touch the king first over the board, and why a king that has moved can never castle again.

Can you castle in the opening and the endgame?

You can castle at any point in the game as long as all the conditions are met. In practice most castling happens in the opening, because the king is safest early on behind its pawns.