Rules & practice · 6 min read
Castling rules in chess: a guide with examples
Castling is a useful move to learn early because it often helps you bring your king to safety while getting a rook into play. It’s also the only move in standard chess that moves two of your pieces at once. This guide covers the castling rules, where each piece goes, and the situations that can prevent you from castling.
The quick answer
To castle in standard chess, move your king two squares toward a rook, then place that rook on the square the king crossed. Neither piece may have moved earlier, the space between them must be clear, and the king cannot start in, pass through, or finish in check.
Kingside and queenside castling squares
You can castle toward either rook, provided the conditions are met on that side. Kingside castling is written O-O, while queenside castling is written O-O-O.
| Side | White king | White rook | Black king | Black rook |
|---|---|---|---|---|
| Kingside, O-O | e1 → g1 | h1 → f1 | e8 → g8 | h8 → f8 |
| Queenside, O-O-O | e1 → c1 | a1 → d1 | e8 → c8 | a8 → d8 |
These destinations apply to standard chess. Chess960 uses different starting arrangements and has its own castling details.
When you’re playing over the board, move the king first, then the rook, using the same hand. Starting with the rook can commit you to an ordinary rook move under the touch-move rules. You’ll find the official wording in FIDE articles 3.8 and 4.4.
Follow the king and rook on the board
The example below leaves most pieces off the board so you can follow the movement clearly. White has kept both castling rights, and the route between the king and either rook is clear.
Select “After castling” to see White castle kingside. The king moves from e1 to g1, the rook on h1 moves to f1, and the rook on a1 stays where it was. Although two pieces have moved, this counts as one turn, so Black plays next.
Why can’t I castle in this position?
When castling isn’t available, working through this checklist usually explains why:
- Has your king moved earlier in the game? Returning it to its starting square doesn’t restore castling rights.
- Has the rook on that side moved? You can’t castle with a rook that has already moved.
- Is a piece still between the king and rook? The path needs to be completely clear.
- Is your king in check, or is either square it must cross or land on attacked? The king’s whole route needs to be safe.
Chess.com’s castling reference illustrates these restrictions. In our example below, the king on e1 and its destination on g1 are both safe, but the black rook on f8 attacks f1. Because the king must cross f1, White cannot castle kingside.




Castling when the rook is attacked
An attack on your rook doesn’t, by itself, prevent castling. For example, if an opposing piece attacks h1, White may still be able to castle kingside as long as e1, f1, and g1 are safe and the other conditions are met.
Queenside castling has a detail worth remembering. White needs b1, c1, and d1 empty because they all lie between the king and rook. However, b1 can be under attack: the king travels through d1 to c1 and never visits b1.
It’s also fine to castle after an earlier check if you answered it without moving your king or the relevant rook. You might have blocked the check or captured the attacker with another piece. What removes castling rights is moving the king, not having been in check at some point.
Queenside castling step by step
Queenside castling follows the same idea as kingside castling, but the rook travels further. The king moves two squares toward the a-file, from e1 to c1, and the rook moves from a1 to d1, the square the king crossed.
Use the explorer below to compare the two positions. The white king ends up on c1, not b1, so it doesn’t protect the a2-pawn. That’s why players who castle queenside often spend a later move, such as Kb1, tucking the king a little further into the corner.
Kingside or queenside: which way should you castle?
Kingside castling is the more common choice, partly because it’s quicker to prepare. Only the knight and bishop need to leave the squares between the king and the h1-rook. Queenside castling also needs the queen to move off the back rank.
Each side has its own character. After kingside castling, the king sits near the corner behind the f-, g-, and h-pawns. After queenside castling, the rook lands straight on d1, a central file where it can be useful at once, but the king is a little more exposed.
When the players castle on opposite sides, the game often turns into a race. Each player can push the pawns in front of the enemy king without loosening the shelter around their own, so attacks tend to arrive quickly. If you’re building your first repertoire, kingside castling is a sensible default while you get used to these ideas.
How to castle on a chess app and write it down
Kingside castling is written O-O and queenside castling O-O-O. The FIDE notation rules use zeros (0-0 and 0-0-0), while most chess software uses the capital letter O, so you’ll see both versions.
On most chess apps and websites, you castle by moving the king two squares toward the rook, and the rook follows automatically. Many also let you drop the king onto its own rook. If the app won’t let you castle, go back to the checklist above: one of the conditions isn’t met yet.
Chess960, also known as Fischer Random, shuffles the pieces on the back rank, so the king and rooks can start on other squares. You can still castle, and the king and rook finish on the same squares as in standard chess, but the moves that take them there are different.
When should you castle?
Castling often makes sense during the opening, especially when your king can settle behind a group of pawns and your rook can become more active. It’s still worth looking at the destination before committing. If the pawns in front of g1 have disappeared and enemy pieces are nearby, kingside castling might lead your king toward danger.
As you develop your pieces, you’ll start to notice how the moves prepare castling. For White to castle kingside, the knight on g1 and bishop on f1 need to move, and the bishop usually needs a pawn move to open its diagonal first.
The diagram below shows a typical example. In the Italian Game, after 1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5, White’s knight and bishop have already left g1 and f1, so 4.O-O is a natural next move.
Understanding those connections makes opening moves easier to follow. Our chess opening practice guide explains how to study a line with its ideas in mind. You can also explore en passant if you’re learning the special chess moves together.
































Frequently asked questions
Can you castle out of check?
No. If your king is in check, you have to deal with the check another way first. You may still be able to castle later, as long as your king and that rook haven’t moved.
Can you castle through check?
No. The king can’t cross a square that an enemy piece attacks, and it can’t finish on one either. The rook’s path is different: when castling queenside, b1 or b8 may be attacked.
Can you castle if your rook is under attack?
Yes. An attack on the rook doesn’t stop castling, as long as the king’s starting square, the square it crosses, and its destination are all safe.
Can you castle after your king has moved back to its starting square?
No. Once the king has moved, you lose castling rights on both sides for the rest of the game, even if it returns to e1 or e8.
Can you castle if you were in check earlier in the game?
Yes, provided you got out of check without moving the king or the rook you want to castle with.
How many times can you castle in a game?
Once. Castling moves the king, and a king that has moved can’t castle again.
Sources & further reading
The diagrams and exercises are teaching examples. Rules references apply to standard chess unless stated otherwise.