🎓 A1Learner
🔍
0 of 52 lessons completed

Castling and Its Rules

Castling is a special king move. Castling moves the king two squares toward a rook and places the rook on the other side of the king.

Castling kingside

White king is on e1 and White rook is on h1. No piece stands between them, so White may castle kingside.

FEN: r3k2r/pppppppp/8/8/8/8/PPPPPPPP/R3K2R w KQkq - 0 1

a b c d e f g h
8 r . . . k . . r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R . . . K . . R 1
  a b c d e f g h

Castling queenside

White king is on e1 and White rook is on a1. No piece stands between them, so White may castle queenside.

FEN: r3k2r/pppppppp/8/8/8/8/PPPPPPPP/R3K2R w KQkq - 0 1

a b c d e f g h
8 r . . . k . . r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R . . . K . . R 1
  a b c d e f g h

Castling in a real game

White develops, then castles. Castling brings the king to safety and brings the rook toward the center.

FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h

Key points

  • Castling is the only move in which two pieces move at once.
  • Kingside castling moves the White king from e1 to g1 and the rook from h1 to f1.
  • Queenside castling moves the White king from e1 to c1 and the rook from a1 to d1.
  • Castling is allowed only if king and rook have not moved yet and no piece stands between them.
  • Castling is not allowed while the king is in check, or if the king would pass through check or land in check.

Try it Yourself

Edit the code, then press Run.

Running is simulated · Rust Playground

Exercise

White king is on e1 and rook is on h1 with nothing between them. Which move castles kingside?