Special rules

Castling in Chess

Castling is the one move where two of your pieces move at once: the king steps two squares toward a rook, and the rook jumps over to the king's other side. You can do it once per game, if neither piece has moved and the king is not in check, and doesn't cross or land on an attacked square.

Try it

Castle, or find out why you can't

Three small boards. Drag the king two squares toward a rook (or click it, then its square). An illegal move is refused with the reason, so try the side you think is wrong too.

Castle. Move the king two squares toward a rook. One side is allowed, the other isn't.

Drag a white piece, or click it and then its square.

How to castle

You can castle toward either rook. The king always moves two squares, and the rook lands on the square the king just crossed. The pair counts as a single king move, so it uses up your whole turn.

Kingside castling (O-O)

The short side, toward the h1 rook. White's king goes from e1 to g1 and the rook from h1 to f1. For Black it's e8 to g8 and h8 to f8. Only two squares have to be cleared, f1 and g1, so it's usually the first castling you'll play.

Italian Game after 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5: White's knight and bishop have left f1 and g1
After 1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5, f1 and g1 are empty.
The same position after 4. O-O: white king on g1, rook on f1
4. O-O: king to g1, rook to f1.

Queenside castling (O-O-O)

The long side, toward the a1 rook. The king goes from e1 to c1 and the rook from a1 to d1, crossing b1 on the way. For Black it's e8 to c8 and a8 to d8. Three squares have to be empty first: b1, c1 and d1, so the knight, the bishop and the queen all have to move.

After 1. d4 d5 2. Nc3 Nc6 3. Bf4 Bf5 4. Qd2 Qd7: b1, c1 and d1 are empty
After 1. d4 d5 2. Nc3 Nc6 3. Bf4 Bf5 4. Qd2 Qd7, b1, c1 and d1 are empty.
The same position after 5. O-O-O: white king on c1, rook on d1
5. O-O-O: king to c1, rook to d1.

The castling rules

You may castle only when all four of these hold:

  1. The king and that rook have never moved in this game. Moving and coming back doesn't help: the right is gone. If only one rook has moved, you can still castle on the other side.
  2. Every square between them is empty, your own pieces included. Castling never captures anything.
  3. Your king is not in check right now.
  4. The king doesn't pass over or land on an attacked square. For White kingside that's f1 and g1, queenside d1 and c1.

Rule 1 takes the right away for good. Rules 2 to 4 only block it for now: once the squares are empty and safe, you can castle on a later move. The three boards below show a king that may not castle on one side, and why.

White king on e1 in check from a black bishop on b4, with both rooks still on a1 and h1
Out of check: the bishop on b4 gives check, so White can't castle on either side this move.
A black rook on d8 attacks d1, the square White's king would cross castling queenside
Through check: the rook on d8 hits d1, so no O-O-O. O-O is fine.
A black bishop on c5 attacks g1, the square White's king would land on castling kingside
Into check: the bishop on c5 hits g1, so no O-O. O-O-O is fine.

When castling is still allowed

Beginners often think castling is off in these cases. It isn't. Only the king's own squares have to be safe.

  • The rook is attacked. Castle anyway; the rook gets out of the attack as part of the move.
  • b1 (or b8) is attacked. When you castle queenside, only the rook crosses b1, so an attack on it doesn't matter. The square still has to be empty.
  • You were in check earlier. If you got out of check without moving the king (by blocking or capturing), you keep the right to castle.
  • The other rook has moved. Moving the h1 rook only costs you kingside castling. Queenside is still there.
The black bishop on e5 attacks the white rook on a1 and the black rook on b8 attacks b1, but c1 and d1 are safe
The rook on a1 and the square b1 are both attacked, but e1, d1 and c1 are safe: O-O-O is legal.

Castling notation

Kingside castling is written O-O and queenside O-O-O. To remember which is which, count the squares the rook moves: two kingside (h1 to f1), three queenside (a1 to d1). Many books print zeros (0-0, 0-0-0); game files (PGN) use the capital letter O. A check is added as usual: O-O+.

For the rest of the notation, see chess notation.

Castling over the board

On a real board, castling is one move made with one hand: touch the king first, move it two squares, then bring the rook over. The touch-move rule decides what happens if you do it differently:

  • Touch the king and then a rook: you must castle on that side, if it's legal.
  • Touch the rook first: you can't castle on that side this turn, and you have to move the rook you touched.
  • Touch the king meaning to castle, but castling turns out to be illegal: you must make another king move, which may be castling on the other side.

Why and when to castle

Castling does two jobs in one move:

  • It hides the king. The center opens up as pawns get traded, and a king left on e1 gets checked from every direction. On g1, behind the f2, g2 and h2 pawns, it's much harder to reach.
  • It brings a rook into the game. The rook moves from the corner to f1 or d1, toward the middle, where the files open.

A good habit is to castle within your first ten moves or so: develop a knight and a bishop, then castle. Wait longer when the center is still closed and you don't know yet which side is safer, or when the side you'd castle to is already under attack. In the Opera Game, Morphy castled queenside on move 12 and his rook landed on the d-file ready to attack, while his opponent's king never left e8.

After castling, leave the three pawns in front of your king alone unless you have a reason to move them. When both players castle on opposite sides, each tends to push pawns at the other king, and the faster attack usually wins.

Common mistakes

  • Moving the rook first. Over the board that's a rook move, not castling.
  • Castling after the king has moved. Even if it walked back to e1, the right is gone.
  • Castling out of or through check. Both are illegal. Block or capture first, and castle next move.
  • Thinking an attacked rook stops you. It doesn't. Only the king's squares count.
  • Getting out of check with the king when a block was there. It works, but it costs you castling for the rest of the game.
  • Waiting too long. A king stuck in the middle is the classic way beginners lose short games. See how the king moves for more on keeping it safe.

Frequently asked questions

Can you castle out of check?
No. You can't castle while your king is in check. Get out of check some other way first, by blocking or capturing if you can, because a king move costs you the right to castle for good. On a later move you may castle, as long as the king and that rook still haven't moved.
Can you castle through check?
No. The king may not pass over a square an enemy piece attacks: f1 when White castles kingside, d1 when White castles queenside (f8 and d8 for Black). It may not land on an attacked square either, because no move may leave your king in check.
Can you castle if the rook is attacked?
Yes. Only the king's squares matter. The rook can be attacked, and when you castle queenside the square next to the rook (b1 for White, b8 for Black) can be attacked too, since only the rook crosses it. It still has to be empty.
Can you castle if you were in check earlier in the game?
Yes. Being checked earlier doesn't matter. What counts is whether the king or that rook has ever moved, and whether the king is in check right now.
Can you castle if your king moved and came back?
No. Once the king has moved, castling on either side is gone for the rest of the game, even if it walks back to e1. If only one rook has moved, you can still castle with the other.
Can you castle twice in a game?
No. Castling moves the king, and after that it has moved, so each player castles at most once.
Do you move the king or the rook first?
The king. Over the board, touch the king first and move it two squares, then move the rook, with one hand. Under the touch-move rule, if you touch the rook first you have to make a rook move, and you can't castle on that turn.
Is it better to castle kingside or queenside?
Kingside is more common and a little safer: it's ready sooner (only the knight and bishop have to move) and the king ends up closer to the corner. Queenside takes one more piece out of the way and puts a rook straight onto the d-file, but the king on c1 leaves the a2 pawn unguarded, which is why many players follow up with Kb1.
Do you have to castle?
No. Castling is never forced. It's usually a good idea, but you can play a whole game without it.

Keep practicing