Skip to content
Rules & Legal Game StatesGuide

Castling

Learn exactly when castling is legal, which squares must be empty or safe, how castling rights are lost, and the difference between kingside and queenside castling.

Castling is the only orthodox chess move in which the king and a rook change squares as part of the same move.

It is often taught with a shortcut:

"Move the king two squares toward the rook, then put the rook beside it."

That describes the visible result, but it does not explain when castling is legal.

Castling depends on two different kinds of conditions:

  1. permanent castling rights — whether the king and relevant rook have previously moved;
  2. temporary position conditions — whether the path is clear and whether the king's required squares are safe now.

Keeping those categories separate prevents most castling mistakes.

What castling is

Under the FIDE Laws, castling is a move of the king involving either rook of the same color on the player's first rank.

It counts as one move of the king.

In standard orthodox chess:

  • the king moves two squares toward the chosen rook;
  • that rook moves to the square the king has just crossed.

There are two forms:

  • kingside castling;
  • queenside castling.
Key idea

Castling moves two chessmen, but it is one move — a special king move involving a rook.

Before and after

In the standard initial geometry:

Kingside

King finishes on the g-file. Rook finishes on the f-file.

Queenside

King finishes on the c-file. Rook finishes on the d-file.

Castling destinationsThe king and rook finish on fixed squares
W O-OBefore
W O-OAfter
B O-OBefore
B O-OAfter
W O-O-OBefore
W O-O-OAfter
B O-O-OBefore
B O-O-OAfter
Focus squareCorrect
Before/after geometry for kingside and queenside castling by both colors.

Kingside castling

For White:

  • king: e1 → g1;
  • rook: h1 → f1.

For Black:

  • king: e8 → g8;
  • rook: h8 → f8.

The king crosses:

  • White: f1;
  • Black: f8.

So the king's three relevant squares for the attacked-square rule are:

White kingside

  • start: e1;
  • transit: f1;
  • destination: g1.

Black kingside

  • start: e8;
  • transit: f8;
  • destination: g8.
White kingsideThe king's safety path is e1 → f1 → g1
CorrectFocus square
The rook relocates h1 → f1 while all three king-path squares must satisfy the safety rule.
Black kingsideBlack uses the same castling geometry on rank eight
CorrectFocus square
Black king path e8 → f8 → g8; rook h8 → f8.

Notation preview

Kingside castling is commonly recorded as:

O-O

The notation itself is covered in the algebraic-notation guide; here the focus is legality.

Queenside castling

For White:

  • king: e1 → c1;
  • rook: a1 → d1.

For Black:

  • king: e8 → c8;
  • rook: a8 → d8.

The king crosses:

  • White: d1;
  • Black: d8.

So the king's three relevant squares for the attacked-square rule are:

White queenside

  • start: e1;
  • transit: d1;
  • destination: c1.

Black queenside

  • start: e8;
  • transit: d8;
  • destination: c8.
White queensideQueenside castling has one extra occupancy-only square
CorrectSecondary movement lineFocus square
King e1 → d1 → c1; rook a1 → d1. b1 must be empty but is not part of the king attack-safety path.

Why b1/b8 matters

For White queenside castling, the chessmen between king e1 and rook a1 occupy possible squares:

  • d1;
  • c1;
  • b1.

All three must be empty before castling because no chessman may stand between the king and the rook.

But the king only:

  • starts on e1;
  • crosses d1;
  • finishes on c1.

The king never occupies or crosses b1.

Therefore:

  • b1 must be empty;
  • b1 does not need to be unattacked merely because of castling.

The same logic applies to b8 for Black.

Key idea

Queenside castling has an extra empty square that is not a king-safety square.

Common mistake
"If b1 is attacked, White cannot castle queenside."

Not necessarily.

An attack on b1 alone does not prevent orthodox queenside castling.

What matters for king attack status is:

  • e1;
  • d1;
  • c1.

The separate occupancy rule still requires b1 to be empty.

Permanent loss of castling rights

Some castling conditions depend on the history of the game.

These are not temporary obstacles.

Once the relevant castling right is lost, moving chessmen back to their original squares does not restore it.

If the king has moved

If the king has already moved at any earlier point in the game:

that side can no longer castle at all.

This removes both:

  • kingside castling right;
  • queenside castling right.

Even if the king later returns to:

  • e1 for White;
  • e8 for Black;

the rights remain lost.

Castling historyReturning the king does not restore castling rights
1King begins e1
2Ke2
3King returns e1

Square restored; right not restored.

CorrectAvailable / movementIncorrect
Move history matters even when the board picture returns to its original king square.
Common mistake
"The king is back on e1, so castling is allowed again."

No.

The relevant fact is not only the current square.

The king has already moved.

If a rook has moved

If a rook has already moved:

  • castling with that rook is permanently lost.

Example:

  • White rook h1 moves;
  • later returns to h1.

White cannot castle kingside with that rook.

However, if:

  • White king has never moved;
  • White a1 rook has never moved;

White may still retain the queenside castling right.

Rook-specific rightsMoving one rook does not erase the other rook's history
IncorrectCorrectFocus square
If h1 moved and returned, kingside castling is lost; the unmoved a1 rook may still retain queenside rights.

Moving one rook does not automatically remove the other-side right

The rights are not one combined rook condition.

For example:

White:

  • h1 rook moved;
  • a1 rook never moved;
  • king never moved.

Potential status:

  • kingside castling: permanently lost;
  • queenside castling: still potentially available.

The current position must still satisfy the temporary conditions.

Captured rook

If the original rook is captured, castling with that rook is no longer practically possible because the required rook is absent.

A different rook cannot simply replace it for orthodox castling.

For example:

  • original a1 rook is captured;
  • later a pawn promotes to a rook;
  • promoted rook eventually reaches a1.

That does not create a new queenside castling right.

Castling rights are historical rights tied to the original king/rook situation, not a property generated by merely placing a rook on the corner.

Key idea

Castling rights depend on game history, not just current piece placement.

This becomes important again in:

  • repetition identity;
  • FEN castling-right fields;
  • reconstructed positions.

Permanent loss vs temporary prevention

This distinction is central.

Permanent loss

The right is gone for the rest of the game.

Causes:

  • king has already moved;
  • relevant rook has already moved.

Returning the chessman does not restore the right.

Temporary prevention

The historical right still exists, but castling cannot be played in the current position.

Causes:

  • king is currently in check;
  • king's transit square is attacked;
  • king's destination square is attacked;
  • a chessman stands between king and rook.

If the temporary condition later disappears, castling may become legal again — assuming the king and rook still retain the historical right.

ConditionEffectCan castling become possible later?
King previously movedRight permanently lostNo
Relevant rook previously movedThat side's right permanently lostNo
King currently in checkTemporarily preventedYes, after check disappears if rights remain
Transit square attackedTemporarily preventedYes
Destination square attackedTemporarily preventedYes
Piece between king and rookTemporarily preventedYes
Key idea

Moved before = history problem. Blocked/attacked now = current-position problem.

The king may not castle out of check

If the king is currently in check, castling is not legal.

That means the king's starting square fails the attacked-square condition.

For White:

  • if e1 is attacked, White cannot castle from e1.

For Black:

  • if e8 is attacked, Black cannot castle from e8.

This is commonly summarized as:

You cannot castle out of check.
Cannot castle out of checkThe starting square must already be safe
White to move
IncorrectCorrect
O-O is illegal while e1 is attacked even if f1 and g1 are otherwise safe and empty.

Why this follows the rule structure

Castling does not create an exception allowing a checked king to escape through a special move.

FIDE explicitly includes the king's starting square among the squares that must not be attacked.

The king may not castle through check

The square the king crosses must not be attacked.

White kingside

f1 must not be attacked.

White queenside

d1 must not be attacked.

Black kingside

f8 must not be attacked.

Black queenside

d8 must not be attacked.

If that transit square is attacked:

castling is temporarily illegal.

This is the source of the phrase:

You cannot castle through check.
Cannot castle through checkThe transit square must be safe
White to move
CorrectIncorrect
e1 and g1 are safe, but bishop a6 attacks f1, so White may not castle through f1.

The king may not castle into check

The destination square must also be unattacked.

White

  • kingside destination g1;
  • queenside destination c1.

Black

  • kingside destination g8;
  • queenside destination c8.

If the destination is attacked:

castling is illegal in the current position.

Destination safetyThe castled king's destination must be safe
White to move
CorrectIncorrectSecondary movement line
On O-O-O, c1 is part of the safety test; an attack on c1 makes castling illegal.
Key idea

The king must be safe on:

start → transit → destination

during castling.

The rook may be attacked

This is where a common shortcut becomes inaccurate.

Players sometimes learn:

"None of the castling pieces can be under attack."

That is false.

The FIDE attacked-square restriction is stated for:

  • the king's starting square;
  • the square the king crosses;
  • the king's destination square.

It does not say that the rook's square must be unattacked.

Therefore a rook may be attacked and castling can still be legal if every other requirement is satisfied.

Rook may be attackedCastling legality protects the king path, not the rook's square
White to move
CorrectCapture / attack
The rook h1 is attacked, but e1, f1 and g1 are safe; with all other conditions met, O-O is legal.
Warning

Do not apply the king's attacked-square restrictions to the rook.

The rook may move through attacked squares

In queenside castling, the rook travels from a1 to d1.

Its route conceptually passes across:

  • b1;
  • c1.

The Laws do not require squares traversed only by the rook to be unattacked.

What must be true is:

  • no chessman stands between king and rook;
  • the king's start/transit/destination squares are not attacked.

So an attack on:

  • a1;
  • b1

does not by itself make White queenside castling illegal.

An attack on:

  • c1

does matter — but because c1 is the king's destination.

An attack on:

  • d1

does matter — because d1 is the king's transit square.

Key idea

Attack restrictions follow the king, not the rook.

Pieces between king and rook

Castling is temporarily prevented if any chessman stands between the king and the rook involved.

For White kingside castling, the between-squares are:

  • f1;
  • g1.

Both must be empty.

For Black kingside:

  • f8;
  • g8.

Both empty.

For White queenside:

  • d1;
  • c1;
  • b1.

All empty.

For Black queenside:

  • d8;
  • c8;
  • b8.

All empty.

Castling sideKingRookSquares that must be empty
White kingsidee1h1f1, g1
White queensidee1a1d1, c1, b1
Black kingsidee8h8f8, g8
Black queensidee8a8d8, c8, b8

Friendly or enemy chessman?

In ordinary legal positions, the relevant issue is simply occupancy:

there must be no chessman between king and rook.

A friendly bishop blocks castling.

A friendly knight blocks castling.

A friendly queen blocks castling.

The rule is not:

"the king needs an empty route but the rook can jump the rest."

Neither castling piece jumps over an intervening chessman.

Queenside b-file reminder

The b-file square:

  • b1 for White;
  • b8 for Black;

must be empty because it lies between the king and rook.

But it is not part of the king's travel.

So remember the two independent checks:

occupancy

  • d1/c1/b1 empty.

king attack

  • e1/d1/c1 safe.

Complete orthodox castling test

When deciding whether standard castling is legal, use this sequence.

Checklist

1. Is the king on its original square and has it never moved?

White:

  • e1.

Black:

  • e8.

If the king has previously moved:

  • no castling.

2. Is the chosen original rook present on its original square and has it never moved?

Kingside:

  • h1 / h8.

Queenside:

  • a1 / a8.

If that rook previously moved:

  • no castling with that rook.

3. Are all squares between king and rook empty?

Kingside:

  • f/g.

Queenside:

  • d/c/b.

If any is occupied:

  • castling currently prevented.

4. Is the king's starting square unattacked?

If no:

  • cannot castle out of check.

5. Is the king's transit square unattacked?

If no:

  • cannot castle through check.

6. Is the king's destination square unattacked?

If no:

  • cannot castle into check.

7. Ignore attacks that matter only to the rook

The rook:

  • may currently be attacked;
  • may travel across attacked squares.

8. Execute as one move

King:

  • moves two squares toward rook.

Rook:

  • moves to the square the king crossed.
Castling checklistCastling is legal only after three separate tests pass
01Castling right existsKing and chosen rook retain the required unmoved history.
02Path emptyNo chessman occupies a square that must be clear between king and rook.
03King path safeStart, transit and destination satisfy the attack-safety rule.
04Castling legalMove king and rook to their fixed castled squares as one move.
History, occupancy and king-path safety are independent requirements.

Castling legality practice

Exercise set

Case 1 — King moved and returned

White:

  • king currently e1;
  • rook h1;
  • f1/g1 empty;
  • e1/f1/g1 safe;
  • king moved earlier and returned.

Question: Can White castle kingside?

Answer: No.

Reason: castling right was permanently lost when the king moved.

Case 2 — Rook moved and returned

White:

  • king never moved;
  • rook currently h1;
  • rook moved earlier to h2 and returned;
  • path and king squares safe.

Answer: No kingside castling.

Reason: the right with that rook was permanently lost.

Case 3 — King in check

White:

  • king e1 currently attacked;
  • f1/g1 safe;
  • path empty;
  • historical rights intact.

Answer: No.

Reason: cannot castle out of check.

Case 4 — Transit square attacked

White kingside:

  • e1 safe;
  • f1 attacked;
  • g1 safe;
  • path empty.

Answer: No.

Reason: king may not cross an attacked square.

Case 5 — Destination attacked

White queenside:

  • e1 safe;
  • d1 safe;
  • c1 attacked;
  • b1/d1/c1 empty.

Answer: No.

Reason: king may not castle into check.

Case 6 — Rook attacked

White kingside:

  • h1 rook attacked;
  • e1/f1/g1 safe;
  • f1/g1 empty;
  • historical rights intact.

Answer: Yes, castling may be legal.

Reason: attack on rook does not itself prevent castling.

Case 7 — b1 occupied

White queenside:

  • e1/d1/c1 safe;
  • d1/c1 empty;
  • b1 occupied by White knight.

Answer: No.

Reason: a chessman stands between king and rook.

Case 8 — b1 attacked but empty

White queenside:

  • b1 empty but attacked;
  • e1/d1/c1 safe;
  • all between-squares empty;
  • historical rights intact.

Answer: Yes, the b1 attack alone does not prevent castling.

Reason: b1 is not a king start/transit/destination square.

Case 9 — d1 occupied

White queenside:

  • d1 occupied;
  • all attack conditions otherwise satisfied.

Answer: No.

Reason: a chessman lies between king and rook and the king's transit square is occupied.

All conditions satisfied.

Answer: legal.

Task: move:

  • king e1 → g1;
  • rook h1 → f1.

Common castling mistakes

Common mistake

"The rook is attacked, so I can't castle."

Wrong.

Rook attack does not by itself prevent castling.

Common mistake

"The king was in check last move, so castling rights are gone forever."

Wrong.

Being in check does not permanently remove castling rights.

If:

  • king did not move;
  • relevant rook did not move;

and the current temporary conditions later become legal, castling may still be possible.

Common mistake

"I moved my king back, so the right returned."

Wrong.

A king that has previously moved has permanently lost both castling rights.

Common mistake

"Queenside b1 can contain a piece because the king never goes there."

Wrong.

b1 lies between king and a1 rook.

It must be empty.

Common mistake

"The rook's whole route must be safe from attack."

Wrong.

Attack restrictions are imposed on the king's:

  • starting square;
  • transit square;
  • destination square.
Common mistake

"A new rook on the corner can restore castling."

Wrong in orthodox chess.

Castling rights are historical and cannot be manufactured by moving or promoting another rook onto the original corner.

Castling and current position data

Castling shows why piece placement alone does not always describe the full legal state of a chess position.

Consider two diagrams with identical pieces:

  • White king e1;
  • White rook h1;
  • f1/g1 empty.

In Position A:

  • neither king nor rook has ever moved.

In Position B:

  • rook moved earlier and returned.

The boards look identical.

But:

  • Position A may retain kingside castling right.
  • Position B does not.
Key idea

Castling rights are invisible history carried by the position.

This becomes important in formal position representations.

For example, FEN includes castling-right information because board occupancy alone is insufficient.

Castling and repetition identity — preview

Castling rights also matter when deciding whether two positions count as the same position for repetition rules.

A board arrangement that looks identical may not be legally identical if:

  • castling was available in one occurrence;
  • castling rights were lost before a later occurrence.

The full repetition identity rule belongs to 02.7.

Orthodox castling vs Chess960

Everything in this section describes standard orthodox chess castling.

Chess960/Fischer Random uses the same broad castling concept but starts from different back-rank arrangements and requires its own exact handling.

Chess960 and other variants require their own exact castling treatment because the starting geometry changes.

Castling rules at a glance

Castling can be understood with two layers.

Layer 1 — historical right

The right exists only if:

  • king has never moved;
  • relevant rook has never moved.

Once lost:

  • it does not return.

Layer 2 — current-position legality

Castling is currently prevented if:

  • king's starting square is attacked;
  • king's transit square is attacked;
  • king's destination square is attacked;
  • any chessman stands between king and rook.

The rook:

  • may be attacked;
  • may pass through attacked squares.
Key idea

King history + rook history + clear path + safe king path = legal castling.

Standard final squares

SideKingRook
White O-Oe1 → g1h1 → f1
White O-O-Oe1 → c1a1 → d1
Black O-Oe8 → g8h8 → f8
Black O-O-Oe8 → c8a8 → d8

A closely related special rule returns to the pawn: when a pawn advances two squares past an enemy pawn's ordinary capture square, the temporary en passant capture may become available.