Beginner

Castling Rules: When and How You Can Castle

Castling is a single king move that also relocates a rook. It can secure the king and connect the rooks, but it is legal only when the king and chosen rook have never moved, the path is empty, and the king is safe on its starting, crossing, and destination squares.

Castling Rules: When and How You Can Castle

How castling works

In standard chess, the king begins on e1 for White or e8 for Black. To castle, move the king two squares toward a rook on its original corner; then place that rook on the square the king crossed.

SideWhite's final squaresBlack's final squaresNotation
KingsideKing g1, rook f1King g8, rook f8O-O
QueensideKing c1, rook d1King c8, rook d8O-O-O

The notation uses capital letter O characters, not zeroes. Castling counts as one move even though two pieces change squares.

You may castle only if all five statements are true:

  1. The king has never moved. Returning it to e1 or e8 does not restore castling rights.
  2. The chosen rook has never moved. A rook that moves away and returns cannot castle. The other rook may still retain its own right.
  3. Every square between the king and that rook is empty. For White kingside this means f1 and g1; for White queenside it means d1, c1, and b1.
  4. The king is not currently in check. Castling is not a way to escape an existing check; review check, checkmate, and stalemate if the attack status is unclear.
  5. The king does not cross or finish on an attacked square. The relevant route is e1–f1–g1 or e1–d1–c1 for White, with the corresponding eighth-rank route for Black.

The position below removes all intervening pieces so the king's route is easy to inspect. For White kingside castling, e1 must be safe now, and f1 and g1 must not be attacked. If those conditions and the move-history conditions are satisfied, White may play O-O.

The empty castling lanes make the king's route easy to inspect.Which squares must be safe for White to castle kingside?
Show answer

White's king may not be in check on e1 and may not cross or finish on attacked f1 or g1.

Which attacked squares matter?

Only the king's starting, crossing, and destination squares are tested for attacks. This creates several useful clarifications:

  • You may castle when the rook is attacked, provided every other condition is satisfied.
  • During queenside castling, b1 or b8 must be empty but does not need to be safe because the king never occupies or crosses it.
  • The rook may cross an attacked square. The restriction applies to the king.
  • An enemy piece still attacks a square for castling purposes even when moving that enemy piece would expose its own king. FIDE's definition of an attacked square includes this case.

When unsure, mark the king's three-square route and calculate enemy attacks on each square in the position before castling.

Castling rights depend on history

A board diagram alone does not always reveal whether castling is legal. A king and rook can stand on their original squares after having moved earlier. Their positions look normal, but the right is permanently lost.

This history is why position formats store castling rights separately from piece placement. In Forsyth–Edwards Notation, the field KQkq represents White kingside, White queenside, Black kingside, and Black queenside rights. A dash means no castling right remains.

Capturing a rook also removes the practical ability to castle with it. If a player promotes a pawn to a rook and places it on a corner, that new rook does not gain castling rights.

How to castle over the board

Under standard over-the-board rules, castling is a king move. Use one hand, move the king first, and then move the rook with the same hand. Touching the rook first can require you to move that rook rather than castle under touch-move rules.

On most online boards, moving the king two squares or dropping it on the rook triggers castling. Interfaces differ, so moving the king to its destination is the most portable method.

Legal does not always mean best. Castling usually improves safety, but delaying it can be sensible when the center is closed and the opponent has already launched pawns toward that wing. In some endgames, centralizing the king may be more valuable than castling.

Before castling automatically, ask:

  • Is the center about to open against my current king?
  • Which wing has fewer enemy attackers and fewer open lines?
  • Will castling place my king in front of an advancing pawn storm?
  • Does the move activate my rook or leave it without a useful file?
  • Does waiting allow the opponent to remove my castling right with a forcing check?

For beginners, early castling after developing minor pieces is still a reliable default. The questions above refine the decision; they do not justify leaving the king in the center without a concrete reason.

Common castling mistakes

  • Trying to castle after the king or selected rook moved earlier.
  • Attempting to castle while in check.
  • Checking only the destination and overlooking an attacked crossing square.
  • Believing an attacked rook makes castling illegal.
  • Forgetting the extra b-file clearance required for queenside castling.
  • Moving the rook first in an over-the-board game.
  • Assuming castling rights from piece placement alone when loading a saved position.

Practice drill

Set up kings and rooks on their original squares, clear the lanes, and test six variations: a fully legal position, king in check, crossing square attacked, destination attacked, rook attacked, and king moved earlier. For each case, state the single condition that permits or prevents castling.

Then add one bishop or rook that changes only one attacked square. Recalculate the king's entire route rather than relying on the previous answer.

Frequently asked questions

Can you castle through check?

No. The king may not start in check, cross an attacked square, or finish in check.

Can you castle if the rook is attacked?

Yes. An attack on the rook does not by itself prevent castling. The king's route must still be safe and every other condition must hold.

Can you castle after being in check?

Yes, if you answered the earlier check without moving the king, still retain the chosen rook's right, and all castling conditions are satisfied later. Being checked does not itself erase the right; moving the king does.

Can you castle on both sides in one game?

No. Your first castling move moves the king, so no second castling right can remain afterward.

What to learn next

Castling is one of several special rules whose legality depends on exact conditions. Browse the beginner chess lessons, continue with pawn promotion, and review how chess pieces move if the path and attack tests are not yet automatic.

Rules reference: FIDE Laws of Chess, Articles 3.8 and 4.4.

Help shape the 1chess.online pilot

What are you interested in?
What else would you like to see? (optional)