ChessWorld.net - Play Online Chess

Can You Castle Through Check?

No. The king cannot castle while in check, through an attacked square, or into check. The rook may be attacked, and in queenside castling the b-file square may be attacked, because the king never occupies those squares.

The Three-Square King Test

White kingside: O-O

Start: e1   Cross: f1   Finish: g1

All three squares must be safe.

White queenside: O-O-O

Start: e1   Cross: d1   Finish: c1

The b1 square must be empty, but it may be attacked.

Black kingside: O-O

Start: e8   Cross: f8   Finish: g8

All three squares must be safe.

Black queenside: O-O-O

Start: e8   Cross: d8   Finish: c8

The b8 square must be empty, but it may be attacked.

All three king squares must be safe. Then separately confirm that castling rights remain and every square between the king and rook is empty.

Is Castling Legal? Ten-Position Trainer

Choose Legal or Illegal. The answer reveals the exact square or condition that decides the move.

Score: 0 / 0

1. Can White castle kingside?

The route is empty, all three king squares are safe, and White retains kingside rights.

2. Can White castle out of check?

The black rook on e8 attacks the king on e1.

3. Can White castle through check on f1?

The bishop on b5 attacks f1, although e1 and g1 are safe.

4. Can White castle into check on g1?

The black rook on g8 attacks the king's destination.

5. Can White castle while the rook is attacked?

The black rook on h8 attacks White's rook on h1, but the king's route is safe.

6. Does the pinned bishop stop castling?

The bishop on b5 is pinned to its king by the rook on b1, but it attacks f1.

7. Can White castle queenside while b1 is attacked?

The black rook attacks b1, while e1, d1 and c1 are safe and the path is clear.

8. Can White castle queenside through d1?

The black rook on d8 attacks d1.

9. Can White castle after moving the king?

The pieces appear correctly placed, but White no longer has castling rights.

10. Can White castle queenside with b1 occupied?

The king does not cross b1, but a knight remains between the king and rook.

Castling Legality Checklist

  1. Confirm the king and chosen rook have never moved.
  2. Clear every square between them.
  3. Confirm the king is not currently in check.
  4. Check the king's transit square for attacks.
  5. Check the king's destination square after castling.

For the pinned-attacker logic, continue with Can a Pinned Piece Give Checkmate? and Can a King Capture a Pinned Piece?.

Castling Through Check FAQs

Core castling rules

Can you castle through check?

No. The king may not castle across a square attacked by an enemy piece.

Can you castle while in check?

No. The king must not be in check on its starting square when castling begins.

Can you castle into check?

No. The king's destination square must be safe after castling.

Which squares must be safe when castling kingside?

For White, e1, f1 and g1 must not be attacked. For Black, e8, f8 and g8 must not be attacked.

Which squares must be safe when castling queenside?

For White, e1, d1 and c1 must not be attacked. For Black, e8, d8 and c8 must not be attacked.

What does castling through check mean?

It means the king would cross an attacked transit square, such as f1 during White's kingside castling or d1 during White's queenside castling.

Is castling through check an illegal move?

Yes. The castling move must be rejected even when the destination itself appears safe.

Can you castle out of check?

No. Castling cannot be used as an escape from a check on the king's starting square.

Rook and queenside edge cases

Can you castle if the rook is attacked?

Yes, provided every other castling condition is satisfied. The rook's starting square does not need to be safe.

Can you castle if the rook passes through an attacked square?

Yes. Only the king's starting, transit and destination squares are tested for enemy attacks.

Can you castle queenside if b1 is attacked?

Yes, if e1, d1 and c1 are safe and all other conditions are met. The king never crosses b1.

Can Black castle queenside if b8 is attacked?

Yes, if e8, d8 and c8 are safe. The b8 square matters for clearance but not for the king's attack test.

Must b1 be empty for queenside castling?

Yes. All squares between the king and rook must be empty, so b1, c1 and d1 must be clear for White.

Must b8 be empty for Black to castle queenside?

Yes. Black needs b8, c8 and d8 clear between the king and the a8-rook.

Can you castle if f1 is attacked?

White cannot castle kingside because the king must cross f1. An attack on f1 does not by itself prevent queenside castling.

Can you castle if g1 is attacked?

White cannot castle kingside because g1 is the king's destination square.

Attacked squares and pinned pieces

Can you castle if d1 is attacked?

White cannot castle queenside because the king must cross d1. Kingside castling may still be legal.

Can you castle if c1 is attacked?

White cannot castle queenside because c1 is the king's destination square.

Does an attack from a pinned piece stop castling?

Yes. A pinned piece still attacks squares for king-safety and castling purposes.

Can a pinned bishop prevent castling?

Yes. If its diagonal attacks the king's starting, transit or destination square, castling on that side is illegal.

Can a pinned knight prevent castling?

Yes. A pinned knight's normal L-shaped attacks still count against the king's castling route.

Can a pinned pawn prevent castling?

Yes. A pinned pawn still attacks its forward diagonal squares when castling legality is checked.

Can a pinned rook or queen prevent castling?

Yes. Their attacked ranks and files count even when moving off a pin line would expose their own king.

Why do attacks from pinned pieces count?

Chess distinguishes attacked squares from legal moves. King movement and castling use the attacked-square test.

Lost rights and blocked paths

Can you castle after moving the king back?

No. Once the king has moved, castling rights are permanently lost even if it returns to its original square.

Can you castle after moving the rook back?

Not with that rook. Once the rook moves from its original square, the corresponding castling right is permanently lost.

Can you castle with a promoted rook?

No. Castling requires the original unmoved rook associated with that castling right.

Can you castle if a piece stands between king and rook?

No. Every square between the king and the chosen rook must be empty.

Can you castle after the rook was captured and replaced?

No. A replacement or promoted rook does not restore the lost castling right.

Can you castle if the king is not on its original square?

No. Standard castling requires the king on e1 for White or e8 for Black with the relevant right still available.

Can you castle twice in one game?

No. The first castle moves the king, permanently ending both castling rights for that side.

Can you castle on either side if neither rook moved?

Possibly, but the king must also be unmoved and the chosen route must be empty and safe.

Notation and practical checks

Does the rook have to be safe after castling?

No. Castling is legal even if the rook can be captured afterward, provided the king is safe and all formal conditions are met.

Can castling give check?

Yes. The rook's new square may open a rank or file attack that checks the enemy king.

Can castling give checkmate?

Yes. A legal castling move can deliver checkmate when the rook's repositioning creates an inescapable check.

How is castling written in notation?

Kingside castling is written O-O and queenside castling is written O-O-O, using capital letter O characters.

Why will an online board not let me castle?

The king may be in check, a route square may be attacked, the path may be blocked, or castling rights may already have been lost.

How can I check castling legality quickly?

Check rights and clearance first, then scan the king's start, transit and destination squares for every enemy attack.

Is queenside castling checked differently from kingside castling?

The rule is the same, but queenside has one extra clearance square. The b-file square must be empty although it need not be safe from attack.

What is the easiest way to remember the castling rule?

The king cannot start in, pass through or finish in check. The rook may start on, cross or finish on an attacked square.

Learn every foundational rule in a guided sequence.

Help Support Kingscrusher & Chessworld:
To ensure your purchase directly supports my work, please make sure to select the 🔘 'Buy this course' (individual purchase) radio button on the Udemy page. This also grants you lifetime access to the content!
🔥 Get Chess Course Discounts

🎯 Beginner Chess Guide
This page is part of the Beginner Chess Guide — A structured step-by-step learning path for new players covering chess rules, tactics, safe openings, and practical improvement.
☠ Chess Checkmate Patterns Guide
This page is part of the Chess Checkmate Patterns Guide — Stop missing mates and stop stalemating. Learn the core checkmate patterns, king-boxing techniques, and simple finishing methods that convert winning attacks into full points.
Also part of: Chess Endgame Guide
Continue your beginner chess journey in real gamesReading the guide is useful, but relaxed daily games help the ideas stick.

or create a ChessWorld username