Castling is the one move in chess where you move two pieces in a single turn. In one go, your king tucks itself into a corner behind a wall of pawns and your rook jumps toward the center, ready to join the game. That's why castling appears in almost every serious game — and why it's worth knowing the rules exactly, because it's also the rule people argue about most at casual tables.
How to castle
Move the king two squares toward one of the rooks, then place that rook on the square the king just crossed.
- Kingside castling (O-O): White's king goes e1 → g1 and the rook h1 → f1. For Black, e8 → g8 and h8 → f8.
- Queenside castling (O-O-O): White's king goes e1 → c1 and the rook a1 → d1. For Black, e8 → c8 and a8 → d8.
In both cases the king moves exactly two squares. Only the rook's distance differs — two squares kingside, three squares queenside.
The five conditions
All five must be true at the same time:
- The king has never moved during the game. Moving it and returning to e1 still counts as having moved; castling rights on both sides are gone.
- The rook you castle with has never moved. If the h1 rook moved, you lose kingside castling but can still castle queenside with the a1 rook, if it hasn't moved.
- No pieces between the king and that rook — yours or the opponent's.
- The king is not in check. You cannot castle to escape a check.
- The king does not pass through or land on an attacked square.
Condition 5 is the one that trips people up. It is about the king's path only.
Myths that cause arguments
"You can't castle if you've ever been in check." False. If you were checked earlier and got out of it without moving the king (by blocking or capturing), you can still castle later.
"You can't castle if the rook is attacked." False. The rook can be under attack, and it can pass through an attacked square (b1 in queenside castling). Only the king's squares matter.
"On the queenside, the king moves three squares." False. The king always moves two. The rook moves three.
"You have to say 'castle' or ask permission." False. It's a normal move, played like any other.
How to castle correctly in a tournament
Over-the-board rules (touch-move) make the order of your hand movements matter:
- Touch the king first and move it two squares.
- Then move the rook next to it, using one hand.
If you touch the rook first, an arbiter can rule that you touched the rook and must move it — as a rook move, not castling. At home nobody cares, but if you plan to play in tournaments, build the habit early.
Which side should you castle?
Kingside: the default
Kingside castling is faster (only two pieces to clear) and safer: the king on g1 sits behind three pawns on f2, g2 and h2, with the a-pawn not an issue. In most openings, it's the natural choice.
Queenside: faster rook, weaker shelter
Queenside castling puts the rook straight onto the d-file, often immediately useful in the center. The costs:
- one extra piece to clear, so one move slower;
- the king on c1 is slightly more exposed — the a2 pawn is not covered, so players often follow up with Kb1.
Opposite-side castling
When one player castles kingside and the other queenside, both sides can throw their pawns at the enemy king without weakening their own. These games become races: whoever opens lines against the other king first usually wins. If you enjoy sharp positions, opposite-side castling is where the fireworks are.
Castling and your pawn shield
Castling is only as safe as the pawns in front of the king. After kingside castling, the ideal shield is pawns on f2, g2 and h2 (f7, g7, h7 for Black). Two common adjustments:
- h3 (or ...h6): creates an escape square — "luft" — so the king can't be mated on the back rank. Best played at a calm moment in the middlegame.
- g3 with a bishop on g2 (fianchetto): a solid alternative shield, where the bishop covers the light squares around the king. Trading that bishop away weakens the king noticeably.
What you usually shouldn't do is push the shield pawns forward without a reason. Moves like g4 or h4 in front of your own castled king open lines for the opponent's pieces — they belong to specific attacking plans, not to general play.
When to castle
The practical guideline: castle within roughly the first ten moves, and before the center opens. Once central pawns are exchanged and the e-file is open, a king still on e1 or e8 becomes a target for rooks and the queen.
Strong players sometimes delay castling on purpose — to keep options open or when the center is locked and the king is safe for now. That's a judgment call that comes with experience. For most players, early castling is almost always right.
Try it
Open the third diagram with Play this position against the computer and try both castles. The board only accepts legal moves, so you'll see immediately that kingside castling is refused. Then start a game on ChessDigi and set yourself a small goal: castle before move ten. For the reasoning behind early castling, read opening principles.
Frequently asked questions
Can you castle out of check?
No. Castling is illegal while your king is in check. Deal with the check first — if you can do so without moving the king, you keep the right to castle later.
Can you castle if the rook is under attack?
Yes. The rules only restrict the king: it can't be in check, pass through an attacked square, or land on one. The rook may be attacked or pass through an attacked square.
Can you castle after moving the king back to its original square?
No. Once the king has moved, castling rights on both sides are lost for the rest of the game.
How do you castle on a chess website?
Drag the king two squares toward the rook, or tap the king and then the destination square. The site moves the rook for you.
What happens if my opponent castles illegally?
In a casual game, point it out and take the move back. In a tournament, stop the clocks and call the arbiter; an illegal move is corrected and usually carries a time penalty for the player who made it.
Is castling mandatory?
No. It's a right, not an obligation. But in most games, castling early is the easiest way to keep your king safe and activate a rook.