Special moves

Castling rules: the five conditions

Updated · Sergei Tovmasian

Short answer

You may castle only if your king has never moved, the rook you are castling with has never moved, every square between them is empty, your king is not in check, and neither the square it crosses nor the square it lands on is attacked. Two of those are lost for good; three are only about this move.

Five things have to be true at the same moment, and they split cleanly into two groups. Two of them are about the whole history of the game: break one and it is gone for good. The other three are about this exact turn, and they usually evaporate a move or two later. Beginners who lump all five together spend games thinking they can never castle again when they could have castled on the very next turn.

The list, in the order I check it at the board:

  1. My king has not moved in this game.
  2. This rook has not moved in this game.
  3. Every square between the king and this rook is empty. That is f1 and g1 going short, b1, c1 and d1 going long.
  4. My king is not in check at this moment.
  5. The square the king crosses and the square it lands on are not attacked by anything.

Conditions four and five are the ones FIDE writes as a single clause (Art. 3.8): castling is prevented while the square the king stands on, the square it crosses or the square it is to occupy is attacked. Three squares. For O-O they are e1, f1 and g1. For O-O-O they are e1, d1 and c1.

Two for good, three for now

Move your king to f1 to defend something and you have paid for it permanently. Same with the rook: play Rh1-e1 on move eight, put it back on h1 on move twenty, and short castling is still dead. Those two conditions have no memory of intent, only of movement, which is why the right does not come back when the king returns.

The other three are temporary. A knight sitting on f1 walks away. A bishop on b5 that hits f1 gets kicked by a2-a4 or blocked by Ng1-e2. A check gets blocked or captured, and the king is still on its original square, so you castle next move. That is the single most useful thing on this page.

The two that look like they should stop you

They do not, and both come up in real games.

8
7
6
5
4
3
2
a
b
c
d
e
f
g
h 1
The bishop on d4 attacks a1 and the rook on b8 attacks b1. Castling long is legal anyway: only e1, d1 and c1 have to be safe.

First, the rook may be attacked. The bishop on d4 in the diagram is looking straight at a1 down the long diagonal, and 1.O-O-O is still perfectly legal. After it, the rook stands on d1 and is defended by the king on c1, so the bishop has nothing.

Second, the square the rook passes over may be attacked. Black’s rook on b8 owns the open b-file and hits b1, which the a1 rook crosses on its way to d1. Irrelevant. The king never touches b1. Play 1.O-O-O and if Black tries 1…Rb1+ then 2.Kxb1 picks the rook up for nothing.

Before you reach for the king

Run the three temporary ones in about two seconds: am I in check, are the squares between empty, is anything hitting f1 and g1 (or d1 and c1)? The permanent two you should know without looking, because you were there when the king or the rook moved.

The trap is the fifth condition, because the attacker is usually a piece you were not looking at. A bishop on a6 or b5, a knight on e3 or g3, a rook that just landed on the f-file. There is a page on exactly that, castling through check, and a set of castling puzzles where the whole point of the position is spotting whether the move is on.

More questions

Can you castle if the rook is attacked?

Yes. The rule only ever talks about the king's squares: e1, the square it crosses and the square it lands on. A rook sitting on h1 or a1 under fire from a bishop or a queen is allowed to castle, and it will usually be safe afterwards anyway, because f1 and d1 are defended squares once the king arrives on g1 or c1.

Can the rook jump over an attacked square?

It can. When you castle long the rook travels a1 to d1 and crosses b1 on the way. Nothing says b1 has to be safe, because the king never goes near it. Only c1 and d1 matter, since those are the squares the king lands on and crosses. The same logic makes h1 irrelevant going short: that is where the rook starts, and the king never sets foot on it.

Do the five conditions apply to Black too?

Exactly the same, one rank up. Black's king must never have moved off e8, the rook must still be on a8 or h8, b8, c8 and d8 must be empty for O-O-O or f8 and g8 for O-O, e8 must not be in check, and the squares the king crosses and reaches must be safe. Only b8 is exempt, as b1 is for White.

Go deeper

Castling, en passant and promotion all have their own tactics. Drill them in the app.

← All: Special moves · Learn chess