Castling is the only move in chess where two pieces move at once, and it is the single most useful move a beginner can learn to make early. It tucks the king behind a wall of pawns and brings a rook towards the centre in one turn — safety and development in the same move.
This guide answers the exact question you searched: how to castle in chess, when castling is legal, the difference between kingside and queenside castling, and — just as important — the positions where castling is the wrong decision.
1. How to castle, step by step
Move your king two squares towards the rook, then jump that rook over the king and place it on the square the king crossed. On a physical board, always touch the king first: touching the rook first can be ruled as a rook move.
Kingside castling (written 0-0) sends the white king from e1 to g1 with the rook going h1 to f1. Queenside castling (written 0-0-0) sends the king from e1 to c1 with the rook going a1 to d1. For Black, the same thing happens on rank 8: e8-g8 or e8-c8.
♜
♞
♝
♛
♚
♜
♟
♟
♟
♟
♟
♟
♟
♞
♝
♟
♗
♙
♘
♙
♙
♙
♙
♙
♙
♙
♖
♘
♗
♕
♔
♖
4.0-0Both sides are ready to castle kingside: the f1/f8 and g1/g8 squares are empty and the king and rook have not moved.White to move
♜
♞
♝
♛
♚
♜
♟
♟
♟
♟
♟
♟
♟
♞
♝
♟
♗
♙
♘
♙
♙
♙
♙
♙
♙
♙
♖
♘
♗
♕
♖
♔
after 4.0-0The king sits safely on g1 behind three untouched pawns and the rook has arrived on f1, already pointing down the half-open f-file.Black to move
Kingside: 0-0, king e1→g1 (e8→g8), rook h1→f1 (h8→f8).
Queenside: 0-0-0, king e1→c1 (e8→c8), rook a1→d1 (a8→d8).
Touch the king first — it is the king's move, not the rook's.
2. The five rules that make castling legal
Castling is legal only when all five conditions hold at once. Learn them as a checklist and you will never lose a game to an illegal-move claim or a missed opportunity.
First: the king has never moved. Second: that particular rook has never moved — moving the h-rook forfeits kingside castling forever, even if you move it back. Third: every square between the king and the rook is empty. Fourth: the king is not currently in check. Fifth: the king does not pass through or land on a square attacked by an enemy piece.
Two common misunderstandings: the rook may pass through an attacked square (that is legal, and it is what makes queenside castling possible when b1 is covered), and being in check only blocks castling while the check lasts — you can castle later once the check is resolved without moving the king.
King and that rook must both be untouched all game.
The squares between them must be empty.
You cannot castle out of, through, or into check.
The rook may be attacked or cross an attacked square — that is legal.
3. Kingside or queenside — how to choose
Kingside castling is faster (two pieces to clear instead of three) and the resulting king position is tidier: the king reaches g1 with pawns on f2, g2 and h2 intact and the rook already on a useful central file. For roughly nine out of ten beginner games, this is the correct choice.
Queenside castling puts the king on c1, slightly more exposed on the half-open c-file, and usually needs one extra move (Kb1) to tuck it away. Its reward is speed of attack: the rook lands on d1 hitting the centre immediately, and it is the standard choice when you plan to storm the enemy king with pawns on the opposite wing — the classic opposite-side castling race.
The practical rule: castle on the side where your king will be safest, and attack on the side where you have more pawns and pieces. If both kings castle to the same side, pawn storms are usually suicide because you open your own king too.
Kingside is faster and safer — the default for beginners.
Queenside activates the rook instantly but often needs Kb1 to be safe.
Opposite-side castling means a pawn-storm race; same side means play in the centre.
4. When castling is a mistake
Castling into an attack is a real way to lose. If your opponent already has a pawn on h5, an open g-file and a bishop aimed at h7, castling kingside walks your king into the fire. In those positions, either castle queenside or leave the king in the centre behind a locked pawn structure until you have neutralised the attack.
The other case is the endgame. Once the queens and most pieces are traded, the king is a fighting piece and belongs in the centre. Castling in a queenless position often wastes the tempo you needed to march the king towards the passed pawns.
Do not castle into an existing pawn storm or open file.
In closed centres, delaying castling is often safe and flexible.
In endgames the king wants the centre — castling can be a lost tempo.
5. Turning the rule into a habit
Knowing how to castle is a five-minute lesson. Castling at the right moment is a skill you build by playing through annotated games and seeing when strong players delay it, rush it, or deliberately give it up. In The Master Study Library you see it in context: each annotated master game marks the moment the king reaches safety and explains what changed on the board because of it.
A simple discipline for your next twenty games: count your developed pieces before every attacking move. If the king is still on e1 or e8 and more than one piece is undeveloped, castle instead.
Aim to castle within the first ten moves in open positions.
Before any attack, check the king is off the central file.
Study annotated games to see when strong players break the rule.
Chess terms used in this guide
Castling rights
The permission to castle, held separately for each side of the board and lost forever when the king or that rook moves.
Pawn shield
The two or three pawns in front of a castled king. Pushing them without a reason is the most common way beginners weaken their own king.
Opposite-side castling
Kings castled on different wings, which usually leads to a race of pawn storms because neither attacker exposes their own king.
Half-open file
A file with pawns of only one colour. Castled rooks want these files; they are the main route into the enemy position.
Frequently asked questions
How do you castle in chess?
Move the king two squares towards the rook, then place that rook on the square the king crossed. Kingside: king e1→g1, rook h1→f1. Queenside: king e1→c1, rook a1→d1.
Can you castle out of check?
No. Castling is illegal while your king is in check, and also illegal if the king would pass through or land on an attacked square. Once the check is resolved without moving the king, you may castle later.
Can you castle if the rook is under attack?
Yes. The restriction applies only to the king's squares. The rook may be attacked and may cross an attacked square — this is what makes queenside castling legal when b1 or b8 is covered.
Can you castle after moving your king back to its starting square?
No. Once the king has moved even once, castling rights are lost permanently for the rest of the game. The same is true for each rook individually.
Is castling kingside or queenside better?
Kingside is faster and generally safer, so it is the default. Queenside develops the rook to the centre more quickly and suits opposite-side attacking plans, but often needs Kb1 to secure the king.
Volume 1 · Openings
Understanding the First Twelve Moves
Development, control of the centre, tempo and king safety — and the real cost of grabbing material too early. You see how a small opening advantage turns into a winning middlegame.