When can you castle in chess?

Castling is the only move in chess where two pieces move at once. The king steps two squares toward a rook, and that rook jumps over to the square the king crossed. You can castle once per game, provided neither the king nor that rook has moved, the squares between them are empty, and the king isn't in check and doesn't cross or land on an attacked square.

VueChess team · updated December 2, 2026

How to castle kingside and queenside

Kingside castling, also called short castling: the white king goes from e1 to g1 and the h1 rook goes to f1. For Black, the king goes from e8 to g8 and the rook from h8 to f8.

Queenside castling, or long castling: the king goes from e1 to c1 and the a1 rook goes to d1. Black plays e8 to c8 and a8 to d8. On either side the king moves exactly two squares. The rook travels two squares when castling short and three when castling long.

White can castle either way: the king goes to g1 for short castling or to c1 for long castling.

Castling rules: when you can castle

The king hasn't moved yet in this game. If it has moved, even once and back to e1, castling is gone on both sides for good.

The rook you castle with hasn't moved. If the h1 rook has moved, you can still castle queenside with the a1 rook, and the other way round.

All the squares between the king and the rook are empty. On the queenside that includes b1 (b8 for Black).

The king is not in check right now. The square it crosses (f1 or d1) and the square it lands on (g1 or c1) are not attacked by any enemy piece.

After castling. White castled short (king g1, rook f1), Black castled long (king c8, rook d8).

Can you castle through check?

No. The king can't pass over a square the opponent attacks, and it can't land on one. This is the condition beginners forget most often.

If an enemy bishop covers f1, short castling is off until the bishop leaves that diagonal or you block it. Long castling may still be possible, since it has its own squares to check. Online you don't have to work this out yourself: the board won't let you castle illegally.

The bishop on c4 covers f1, so White can't castle kingside right now.

What doesn't stop you castling

The rook may be under attack. On the queenside it may also pass over an attacked square: b1 only has to be empty, because the king never touches it.

A check earlier in the game doesn't matter either. If your king was checked, you blocked or captured, and the king never moved, the right to castle stays with you.

The rook on b8 covers b1 and the bishop attacks a1, but long castling is legal: the king crosses only d1 and lands on c1.

Why castle: king safety and the rooks

In the centre the king is exposed. Once a couple of pawns are traded, the d- and e-files open, and the king becomes a target for the enemy rooks and queen. After short castling it sits behind the f-, g- and h-pawns, and the rook leaves the corner for f1, closer to the centre.

That's why opening advice says to castle early, usually within the first ten moves. Bring out the knight and bishop on the kingside and the path is clear. See opening principles.

Both sides have developed their kingside pieces. White has castled, and Black can castle short too.

Short or long castling?

Short castling is the more common choice. Only two pieces have to get out of the way, and the king ends up on g1, near the corner.

Long castling needs the queen, the bishop and the knight to leave the back rank first. The king on c1 is a step further from the corner, and players often spend another move on Kb1 to tuck it away. In return the rook arrives on d1, a central file, straight away.

When the kings castle on opposite sides, the game usually gets sharp. Each side throws its pawns forward at the other's king, and whoever gets there first tends to win.

How to castle on VueChess and over the board

On VueChess, move the king two squares toward the rook and the rook follows by itself. If you enter moves from the keyboard, type O-O for short castling and O-O-O for long. Castling is written the same way in game records, as explained in chess notation. To try both kinds of castling in a real game, play the computer on level 1.

Over the board, touch the king first and move it before the rook. Under FIDE rules castling counts as a king move, and if you touch the rook first you may lose the right to castle with it on that move.

Questions

Can you castle out of check?

No. If your king is in check, deal with the check first. You can castle on a later move as long as the king hasn't moved.

Can you castle if the rook is attacked?

Yes. Only the king's squares matter: the one it stands on, the one it crosses and the one it lands on must not be attacked.

Can you castle after moving the king back?

No. Once the king has moved, even if it returns to its starting square, castling is gone for the rest of the game.

Can you castle queenside if b1 is attacked?

Yes. The king doesn't cross b1, so that square only has to be empty. The same goes for b8 when Black castles long.

Can you castle twice in one game?

No. Each player can castle at most once per game.