Castling in Chess: Rules, When You Can't, and How to Do It
Ferzika Editorial Team · updated · 8 min

Castling in chess is one move with the king and a rook: the king goes two squares toward the rook, and the rook lands on the square the king crossed. You can't castle if the king or that rook has already moved, a piece stands between them, the king is in check, or the square the king crosses or lands on is attacked. The rook itself may be attacked, and on the queenside so may b1 or b8.
- Kingside castling: the king goes to g1 or g8, the rook to f1 or f8. Queenside: the king to c1 or c8, the rook to d1 or d8.
- The right is lost for good if the king or that rook has moved.
- Temporary bans: the king is in check, squares on its path are attacked, a piece stands between the king and the rook.
- The rook may be attacked, and so may a square only the rook passes over.
- Over the board, pick up the king first and use one hand.
How castling works
Article 3.8.2 of the FIDE Laws describes it as a move of the king and a rook of the same color along the first rank, counted as one move of the king. The king goes two squares toward the rook, and the rook is moved to the square the king has just crossed.
| Castling | Notation | King | Rook |
|---|---|---|---|
| Kingside, White | O-O (0-0) | e1 → g1 | h1 → f1 |
| Queenside, White | O-O-O (0-0-0) | e1 → c1 | a1 → d1 |
| Kingside, Black | O-O (0-0) | e8 → g8 | h8 → f8 |
| Queenside, Black | O-O-O (0-0-0) | e8 → c8 | a8 → d8 |
1.
1. 2. 3. 4.
Castling rules: when you can't castle
| Situation | Can you castle? | Type of ban |
|---|---|---|
| The king has already moved, even if it came back | No, never | Permanent |
| That rook has already moved | Not with it; with the other one you can | Permanent |
| The king is in check right now | No | While in check |
| The king passes through an attacked square | No | While the square is attacked |
| The destination square is attacked | No | While the square is attacked |
| A piece stands between the king and the rook | No | While it stands there |
| The rook itself is attacked | Yes | — |
| On the queenside, b1 or b8 is attacked | Yes | — |
| There was a check earlier, but the king never moved | Yes | — |
- 1The king hasn't movedEven if it came back, castling is gone
- 2That rook hasn't movedIf it has, castling with the other rook remains
- 3Nothing in betweenNot a single piece; b1 or b8 counts too
- 4The king is not in checkA check in the past doesn't matter
- 5The king's squares are not attackedIts path and its destination, but not the rook and not b1 or b8
Castling out of check
You can't castle while in check. Answer the check another way, and you can castle later if the king hasn't moved from its square.
1. 2. 3. 4. 5. 6.
Attacked squares on the king's path
The king can't stand on an attacked square or pass through one. This is checked for three squares: where the king stands, the one it crosses and the one it arrives on.
Can you castle if your rook is attacked?
Yes. The ban applies only to the king. The rook may be under attack and may cross an attacked square. Beginners often pass up a legal castle because of exactly this confusion.
Queenside castling: the special case of b1
In queenside castling the rook travels one square farther than the king. The king doesn't cross b1 (b8 for Black), so that square may be attacked. It can't be occupied, though: there must be no piece at all between the king and the rook.
You can even give check by castling; the rook is no worse at it than any other piece.
1.
When the right to castle is lost for good
If the king has moved even once, there will be no castling in this game, even if it returns to e1. If one rook has moved, castling with the other remains.
1. 2. 3. 4. 5.
Leaving the king in the center is common and costly. Once you have games, Ferzika will show which themes cost you the most points.
How to castle over the board and online
Over the board. Pick up the king with one hand, put it two squares to the side, then move the rook with the same hand. The order matters:
- If you touched the king and the rook, you must castle that way, if it is legal (4.4.1).
- If you deliberately picked up the rook first and then the king, you may not castle that way on this move, and you must move the rook if it can move (4.4.2).
- If you meant to castle but castling is illegal, you must make another king move, including castling the other way. If the king has no moves, you may move anything (4.4.3).
- The move counts as made once your hand has released the rook (4.7.2).
- A move must be made with one hand (4.1). Castling with two hands, or pressing the clock with the other hand, is penalized as an illegal move (7.5.4).
Online. Usually it is enough to drag the king two squares toward the rook. If castling is illegal, the move won't go through. In the game record you will see O-O or 0-0: they are the same thing.
Why castle, and how to choose a side
Castling solves two problems at once: it takes the king out of the center, where lines open up, and it brings a rook into the game. That is why it is one of the three basic opening principles, along with the center and development, covered in more detail in the topic on opening principles and the lesson on development and castling.
- Kingside is faster: you only need to clear two pieces, so it suits a beginner almost always.
- Queenside requires clearing three pieces and often leaves the a2 or a7 pawn undefended, but the rook goes straight to the center on the d-file.
- Castling on opposite sides makes the game sharper: both sides push pawns at the opponent's king.
Castling took its present form, where the king and rook move in a single turn, in the 17th century. If you play Chess960, it has special castling rules, written up separately. The full set of ordinary rules is in the article chess rules.
FAQ
Can you castle while in check?
No. While the king is in check, you can't castle. But if you block or capture the attacker without moving the king, the right is kept.
Can you castle if your rook is attacked?
Yes. The rules only forbid the king itself being attacked, along with the square it crosses and the square it lands on.
Can you castle if the king has moved and come back?
No, the right is lost for good: what matters is the fact that the king moved, not the square it stands on now.
Can you castle queenside if b1 is attacked?
Yes. The king doesn't pass through b1, so an attack on it doesn't matter. The square only has to be empty.
How do you castle in an online game?
Usually it is enough to drag the king two squares toward the rook. If castling is illegal, the move won't go through.
How many times can you castle?
Once per game: after castling the king counts as having moved.




