A wooden chess king and rook standing side by side on the back row of a chess board, with pawns in front of them
After castling, the king and rook stand side by side.

Castling is a special move in chess that lets you move your king and one of your rooks in a single turn. The king moves two squares towards the rook, and the rook jumps over the king to land on the square right next to it. It is the only move in chess in which two pieces move at once, and it is the quickest way to tuck the king into a safe corner and bring a rook into the game. Each player can castle at most once a game, and only if the king and that rook have never moved, nothing stands between them, and the king is not in check and does not pass through or land on an attacked square.

This page explains how to castle on both sides of the board, every castling rule, the cases that confuse even strong players, and how to write castling down. The free castling trainer below has nine positions to test yourself. For the rest of the rules, see how to play chess.

Castling Trainer

Nine positions, each reached by real moves, so the castling rights are genuine. In three of them you have to castle: tap the king, then the square it moves to (tapping the rook works too). In the other six, decide whether castling is allowed. The last move played is highlighted.

Castling trainer
Nine positions, every one checked against the official rules. The last move is highlighted.

How to Castle in Chess

Castling diagram: White king on e1 with rooks on a1 and h1; after kingside castling the king is on g1 and the rook on f1; after queenside castling the king is on c1 and the rook on d1
White’s back rank before castling, after kingside castling and after queenside castling.

There are two ways to castle, one towards each rook:

  • Kingside castling (also called short castling): the king moves from e1 to g1 and the rook from h1 to f1. For Black, the king goes from e8 to g8 and the rook from h8 to f8.
  • Queenside castling (long castling): the king moves from e1 to c1 and the rook from a1 to d1. For Black, the king goes from e8 to c8 and the rook from a8 to d8.
KingRookMust be empty
White 0-0e1 → g1h1 → f1f1, g1
White 0-0-0e1 → c1a1 → d1b1, c1, d1
Black 0-0e8 → g8h8 → f8f8, g8
Black 0-0-0e8 → c8a8 → d8b8, c8, d8

In both cases the king always moves exactly two squares, and the rook always ends up on the square the king passed over. On the queenside the rook travels three squares and on the kingside two.

The Castling Rules

Under the FIDE Laws of Chess you can castle only when all of these are true:

  1. The king has never moved. If it has moved at any point in the game, even to come straight back, castling is gone for good, on both sides.
  2. The rook has never moved. A rook that has moved can never castle. The other rook may still castle if it has stayed at home.
  3. Every square between the king and the rook is empty. Your own pieces block castling just as much as your opponent’s do.
  4. The king is not in check. You cannot castle to get out of check.
  5. The king does not pass through an attacked square. The square it crosses, f1 or d1 for White, must not be attacked by an enemy piece.
  6. The king does not land on an attacked square. Like any other move, castling may not put your own king in check.

Rules 1 and 2 remove the right to castle permanently. Rules 3 to 6 only stop you castling for now: once the pieces are moved out of the way, or the attack or check is gone, you can castle on a later move.

When Can You Castle? The Tricky Cases

SituationCan you castle?Why
Your king is in checkNoCastling out of check is not allowed. Deal with the check first.
The king would cross an attacked squareNoThe king may not pass through check.
The king would land on an attacked squareNoNo move may leave your king in check.
Your rook is attackedYesOnly the king’s squares matter.
The rook passes over an attacked square (b1 or b8)YesThe king never touches b1, so it does not count.
You have been in check earlier in the gameYesAs long as the king did not move to escape it.
The king moved and came backNoMoving the king loses castling for the rest of the game.
One rook has movedOnly with the other rookThe right is lost only on the side of the rook that moved.
A pawn has just been promoted to a rookNoCastling is only with a rook on its original square.
You have already castledNoCastling moves the king, so you can only do it once.

These cases trip up even grandmasters. Viktor Korchnoi, in his 1974 Candidates final against Anatoly Karpov, asked the arbiter whether he could castle while his rook was under attack. The answer was yes, he castled, and Karpov resigned shortly afterwards. Top players have also castled illegally in serious games after forgetting that the king or rook had already moved and returned home, and the opponent did not always notice.

How to Castle Over the Board

Castling counts as a king move, so in a tournament game you must touch the king first. Under FIDE’s touch-move rules, if you touch your king and a rook you must castle on that side if it is legal. If you deliberately touch the rook first, you are not allowed to castle on that side on that move and must move the rook instead. Move the king two squares, then lift the rook over it, all with one hand. In friendly games these rules are rarely enforced, but it is a good habit.

How to Write Castling in Notation

Castling has its own symbols. 0-0 means kingside castling and 0-0-0 means queenside castling, in both algebraic and descriptive notation. Many books, apps and PGN files write the same moves with the letter O: O-O and O-O-O. The number of zeros matches the number of squares between the king and the rook: two on the kingside, three on the queenside.

Kingside or Queenside?

It is common for both players to castle kingside, less common for them to castle on opposite sides, and uncommon for both to castle queenside. Kingside castling needs only two pieces, the knight and the bishop, to leave the back rank, so it can be done in as few as four moves, and the king ends up close to the corner behind three pawns. Queenside castling takes longer, because the queen has to move as well, and it leaves the king one square further from the corner, so the a-pawn is often left unprotected. In return the rook lands straight on the d-file, ready to join the game.

The choice is a trade-off between king safety and rook activity. When the players castle on opposite sides, each is free to push the pawns in front of the enemy king without weakening their own, which usually leads to a sharp race of attacks.

Where Castling Comes From

Castling grew out of the medieval king’s leap, a two-square king move added to European chess in the 14th and 15th centuries. As the queen and bishop became long-range pieces, keeping the king safe mattered more, and various forms of castling appeared. The modern rule was settled in France in 1620 and in England in 1640, but local versions lasted much longer: in Italy, different castling rules were used until the late 19th century.

Castling still divides opinion. In 2021, former world champion Viswanathan Anand beat Vladimir Kramnik 2½–1½ in an exhibition match of chess without castling, a variant Kramnik had proposed. And in Chess960, where the pieces start in a shuffled order, the king can move anywhere from zero to six squares when it castles.

More Chess Rules

Castling is one of the three special moves in chess, with en passant and pawn promotion. To learn how every piece moves, see chess pieces names and moves, and for the complete rules, including check, checkmate and stalemate, plus a free game against the computer, see how to play chess. For other board games, try checkers.

Castling: frequently asked questions

What is castling in chess?

Castling is a special move in which the king moves two squares towards one of its rooks and that rook jumps over the king to the square next to it. It is the only move in chess in which two pieces move at once.

How do you castle in chess?

Move the king two squares towards the rook, then put the rook on the square the king passed over. Kingside, White’s king goes e1 to g1 and the rook h1 to f1; queenside, the king goes e1 to c1 and the rook a1 to d1.

When can you castle?

When the king and that rook have never moved, every square between them is empty, the king is not in check, and the king does not pass through or land on a square attacked by an enemy piece.

Can you castle out of check?

No. A king that is in check cannot castle. You have to get out of check another way first, and you can castle on a later move if the king has not moved.

Can you castle if your rook is attacked?

Yes. Only the king’s squares matter. The rook may be attacked, and on the queenside it may pass over an attacked square (b1 or b8), and castling is still legal.

Can you castle after moving your king?

No. Once the king has moved, castling is lost for the rest of the game on both sides, even if the king goes back to its starting square.

Can you castle after moving a rook?

Not with that rook. You can still castle with the other rook, as long as it and the king have never moved.

Can you castle twice?

No. Castling moves the king, so each player can castle at most once in a game.

How is castling written in chess notation?

Kingside castling is written 0-0 and queenside castling 0-0-0. Many books and apps use the letter O instead: O-O and O-O-O.

Should you touch the king or the rook first?

The king. Castling counts as a king move, so under FIDE rules you touch the king first. If you deliberately touch the rook first, you may not castle on that side on that move.

Fadi Hayek
Author & Casino Expert

After going through several successful experiences with several industry pioneers, Fadi Hayek has managed to excel in the world of content for online gaming by providing unique content for several projects that allowed him to obtain the necessary experience to launch his career. Last but not least, Fadi also holds several certificates, including but not limited to content marketing and iGaming.

Latest News

Artificial Intelligence in Gambling – How It Is Changing the Future of the Industry

As online casinos adopt machine learning models and artificial intelligence in gambling becomes the next disruption, you don’t want to be left behind. Read on to learn about the impact AI will have on the future of the gambling industry.

Arabian Football Betting Trends – Stay Current on Betting Preferences in the Middle East!

Keep abreast of the latest Arabian football betting trends with the Arabian sports betting insights below. This guide covers the most popular bet types with Arab bettors and the top bookmakers for Arabian and global football competitions.

Al-Nassr vs PSG | Cristiano Ronaldo vs Lionel Messi

The biggest event in world football is scheduled to take place later this month as Al Nassr vs PSG is on the cards.

Yggdrasil Collaborate with Reflex to Release Dublin Up DoubleMax

Yggdrasil and Reflex are set to launch Dublin Up DoubleMax, an Irish-style video, as one of their latest releases. The slot game is designed by incorporating Yggdrasil’s proprietary Game Engagement Mechanic (GEM) DoubleMax coupled with unique features like free spins bonus and fairy magic.