What is castling in chess?
Castling is a special move in which the king and one rook move at the same time. It is the only move in chess where a player moves two pieces, and the only time the king moves two squares. The FIDE Laws describe it as a move of the king and either rook along the player's first rank, and it counts as one move.FIDE
Normally the king steps one square and the rook slides along a line. Castling breaks both patterns at once: the king jumps two squares sideways and the rook hops over it. Because it is the king's move, the king's safety rules apply to it, and because it is special, it comes with extra conditions about history.
Why does it exist? Castling was added in Europe to speed up the game, letting a player tuck the king away and bring a rook toward the center in one turn instead of several.history In practice it often helps in three ways:
- King safety: the king leaves the center, where files tend to open early, and sits behind pawns.
- Rook activity: a corner rook gets one step closer to the central files.
- Connected rooks: once the pieces between them have moved, the two rooks can protect each other.
That is usually true, not always. A castled king can still be attacked, and in some positions the king is safer in the center or castling would walk into an attack. The rule tells you when you may castle; strategy tells you when you should.
How to castle kingside (short castling)
Kingside castling uses the rook nearest the king, on the h-file. It is called short castling because only two squares separate the king and rook. It is written O-O.
White
- Make sure f1 and g1 are empty.
- Move the king e1 → g1.
- Move the rook h1 → f1.
Notation: O-O
Black
- Make sure f8 and g8 are empty.
- Move the king e8 → g8.
- Move the rook h8 → f8.
Notation: O-O
Kingside castling is legal when the king and h-rook have never moved, f1 and g1 are empty (f8 and g8 for Black), the king is not in check, and neither f1 nor g1 is attacked. Watch it move in the simulator.
How to castle queenside (long castling)
Queenside castling uses the a-file rook. It is long castling because three squares separate king and rook, and it is written O-O-O. The king still moves exactly two squares.
White
- Make sure b1, c1 and d1 are empty.
- Move the king e1 → c1.
- Move the rook a1 → d1.
Notation: O-O-O
Black
- Make sure b8, c8 and d8 are empty.
- Move the king e8 → c8.
- Move the rook a8 → d8.
Notation: O-O-O
The b-file square is the classic trap. b1 (or b8) must be empty, but it may be attacked: only the rook passes over it, and the safety rule covers the king's squares alone.FIDE
Kingside vs. queenside castling
| Feature | Kingside (short) | Queenside (long) |
|---|---|---|
| Notation | O-O | O-O-O |
| Rook used | h-file rook | a-file rook |
| White king / rook | e1 → g1 / h1 → f1 | e1 → c1 / a1 → d1 |
| Black king / rook | e8 → g8 / h8 → f8 | e8 → c8 / a8 → d8 |
| Squares that must be empty | 2 (f, g) | 3 (b, c, d) |
| King squares that must be safe | e, f, g | e, d, c |
| Typical considerations | Needs only the knight and bishop moved, so it is usually available sooner | Needs the queen moved too; the rook lands on the central d-file, but the king sits nearer the center and the a-pawn can be a weakness |
Neither side is always better. Pick the side where your king will be safest in that position.
Castling simulator: watch all four moves
Choose a castling move, then press Castle. The king moves first, then the rook. Every final position was checked with a chess-rules library.
White kingside · O-O
- King
- e1 → g1
- Rook
- h1 → f1
- Must be empty
- f1, g1
- Must not be attacked
- e1, f1, g1
Starting position. Press Castle.
King's path Must be empty Moved
Black's moves as static diagrams
Can you castle here? Test yourself
Twelve curated positions, each checked with a chess-rules library. Decide whether the castling move described is legal, then read why.
Castling rights depend on what happened earlier, not just on where the pieces stand. Where it matters, each position shows the game so far, and every position includes its FEN, whose third field records the remaining castling rights (K, Q, k, q, or “-” for none). This is a practice exercise, not a measure of chess strength.
-
Position 1 of 12 · White to move
White wants to castle kingside. Is castling legal?
Game so far: 1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5
r1bqk1nr/pppp1ppp/2n5/2b1p3/2B1P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 4 4Try it on the analysis boardReveal the answer
Legal. All conditions met.
Neither the king nor the h1 rook has moved, f1 and g1 are empty, and e1, f1 and g1 are not attacked. O-O is legal.
-
Position 2 of 12 · White to move
White wants to castle queenside. Is castling legal?
Game so far: 1.d4 d5 2.Nc3 Nc6 3.Bf4 Bf5 4.Qd2 Qd7
r3kbnr/pppqpppp/2n5/3p1b2/3P1B2/2N5/PPPQPPPP/R3KBNR w KQkq - 6 5Try it on the analysis boardReveal the answer
Legal. All conditions met.
The knight, bishop and queen have left b1, c1 and d1. The king and a1 rook are unmoved and e1, d1, c1 are safe. O-O-O is legal.
-
Position 3 of 12 · White to move
White wants to castle kingside. Is castling legal?
Curated position. No history needed: the FEN records the castling rights.
4k3/4r3/8/8/8/8/8/R3K2R w KQ - 0 1Try it on the analysis boardReveal the answer
Illegal. Not while in check (Art. 3.8.2.2).
The rook on e7 is giving check. Castling is never a way out of check. White keeps the right to castle later, because the king has not moved.
-
Position 4 of 12 · White to move
White wants to castle kingside. Is castling legal?
Curated position. No history needed: the FEN records the castling rights.
4k3/8/8/8/2b5/8/8/4K2R w K - 0 1Try it on the analysis boardReveal the answer
Illegal. King may not cross an attacked square.
The bishop on c4 attacks f1, the square the king must pass over. The king is not in check and g1 is safe, but crossing f1 is enough to make O-O illegal.
-
Position 5 of 12 · White to move
White wants to castle kingside. Is castling legal?
Curated position. No history needed: the FEN records the castling rights.
4k3/8/8/8/8/8/7b/4K2R w K - 0 1Try it on the analysis boardReveal the answer
Illegal. King may not land in check.
The bishop on h2 covers g1. Castling would put the king in check on arrival, which no move may do.
-
Position 6 of 12 · White to move
White wants to castle kingside. Is castling legal?
Game so far: 1.e4 e5 2.Nf3 Nc6
r1bqkbnr/pppp1ppp/2n5/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq - 2 3Try it on the analysis boardReveal the answer
Illegal. Squares between must be empty.
The bishop is still on f1. Every square between the king and the rook must be empty; develop the bishop first.
-
Position 7 of 12 · White to move
White wants to castle kingside. Is castling legal?
Game so far: 1.e4 e5 2.Ke2 Ke7 3.Ke1 Ke8 4.Nf3 Nf6 5.Be2 Be7
rnbqk2r/ppppbppp/5n2/4p3/4P3/5N2/PPPPBPPP/RNBQK2R w - - 8 6Try it on the analysis boardReveal the answer
Illegal. King has moved (Art. 3.8.2.1).
The king went to e2 and came back. It looks untouched, but moving the king removes both castling rights permanently. The FEN shows this as “-” in the castling field. This king walk is the famous double Bongcloud.
-
Position 8 of 12 · White to move
White wants to castle kingside. Is castling legal?
Game so far: 1.e4 e5 2.Nf3 Nf6 3.Bc4 Bc5 4.Rf1 Nc6 5.Rh1 d6
r1bqk2r/ppp2ppp/2np1n2/2b1p3/2B1P3/5N2/PPPP1PPP/RNBQK2R w Qkq - 0 6Try it on the analysis boardReveal the answer
Illegal. That rook has moved (Art. 3.8.2.1).
The h1 rook went to f1 and back. Kingside castling is gone for good, even though the rook is home again. Queenside castling would still be possible later.
-
Position 9 of 12 · White to move
White wants to castle queenside. Is castling legal?
Curated position. No history needed: the FEN records the castling rights.
4k3/r7/8/8/8/8/8/R3K3 w Q - 0 1Try it on the analysis boardReveal the answer
Legal. An attacked rook is allowed.
Black's rook on a7 attacks White's rook on a1, but only the king's squares (e1, d1, c1) must be safe. O-O-O is legal.
-
Position 10 of 12 · White to move
White wants to castle queenside. Is castling legal?
Curated position. No history needed: the FEN records the castling rights.
1r2k3/8/8/8/8/8/8/R3K3 w Q - 0 1Try it on the analysis boardReveal the answer
Legal. The rook may cross an attacked square.
Black's rook on b8 attacks b1. Only the rook passes over b1; the king travels e1, d1, c1, all safe. O-O-O is legal.
-
Position 11 of 12 · White to move
White wants to castle kingside. Is castling legal?
Game so far: 1.e4 e5 2.Nf3 d6 3.Bc4 Bg4 4.Nc3 g6 5.Nxe5 Bxd1
rn1qkbnr/ppp2p1p/3p2p1/4N3/2B1P3/2N5/PPPP1PPP/R1BbK2R w KQkq - 0 6Try it on the analysis boardReveal the answer
Legal. The queen doesn't matter.
White's queen was just captured, but castling depends only on the king and rook. O-O is legal. (White has an even better move here, Bxf7+, the start of the famous Légal's mate.)
-
Position 12 of 12 · White to move
White wants to castle kingside. Is castling legal?
Game so far: 1.e4 e5 2.a4 a5 3.Ra3 Nc6 4.Nf3 Nf6 5.Bc4 Bc5
r1bqk2r/1ppp1ppp/2n2n2/p1b1p3/P1B1P3/R4N2/1PPP1PPP/1NBQK2R w Kkq - 6 6Try it on the analysis boardReveal the answer
Legal. Only the castling rook counts.
The a1 rook has moved, so queenside castling is lost. The h1 rook and the king are unmoved, so kingside castling is still legal.
When can you not castle?
There are two kinds of restriction, and the difference matters. Permanent restrictions come from history: once lost, a castling right never returns. Temporary ones depend on the current position and disappear when the position changes.FIDE
Permanent: the right is lost
1. The king has already moved
Any king move, even one that returns to e1 or e8, removes castling on both sides for the rest of the game. Here the king went e1–e2–e1: every piece looks unmoved, yet White can never castle. The FEN shows it: its castling field has no K or Q.
2. That rook has already moved
Moving a rook removes castling on that rook's side only. Here the h1 rook went to f1 and came back, so O-O is gone for good, but O-O-O is still possible later because the a1 rook and king are unmoved. The same happens if the rook is captured on its home square.
Temporary: not right now
3. The king is in check
You cannot castle out of check. Deal with the check first by blocking, capturing or (at the cost of castling) moving the king. If you block or capture, the right to castle survives.
4. The king would cross an attacked square
The bishop on c4 attacks f1. The king is not in check and g1 is safe, but it may not pass over f1, so O-O is illegal.
5. The king would land in check
The bishop on h2 covers g1. No move may put your own king in check, and castling is no exception.
6a. A piece blocks the short path
The bishop on f1 is in the way. Develop it and O-O becomes possible.
6b. Pieces block the long path
The knight on b1 and queen on d1 block O-O-O. All three squares between king and rook, including b1, must be empty, whether the blocking piece is yours or your opponent's.
In diagrams: blue squares are the king's path, red squares break the rule, × marks an attacked square, and a ring marks a blocking piece.
Common castling myths
FalseYou can't castle if your rook is attacked.
An attacked rook is fine. Only the king's starting, crossing and landing squares must be safe.
FalseYou can castle after moving your king back home.
Moving the king removes both castling rights permanently, even if it returns.
FalseBoth rooks must be unmoved.
Only the rook you castle with must be unmoved.
FalseYou can castle out of check.
The king may not be in check when castling. Afterwards, if the king never moved, you may castle later.
FalseYou must castle before move 10.
There is no deadline. Castling is legal on any move as long as the conditions hold.
FalseCastling always makes your king safer.
It usually helps, but castling into an attack can make things worse.
TrueYou can castle after your queen is captured.
Castling involves only the king and one rook. Position 11 in the quiz shows it.
TrueThe b1 or b8 square may be attacked.
It must be empty, but only the rook crosses it.
When should you castle?
The rules say when castling is allowed; strategy decides when it is wise. These are guidelines, not laws.
- Develop first. Castling needs the pieces between king and rook out of the way, so it follows naturally from bringing out knights and bishops, as in the Italian Game.
- Castle before the center opens. When central pawns are exchanged, files open toward an uncastled king.
- Check the pawn shelter. A king behind three unmoved pawns is well covered; pawns pushed in front of it make castling there less attractive.
- Look at the opponent's pieces. If enemy pieces are already aimed at one side, castling there may walk into the attack.
- Think about your rook. After castling, which file can the rook use? Queenside castling puts it straight onto the d-file.
- Opposite-side castling. When players castle on different sides, both often push pawns toward the enemy king, and the game becomes a race.
- Delaying can be fine. If the center is closed and the king is not under pressure, you can keep the choice open and castle once you see where your king will be safest. In many endgames the king is better used in the center, and castling may never happen.
New to openings? The best chess openings for beginners all lead to quick, safe castling.
How to castle on online chessboards
Most digital boards let you castle by moving the king two squares toward the rook; the rook then moves automatically. If the move is not legal in that position, the board simply refuses it.
- Chess Move Finder: in Play Chess, drag the king two squares, tap the king and then its destination square, or type the move in the move box as
O-O,O-O-Oor in coordinates such ase1g1. - Chess.com: according to its help centre, drag or click the king two squares, or drop it onto the rook; a “Legacy” setting changes the click method.Chess.com
If a site will not let you castle, check the same conditions as on a real board. When you set up a position yourself, also check that its castling rights are set: an editor cannot know a piece's history. On a physical board in rated games, touch and move the king first; touching the rook first means you may not castle on that side that move (FIDE Art. 4.4.2).FIDE
Castling notation: O-O and O-O-O
O-OKingside castling, for White or BlackO-O-OQueenside castling, for White or BlackYou will see two spellings. FIDE's own notation appendix writes castling with zeros, 0-0 and 0-0-0 (Appendix C.13), and so do many printed books.FIDE The PGN file format used by chess software, including this site, writes capital letter Os: O-O and O-O-O. Both mean exactly the same move; when typing a move into software, use letter O. Add + if castling gives check (O-O+) and # if it is checkmate (O-O-O#), the same as any move. Example: 4. O-O Nf6 means White castled kingside on move 4 and Black replied with a knight move. More symbols are in the chess notation guide.
Castling rules: quick reference
Castling rules in eight lines
- Castling is one move of the king and one rook along the player's first rank.
- The king moves two squares toward the rook; the rook moves to the square the king crossed.
- Kingside: king to g1/g8, rook to f1/f8 (
O-O). Queenside: king to c1/c8, rook to d1/d8 (O-O-O). - Permanently lost on both sides once the king moves, and on one side once that rook moves or is captured.
- Temporarily prevented if any piece stands between the king and the rook.
- Temporarily prevented if the king's square, the square it crosses, or the square it lands on is attacked.
- The rook may be attacked, and may cross an attacked square (b1 or b8).
- Each player castles at most once per game, since castling moves the king.
Source: FIDE Laws of Chess, Article 3.8.2 (effective 1 January 2023, current edition).FIDE
Printable castling cheat sheet
One page for a club, classroom or the fridge door. The button opens your browser's print dialog, where you can also choose “Save as PDF”.
You may castle if
- The king has never moved
- That rook has never moved
- Every square between them is empty
- The king is not in check
- The king does not cross an attacked square
- The king does not land on an attacked square
Myths
- Rook attacked? Still legal
- b1/b8 attacked? Still legal
- Queen gone? Still legal
- King moved and returned? Never again
- Other rook moved? This side still OK
Free to print and share for teaching. Please credit Chess Move Finder and link to this page.
Castling FAQ
How do you castle in chess?
Move the king two squares toward a rook, then move that rook to the square the king crossed. It counts as one move, and it is legal only if the king and rook are unmoved, the squares between them are empty, and the king is not in, passing through, or landing in check.
How do you castle kingside?
With f1 and g1 empty, move the king e1 to g1 and the rook h1 to f1 (Black: e8 to g8, h8 to f8). It is written O-O.
How do you castle queenside?
With b1, c1 and d1 empty, move the king e1 to c1 and the rook a1 to d1 (Black: e8 to c8, a8 to d8). It is written O-O-O.
Can you castle while in check?
No. You must get out of check first. If you do it without moving the king, you can still castle on a later move.
Can you castle through check?
No. The king may not cross a square the opponent attacks. Only the king's squares count; the rook may cross an attacked square.
Can you castle if your rook is attacked?
Yes. An attacked rook does not prevent castling.
Can you castle after moving your king?
No, never again in that game, on either side, even if the king returns to its starting square.
Can you castle after moving your rook?
Not with that rook. You can still castle with the other rook if it and the king have never moved.
Can you castle more than once?
No. Castling moves the king, which removes all further castling rights.
Can you castle if your queen has been captured?
Yes. The queen plays no part in the castling rules.
Why is my castling move illegal?
Check, in order: is it your turn; has the king or that rook moved before; is any square between them occupied; are you in check; is the crossing or landing square attacked? In a position you set up yourself, also check the FEN's castling rights.
Is queenside castling better?
Neither side is better in general. Queenside puts the rook on the d-file at once but takes longer to prepare and leaves the king nearer the center. Choose by the position.
Can you castle on your first move?
No, not from the standard starting position: knights, bishops and the queen are in the way. Castling becomes possible only once those pieces move.
Can you castle after capturing an opponent's piece?
Yes, as long as the capture was not made by your king or that rook. Earlier captures by other pieces do not affect castling.
Does castling count as one move or two?
One move. The king and rook both move in the same turn, and it is your whole move for that turn.
Sources and method
- FIDE Laws of Chess, effective 1 January 2023: Article 3.8.2 (castling), 4.4 (touching king and rook), Appendix C.13 (castling notation), Guidelines II.3 (Chess960). FIDE's Rules Commission lists this as the current edition.
- Chess.com Help Center: How do I castle?
- History of chess (Wikipedia, secondary): castling grew out of earlier “king's leap” rules in Europe.
Every diagram and quiz answer was generated and checked with python-chess, an open-source rules library: legality from its move generator, cross-checked against an independent test of each castling condition. Written by the Chess Move Finder team; not reviewed by an outside instructor. Spot an error? Tell us. Also see how to play chess, how to set up a chess board and how the king and rook move.