Castling Rules in Chess
How to castle kingside (O-O) and queenside (O-O-O), the four conditions, every scenario where castling is illegal, and when to castle in your games. No signup. No paywall.
TL;DR — Castling in 5 Bullets
- The king moves 2 squares toward a rook; the rook jumps to the square the king crossed.
- Kingside is O-O (short); queenside is O-O-O (long).
- Four conditions: neither piece has moved, path empty, king not in check, king doesn't cross attacked squares.
- You can castle when the rook is attacked. You cannot castle out of, through, or into check.
- Castle by move 10 in most games. Kingside is safer; queenside is for pawn-storm attacks on the kingside.
What Is Castling?
Castling is the only move in chess where two pieces move at once: the king and one rook. The king travels 2 squares toward the chosen rook, and the rook hops to the square the king crossed over. It happens at most once per side per game and exists for one reason — to get the king out of the centre and behind a wall of pawns before the middlegame starts.
Castling was added to European chess in the 1500s and standardised into its modern form by the early 1800s. Before castling, the king had to walk to safety one square at a time — far too slow against fast-developing piece play. The modern castling rule is the single biggest reason chess games today are decided by middlegame attacks rather than slow king walks. If you're still learning how every piece moves, read how chess pieces move first — castling is the special move that ties king and rook movement together.
Kingside Castling (O-O)
Kingside castling, also called “short castling”, is the more common version. The king moves toward the h-rook — that's the rook on h1 for White or h8 for Black.
White kingside
King: e1 → g1. Rook: h1 → f1. Squares that must be empty: f1, g1. Squares that must be safe from attack: f1, g1 (the king's travel path).
Black kingside
King: e8 → g8. Rook: h8 → f8. Squares that must be empty: f8, g8. Squares that must be safe from attack: f8, g8.
Kingside castling is the textbook default because it's compact (only 2 empty-square requirements), fast (the king reaches safety in one move), and the resulting pawn shelter (f-, g-, h-pawns on their starting squares) is a battle-tested fortress against most middlegame attacks.
Queenside Castling (O-O-O)
Queenside castling, also called “long castling”, moves the king toward the a-rook — a1 for White, a8 for Black. It takes more preparation because more squares between king and rook need to be empty.
White queenside
King: e1 → c1. Rook: a1 → d1. Squares that must be empty: b1, c1, d1. Squares that must be safe from attack: d1, c1 (the king's travel path). b1 only has to be empty, not safe.
Black queenside
King: e8 → c8. Rook: a8 → d8. Squares that must be empty: b8, c8, d8. Squares that must be safe from attack: d8, c8.
Queenside castling lands the king one square further from the corner than kingside, which means the a-pawn is exposed and the king may need to tuck to b1/b8 for extra safety. The tradeoff: queenside castling commits your king to the OPPOSITE wing from a kingside pawn storm — exactly what you want in opposite-side castling attacks like the Yugoslav Attack against the Sicilian Dragon or the English Attack against the Najdorf.
The Four Conditions for Legal Castling
Every legal castling move satisfies all four conditions simultaneously. Miss one and castling on that side is illegal — though the other side may still be available.
1. Neither the king nor the rook involved has moved yet
Castling is a once-per-game right. The moment your king moves — even one square sideways and back — you lose the right to castle on BOTH sides for the rest of the game. The moment a rook moves, you lose the right to castle on that side. The other rook is still available, so a king-rook nudge only kills castling on that wing.
2. All squares between the king and the rook are empty
For kingside castling that means f1 and g1 must be empty for White (f8 and g8 for Black). For queenside castling that means b1, c1, and d1 must be empty for White (b8, c8, d8 for Black). The b-square / b-file matters for queenside but doesn't have to be safe from attack — only that nothing is sitting there.
3. The king is not currently in check
You cannot castle out of check. This is the rule most beginners forget — if your king is being attacked right now, you have to deal with the check first by moving the king, blocking, or capturing the checker. Once the check is dealt with, you can castle next move if every other condition still holds.
4. The king does not pass through or land on an attacked square
The two squares the king travels across must both be safe from enemy attack. For kingside that means f1 and g1 for White (f8 and g8 for Black). For queenside that means d1 and c1 for White (d8 and c8 for Black). If ANY enemy piece controls EITHER square, castling on that side is illegal until the threat is removed.
When Castling Is Illegal
Six scenarios where you can't castle, ranked by how often beginners get them wrong:
Castling out of check
Your king is currently in check from an enemy piece. Even if every other condition is met, you must resolve the check first by moving the king, blocking the attack, or capturing the checking piece.
Castling through check
An enemy piece attacks one of the squares the king travels across (f1/f8 for kingside, d1/d8 for queenside). The king cannot pass through any attacked square — the rook is allowed to pass through an attacked square, but the king is not.
Castling into check
The square the king would land on (g1/g8 kingside, c1/c8 queenside) is attacked by an enemy piece. Same reason as a regular illegal king move: the king can never voluntarily step onto an attacked square.
The king has already moved
Even if you moved the king and then moved it back to e1/e8, the right to castle is permanently gone — on both sides. This includes "I just nudged the king one square to dodge a check and went straight back" — castling rights are lost the instant the king leaves its starting square.
The rook on that side has already moved
If the h-rook has moved (even just one square along the back rank and back) you can no longer castle kingside. Same for the a-rook and queenside. The OTHER side is still available — moving one rook only kills castling on that side.
A piece sits between the king and the rook
All squares between them must be empty. A friendly knight on g1, a bishop on f1 (kingside), or any piece on b1, c1, or d1 (queenside) blocks castling on that wing until the piece is moved.
Surprising: When Castling IS Legal
Four scenarios where most beginners mistakenly think they can't castle — but they actually can:
The rook is under attack
Surprising but true: it is perfectly legal to castle when the rook involved is being attacked, as long as the king itself is not in check. The rule about attacked squares applies only to the squares the KING travels across — not the squares the rook travels across or the rook's starting square.
The b1/b8 square is attacked (queenside)
For queenside castling, the king moves from e1 to c1 — it never visits the b1 square. So even if a bishop on h7 controls b1, queenside castling is still legal. The king's path is e1 → d1 → c1, and only those two travel-squares (d1 and c1) need to be safe.
You castled out of an earlier check (already resolved)
If you were in check earlier in the game and dealt with it by blocking or capturing (without moving the king or rook), your castling rights are intact. The rule is only about the king being in check at the moment of castling, not at any point in the game's past.
The opponent's king is in check
Castling is a king move and counts as your turn. There's no rule saying you can't make a move that simultaneously checks the opponent — in fact, castling with check from the rook landing on the d-file or f-file is a common middlegame attacking idea.
When Should You Castle?
Knowing the rules is step one. Knowing WHEN and which side to castle is step two — and it's where most rating points are won and lost in the opening.
Castle in the first 10 moves
Almost every grandmaster game in the database features castling between moves 6 and 12. By move 10 your minor pieces should be developed, the centre should be contested, and your king belongs in a safer corner — usually kingside.
Castle kingside by default
Kingside castling is faster (only 2 squares of king travel, only 2 empty-square requirements), more compact, and easier to defend. The standard king-shelter h7-g6-f7 (or h2-g3-f2 for White) holds up against most middlegame attacks.
Castle queenside when you plan a kingside pawn storm
Queenside castling commits your king to the opposite wing from where you're going to push pawns — that's exactly what you want in opposite-side castling attacks. The Yugoslav Attack in the Sicilian Dragon, the English Attack in the Najdorf, and the Sämisch King's Indian all hinge on White castling queenside and storming the kingside.
DON'T castle into the opponent's attack
If your opponent has open files, open diagonals, or a half-open file pointing at your kingside, think twice before castling kingside — you may be walking into a prepared attack. The same goes for queenside if your opponent has a half-open a-file or c-file.
DON'T castle just because you can
Sometimes leaving the king in the centre for one more move is correct — if all the pawn structure favours a closed centre, or if you can win material with a tactic that requires the rook to stay on h1/a1 a little longer. Castling is a tool, not a reflex.
For a deeper opening-by-opening picture of when castling is part of the plan, see chess openings for beginners and how to improve at chess fast.
Common Beginner Mistakes
The same handful of castling errors come up in beginner games every week. Here are the fixes:
Trying to castle out of check
If your king is in check right now, you must address the check first — move the king, block, or capture. You can never castle while in check.
Trying to castle through a check
Look at every square the king will travel ACROSS — for kingside that's f1/f8, for queenside that's d1/d8. If an enemy piece attacks either travel square, castling on that side is illegal until the threat is removed.
Thinking the rook must be safe
The rook can be attacked when you castle. The rules only restrict attacks on the king's path — not the rook's. A common confusion in beginner games.
Thinking "the king moves first" matters
Castling is officially one move where both pieces move simultaneously. In tournament play you should touch the KING first to avoid the touch-move rule classifying it as a rook move — but the rules don't care about the order, only the legality of the final position.
Castling early when the centre is open
If the centre files are open and the opponent has rooks aimed at the centre, your castled king can suddenly be in the line of fire after one ...exd or ...dxe trade. Sometimes keeping the king on e1/e8 for one more move is wiser.
Quick Reference Table
All four endpoints in one table — print this or screenshot it and you have a one-screen castling cheat sheet:
| Move | King | Rook | Empty |
|---|---|---|---|
| White O-O | e1 → g1 | h1 → f1 | f1, g1 |
| White O-O-O | e1 → c1 | a1 → d1 | b1, c1, d1 |
| Black O-O | e8 → g8 | h8 → f8 | f8, g8 |
| Black O-O-O | e8 → c8 | a8 → d8 | b8, c8, d8 |
Practise Castling for Free
The fastest way to lock in castling rules is to actually try them in real positions. Three free, no-signup options:
- Free Board Editor — set up any position and test whether castling is legal. Useful for the “wait, can I castle through this attack?” questions.
- Free Opening Explorer — step through real master games and watch exactly which move number top players choose to castle on, and which side.
- chess.rodeo — no account, no paywall — play live games and let Stockfish tell you whether castling kingside, queenside, or delaying was the best choice in your position.
Frequently asked questions
Everything beginners ask about castling — kingside vs queenside, when it's legal, when it's smart, and how to practise it for free.
What is castling in chess?
Castling is the only chess move where two pieces — the king and one rook — move at the same time. The king travels 2 squares toward the rook, and the rook jumps to the square the king crossed. It happens at most once per side per game and is the standard way to bring the king to safety in the opening. Kingside castling is written O-O (short castle); queenside is written O-O-O (long castle).
How do you castle in chess?
Move your king 2 squares toward the rook you want to castle with. For White kingside that means moving the king from e1 to g1; the rook on h1 jumps to f1. For White queenside the king goes from e1 to c1; the rook on a1 jumps to d1. For Black it's a mirror: kingside is e8 → g8 with the rook going h8 → f8, queenside is e8 → c8 with the rook going a8 → d8. In tournament play, ALWAYS touch the king first to avoid being forced to play a rook move under touch-move rules.
What are the rules for castling in chess?
There are four conditions, ALL of which must be true: (1) neither your king nor the rook involved has moved earlier in the game, (2) every square between the king and the rook is empty, (3) your king is not currently in check, (4) your king does not pass through or land on a square attacked by an enemy piece. If any one of these fails, castling on that side is illegal — though the OTHER side may still be available if its rook hasn't moved.
Can you castle when your king is in check?
No. You cannot castle out of check. The third castling condition requires the king to NOT be in check at the moment of castling. You must first deal with the check by moving the king, blocking the attacking line, or capturing the checking piece — then if all other conditions still hold (the king hasn't moved, the rook hasn't moved), you can castle on a later move.
Can you castle through check?
No. The king cannot pass through any square attacked by an enemy piece. For kingside castling, both f1 and g1 (or f8 and g8 for Black) must be safe. For queenside castling, both d1 and c1 (or d8 and c8 for Black) must be safe. The rook is allowed to pass through an attacked square — only the king is restricted.
Can you castle if the rook is attacked?
Yes. There's no rule against castling when the rook involved is attacked. The 'no attacked squares' rule applies only to the squares the king crosses — not to the rook's starting square or the squares the rook passes over. This is one of the most surprising castling facts for beginners. Even if a queen, bishop, or rook is attacking your h1 rook, you can still castle kingside as long as the king itself is safe.
What is the difference between kingside and queenside castling?
Kingside castling (O-O, "short castle") happens on the king's wing — the king moves to g1/g8, the rook from h1/h8 jumps to f1/f8. It involves only 2 empty squares and is faster, safer, and more common. Queenside castling (O-O-O, "long castle") happens on the queen's wing — the king moves to c1/c8, the rook from a1/a8 jumps to d1/d8. It involves 3 empty squares, takes more setup, and puts the king closer to the edge of the board — but it's the right choice when you plan to attack on the kingside with a pawn storm.
Why is the b-square not part of the castling rules for queenside?
For queenside castling the b-file (b1/b8) only has to be empty — it does NOT have to be safe from attack. The king travels from e1 to c1, never crossing b1, so even if an enemy bishop on h7 controls b1, queenside castling is still legal. The same is true for the rook: the rook travels from a1 through b1 and c1 to land on d1, but only the king's path matters for the attack rule.
When should you castle in chess?
In most games you should castle by move 10. After developing your knights and bishops and contesting the centre, your king belongs in a corner where it has pawn cover. Castle kingside by default — it's the safer, faster, more compact option. Castle queenside when you plan an opposite-side pawn storm (typical in the Yugoslav Attack, English Attack, and Sämisch King's Indian setups). Don't castle just because you can — if the opponent has open lines pointing at the wing you'd castle into, leaving the king in the centre for one more move can be safer.
Can you castle out of check by blocking with the rook?
No. Castling is treated as a king move — the third condition (king not in check) blocks it directly. You can't use castling as a way to block a check, even if the rook would land on the right square to interpose. Block the check with a different piece, or move the king, then castle later.
What is the notation for castling?
Kingside castling is written O-O (two letter Os separated by a hyphen, sometimes written 0-0). Queenside castling is written O-O-O (three Os). Both notations are universal across English-language chess literature, FIDE rules, online platforms, and PGN files. If you write Kxg1 or Kg1 for castling in a game record, your opponent will know what you mean but the move record will be incorrect.
Can a pawn block castling?
Yes. If any piece — pawn, knight, bishop, queen, or rook — sits on any square between your king and the rook, castling is blocked on that side until the square is cleared. For kingside that means f1/g1 must be empty (f8/g8 for Black). For queenside that means b1/c1/d1 must be empty (b8/c8/d8 for Black). Even a friendly piece counts as a blocker.
Can both players castle in the same game?
Yes. Both sides retain independent castling rights and most master games feature both kings castling — usually both kingside, which is the textbook 'normal' middlegame structure. Opposite-side castling (one side kingside, the other queenside) is rarer but creates the most aggressive middlegame patterns: both sides race pawn storms toward the enemy king.
Where can I practise castling for free?
Set up any position and try castling in our free Board Editor on chess.lc — you can check the four conditions by trial and error with no clock pressure. Then play live games at chess.rodeo with full Stockfish analysis afterwards to see whether your castling choice (early/late, kingside/queenside) was best. No account, no signup, no paywall on either tool.
Stop guessing — see whether castling was the best move
Open any game in chess.rodeo, hit Analyze, and Stockfish tells you whether O-O, O-O-O, or delaying castling was correct on every move. Free, no account, no paywall.