Quick answer: You can castle when 4 things are true. Your king and that rook haven’t moved. The squares between them are empty. Your king is not in check. The king does not cross or land on an attacked square. The rook may be under attack, and you can castle only once per game.
Castling looks easy until your opponent asks, “Wait, is that legal?” Can you castle when your rook is attacked? After a check? Below you’ll get a clear answer to each, with a board for every rule.
Every rule comes from Article 3.8 of the FIDE Laws of Chess. It’s part of our chess rules guide.
What is castling in chess?
Castling is a single move that moves your king and 1 of your rooks. The king goes 2 squares toward the rook. Then the rook lands on the square the king just crossed (Article 3.8.2).
Here’s the detail that matters later: castling counts as a king move. It’s also the only move where 2 of your pieces move at once, and the only time the king travels 2 squares.
Need a refresher on their normal moves? See how does the king move and how does the rook move.
You can castle to either side:
- Kingside (O-O): White’s king goes from e1 to g1 and the rook from h1 to f1. Black’s king goes from e8 to g8 and the rook from h8 to f8.
- Queenside (O-O-O): White’s king goes from e1 to c1 and the rook from a1 to d1. Black’s king goes from e8 to c8 and the rook from a8 to d8.

After 1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5, can White castle? Yes, 4.O-O is legal. The king and the h1 rook haven’t moved, and f1 and g1 are empty. No black piece attacks e1, f1 or g1.
Not sure which side to pick? To learn more, read our full guide to kingside vs queenside castling, with the notation for each.
When can you castle in chess?
You can castle in chess when all 4 of these conditions are true. Miss even 1 and the move is illegal.
- The king and the rook have not moved. Neither the king nor the rook you castle with has moved earlier in the game (Article 3.8.2.1).
- The squares between them are empty. No piece of either color stands between the king and that rook (Article 3.8.2.2).
- The king is not in check. No enemy piece attacks the square the king stands on (Article 3.8.2.2).
- The king does not cross or land on an attacked square. No enemy piece attacks the square the king passes or the square it ends on (Article 3.8.2.2).
Conditions 3 and 4 are the ones people forget. Here’s a short way to remember them: you can’t castle out of check, through check or into check.

Run the checklist on this position. The king on e1 and the rook on a1 haven’t moved. The squares b1, c1 and d1 are empty, and nothing attacks e1, d1 or c1. So White can castle queenside.
But not every failed condition is permanent. FIDE splits them into 2 groups. Moving the king or the rook loses the right to castle for the rest of the game.
A check, an attacked square or a piece in the way only stops you for now. Clear the problem and castling is back.
When can you not castle in chess?
You can’t castle in chess if any 1 of the 4 conditions fails. Use the “How long it lasts” column to see if you’re blocked for good or just for now. The last 3 rows are the surprises: cases that look illegal but aren’t.
| Situation | Can you castle? | How long it lasts | FIDE article |
|---|---|---|---|
| Your king has moved | No, on either side | Rest of the game | 3.8.2.1 |
| That rook has moved | No with that rook. The other rook can still castle. | Rest of the game | 3.8.2.1 |
| A piece stands between the king and the rook | No | Until the squares are empty | 3.8.2.2 |
| Your king is in check | No | Until the check is over | 3.8.2.2 |
| The king would cross an attacked square (f1 or d1 for White) | No | Until the square is no longer attacked | 3.8.2.2 |
| The king would land on an attacked square (g1 or c1 for White) | No | Until the square is no longer attacked | 3.8.2.2 |
| Your rook is under attack | Yes | Not a restriction | 3.8.2.2 names only the king’s squares |
| The rook crosses an attacked square (b1 for White, b8 for Black) | Yes | Not a restriction | 3.8.2.2 names only the king’s squares |
| Your king was in check earlier but did not move | Yes | Not a restriction | 3.8.2.1 |
Can you castle after moving your king?
No, you can’t castle after moving your king. Once it has moved, castling is gone for the rest of the game (Article 3.8.2.1). And moving it back to its starting square doesn’t bring the right back.

Here White has played Ke2. What if the king goes back with Ke1? The board looks the same as before, but castling is still gone on both sides.
The same goes for 1.e4 e5 2.Ke2. One king move that early, and White can never castle in that game.
Remember that castling is itself a king move? That’s why each player can castle only once per game.
Can you castle if your rook has moved?
You can’t castle if your rook has moved, at least not with that rook. It loses the right even if it goes back to its corner (Article 3.8.2.1). But you can still castle with your other rook, if it and the king haven’t moved.

Here White has played Ra1-b1. Queenside castling is gone for the rest of the game, even after Rb1-a1. Is the h1 rook still at home? Then O-O stays available.
Can you castle with pieces between the king and rook?
No, you can’t castle with pieces between the king and rook. Every square between them must be empty (Article 3.8.2.2).
For White that means f1 and g1 on the kingside, and b1, c1 and d1 on the queenside. For Black it’s f8 and g8, or b8, c8 and d8.

White’s queen on d1 blocks O-O-O here. But this one’s only temporary: once the queen moves away, White can castle queenside.
What about a knight on b1? It blocks queenside castling too. The king never reaches b1, but the rule covers every square between the 2 pieces.
That’s why you can’t castle at the start of the game. Get your knights and bishops out first.
Can you castle out of check?
No, you can’t castle out of check. If your king is in check, castling is off for that move (Article 3.8.2.2). Answer the check another way: block it, capture the checking piece or move the king.
To learn more, read our full guide on can you castle out of check.

This position comes from the Giuoco Piano: 1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.c3 Nf6 5.d4 exd4 6.cxd4 Bb4+. The bishop on b4 gives check. The squares f1 and g1 are empty, but 7.O-O is illegal.
So has White lost castling for good? No, the ban is temporary. White blocks with 7.Nc3, Black plays 7…Nxe4, and now 8.O-O is legal.
A king that was in check earlier can still castle, as long as it didn’t move.
Now compare 7.Kf1. It answers the check too, but the king has moved. White can’t castle for the rest of the game.
Can you castle through check?
No, you can’t castle through check. The king can’t cross a square that an enemy piece attacks (Article 3.8.2.2). For White that square is f1 on the kingside and d1 on the queenside. For Black it’s f8 or d8.

White’s king isn’t in check here. So what’s the problem? The black queen on d6 attacks d1, and the king would have to cross d1 to reach c1. That rules out queenside castling in this position.
Again, it’s only for now. White can castle queenside once no black piece attacks e1, d1 or c1.
Why the strict rule? It comes from the basic rule that a king may never move into check (Article 3.9.2). Castling applies it to all 3 squares the king uses: the one it starts on, the one it crosses and the one it lands on.
Can you castle into check?
No, you can’t castle into check. The king can’t finish castling on an attacked square (Article 3.8.2.2). That square is g1 or c1 for White, and g8 or c8 for Black.

After 1.e4 e5 2.f4 Bc5 3.Nf3 d6 4.Bc4 Nc6, White’s f-pawn has left f2. See the problem? The bishop on c5 now attacks g1 along the open diagonal. Castling kingside would put the king in check, so 5.O-O is illegal.
The fix is to close the diagonal first. After 5.c3 Nf6 6.d4 exd4 7.cxd4 Bb6, the pawn on d4 blocks the bishop, and 8.O-O is legal.
Can you castle if your rook is under attack?
Yes, you can castle if your rook is under attack. Article 3.8.2.2 lists only the 3 squares the king uses. It says nothing about the rook’s square.

Still unsure? You’re in good company. In Korchnoi vs Karpov from the 1974 Candidates final, Black’s bishop on d5 attacks the rook on h1. Viktor Korchnoi asked the arbiter whether castling was legal with the rook under attack.
The arbiter said yes. Korchnoi castled, and Anatoly Karpov resigned shortly after, according to Wikipedia’s castling article.
So check the king’s squares, not the rook’s. In the diagram no black piece attacks e1, f1 or g1, so O-O is legal.
Can the rook pass through an attacked square when castling?
Yes, the rook can pass through an attacked square when castling. In queenside castling the rook crosses b1 (b8 for Black), and the king never touches that square. So an enemy piece that attacks b1 doesn’t stop O-O-O.

Feuer vs O’Kelly, from the 1934 Belgian Championship, shows how sharp this can be. The game went 10…Rxb2 11.dxe5 dxe5? 12.Qxd8+ Kxd8, and Black’s rook on b2 attacks b1.
White played 13.O-O-O+ anyway. The rook on d1 gives check, and the king on c1 attacks the rook on b2. Black must answer the check, so White takes the rook next move.
O’Kelly resigned, as Wikipedia’s castling article records.
Think only beginners mix this up? In Averbakh vs Purdy, Adelaide 1960, Yuri Averbakh questioned Black’s queenside castling because the rook had crossed an attacked square. The move was legal.
How do you castle in chess, step by step?
To castle in chess over the board, follow these 4 steps. The order matters more than you’d think.
- Check the 4 conditions above.
- Pick up your king and move it 2 squares toward the rook.
- With the same hand, move the rook to the square the king crossed.
- Press your clock, if you’re using one.
Why the king first? Under FIDE rules, if you touch the rook and then the king, you can’t castle on that move (Article 4.4.2). You have to move the rook instead.
And use 1 hand for the whole move (Article 4.1). What happens if you use 2? Our page on can you castle with two hands explains the penalty.
Started a castle that turns out to be illegal? You must then make another legal king move, if you have one (Article 4.4.3). A finished illegal castle is handled like other illegal moves in chess.
Playing online? On most chess sites and apps, you drag the king 2 squares toward the rook. The rook moves by itself.
Now you know when castling is legal. That’s half the job. The other half is timing, so read when should you castle in chess next.
FAQ
How many times can you castle in chess?
Each player can castle once per game. Castling is a king move, so after it your king has moved and the right is gone (Article 3.8.2.1). You can’t castle kingside and then queenside later.
Can you castle if you were in check earlier in the game?
Yes, you can castle if you were in check earlier, as long as you didn’t move the king to escape it. Blocking the check or capturing the checking piece keeps your right to castle.
Can Black castle the same way as White?
Yes, Black castles the same way as White. The rules are the same for both colors. Black’s king goes from e8 to g8 (O-O) or from e8 to c8 (O-O-O), and the rook lands on f8 or d8.
Can you give check or checkmate by castling?
Yes, you can give check or checkmate by castling, because the rook lands on a new file. In Feuer vs O’Kelly, 1934, 13.O-O-O+ gave check on the d-file.
Is the rook called a castle?
The piece is officially called a rook. The FIDE Laws of Chess use only “rook”. “Castle” is an informal name for the piece, and “castling” is the name of the move.
Updated .




