How Does Castling Work in Chess?

Castling moves the king two squares toward a rook, and that rook then jumps to the square right beside the king on its other side — both in a single move. It's the only move in chess where two pieces move at once, and it's the fastest way to tuck your king to safety while activating a rook.

r . . . k . . r
p p p q . p p p
. . n p . n . .
. . b . p . . .
. . B . P . . .
. . N P . N . .
P P P Q . P P P
R . . . K . . R
Both sides still have their king and both rooks untouched, with the squares between them clear — a position where either side could castle on either wing.

Practice recognizing when castling is legal by playing through openings on Chessy — you'll build the habit of castling early and safely.

Play free against the Chessy engine →

The two kinds of castling

Kingside castling (written O-O) moves the king two squares toward the rook on the h-file (short side), and that rook lands next to the king. Queenside castling (O-O-O) moves the king two squares toward the a-file rook (long side); the rook lands on the other side of the king. Queenside castling requires one extra empty square, since the rook has farther to travel, but the king itself always moves exactly two squares.

The requirements

Castling is only legal when all of these are true:
- Neither the king nor that specific rook has moved yet in the game
- All squares between the king and rook are empty
- The king is not currently in check
- The king does not pass through or land on a square attacked by an enemy piece

Note that the rook itself can be under attack, or can pass through an attacked square — only the king's path and destination matter.

Why castling matters

Castling accomplishes two things in one move: it gets the king away from the center, where it's exposed to open files and diagonals, and it brings a rook toward the center where it's far more active. Most well-played games see both sides castle within the first ten moves, usually kingside since it needs fewer empty squares and doesn't leave the king as exposed to a rook-file attack.

Frequently asked questions

Can you castle if your rook has moved but come back to its original square?

No. Once a rook (or the king) has moved at any point in the game, castling with it is permanently illegal, even if it returns to its starting square.

Can you castle out of check?

No. You cannot castle if your king is currently in check, even if the resulting square would be safe.

Can you castle through check?

No. The king cannot pass through any square that is attacked by an enemy piece, even though it's only 'passing through' rather than landing there.

Which is faster, kingside or queenside castling?

Kingside, since it only requires two empty squares between king and rook (versus three for queenside), so it's usually available a move or two sooner.