Chess Rules

    Castling

    The only move in chess that moves two pieces at once, and the four conditions it needs.

    Castling is the only move in chess that moves two pieces at once. The king moves two squares toward one of its rooks, and that rook jumps over the king to the square immediately on the other side. It is legal only if neither the king nor that rook has moved before, the squares between them are empty, and the king is not in check and does not pass through or land on a square attacked by an enemy piece.

    Before
    Position before castling, White king on e1 and rook on h1 with empty squares between. White: bishop on c4, pawn on e4, knight on f3, pawn on a2, pawn on b2, pawn on c2, pawn on d2, pawn on f2, pawn on g2, pawn on h2, rook on a1, knight on b1, bishop on c1, queen on d1, king on e1, rook on h1. Black: rook on a8, bishop on c8, queen on d8, king on e8, knight on g8, rook on h8, pawn on a7, pawn on b7, pawn on c7, pawn on d7, pawn on f7, pawn on g7, pawn on h7, knight on c6, bishop on c5, pawn on e5.
    White is ready to castle kingside. The king is on e1, the rook on h1, and the f1 and g1 squares between them are empty.
    After
    Position after White castles kingside, king on g1 and rook on f1. White: bishop on c4, pawn on e4, knight on f3, pawn on a2, pawn on b2, pawn on c2, pawn on d2, pawn on f2, pawn on g2, pawn on h2, rook on a1, knight on b1, bishop on c1, queen on d1, rook on f1, king on g1. Black: rook on a8, bishop on c8, queen on d8, king on e8, knight on g8, rook on h8, pawn on a7, pawn on b7, pawn on c7, pawn on d7, pawn on f7, pawn on g7, pawn on h7, knight on c6, bishop on c5, pawn on e5.
    After O-O. The king has moved from e1 to g1 and the rook from h1 to f1, jumping over the king in the same move.

    The four conditions for castling

    Castling is legal only when all four hold. The first two are about history, the last two about the current position.

    • Your king has never moved, at any earlier point in the game.
    • The rook you are castling with has never moved. Moving one rook does not affect your right to castle with the other.
    • Every square between the king and that rook is empty.
    • Your king is not currently in check, does not pass through a square attacked by an enemy piece, and does not land on one.

    Kingside and queenside castling

    Kingside castling, written O-O and also called short castling, moves the king from e1 to g1 and the rook from h1 to f1. For Black the same move runs e8 to g8 and h8 to f8.

    Queenside castling, written O-O-O and also called long castling, moves the king from e1 to c1 and the rook from a1 to d1. For Black that is e8 to c8 and a8 to d8. It requires one more empty square than kingside, because the b1 square must also be clear.

    The rules people get wrong

    A king that has moved and returned to e1 has still moved, and can never castle again. The right is lost permanently, not just for that turn.

    You may castle while the rook is attacked, and when castling queenside the rook may legally pass through an attacked square. The restriction on passing through attacked squares applies only to the king.

    Being in check does not cost you the right to castle later. It only prevents castling while the check stands. Block or capture the checking piece without moving the king, and you may still castle afterwards.

    Frequently asked questions

    What is castling in chess?
    Castling is a special move where the king moves two squares toward a rook and that rook jumps to the square on the far side of the king. It is the only move in chess that moves two of your own pieces in a single turn, and it is normally used to move the king to safety while developing a rook.
    Can you castle out of check?
    No. If your king is in check you must deal with the check first. You may castle on a later move once the check has been answered, provided the king itself did not move to escape it.
    Can you castle through check?
    No. The king may not pass through a square that an enemy piece attacks, and may not land on one. The rook, however, may pass through an attacked square, which matters when castling queenside.
    Can you castle if the rook has moved?
    Not with that rook. If your h-rook has moved you can no longer castle kingside, but you may still castle queenside with the a-rook if it has not moved and the other conditions hold.
    Can you castle if your king has moved and moved back?
    No. Once the king has moved at all, the right to castle is gone for the rest of the game, even if the king returns to its original square.