Special Moves in Chess: Castling, En Passant, Promotion
Chess has three special moves: castling, en passant (pawn capture), and promotion — three exceptions to the regular piece movement rules, each with their own conditions. All three work according to the official FIDE rules in our engine; below you'll see exactly which piece, when, and under what conditions you can play each one.
Chess's three special moves
Castling is a defensive move, en passant is an exception to pawns' two-square advance, and promotion is when a pawn strengthens upon reaching the back of the board. All three differ in which piece they involve, when they occur, and how often they can happen:
| Move | Which piece(s) | When it's played | One-time only? |
|---|---|---|---|
| Castling (O-O / O-O-O) | King + Rook | When all five conditions are met | At most once per side — once castling is played, the King is already considered to have moved, the right ends |
| En passant (pawn capture) | Pawn captures pawn | Only on the very next move after opponent's pawn advances two squares | No — if not used on that move, the right is lost immediately |
| Pawn promotion | Pawn | When a pawn reaches the back rank (8th or 1st rank) | No — each pawn that promotes does so separately |
Castling: securing the King, bringing the Rook into play
Castling is the only move that simultaneously tucks the King to safety and brings the Rook to the center. Kingside castling (O-O) uses the King and the Kingside Rook, while queenside castling (O-O-O) uses the King and the Queenside Rook; both are possible for either color. The King slides two squares toward the Rook, and the Rook jumps over the King, landing on the square the King just passed — for kingside castling this is one leap, and for queenside castling the Rook travels one square further, the same idea extended. In notation these two moves are always written O-O and O-O-O — and that's how they appear in the move list too. Although castling moves two pieces at once, it still counts as a single move; our engine processes castling in full, just like any ordinary piece movement, as one move.

The five conditions of castling
Castling cannot be played in our engine unless all five conditions are met simultaneously:
- The King of the side playing must not be in check at that moment.
- The castling right in that direction must still exist — the King or that Rook must never have moved before.
- The squares between the King and Rook must be empty — f and g for kingside castling, b, c, and d for queenside castling.
- The Rook must still be on its starting square.
- The square the King passes through and the square it lands on must not be under attack — both \"castling through a checked square\" and \"castling into check\" are forbidden.
Castling rights are lost square by square: if the King moves, if the relevant Rook moves, or if that Rook is captured on its starting square, that direction's right is lost. The fifth condition covers only the squares the King passes through and lands on — the square the Rook passes through (the b-file for queenside castling) need only be empty; if it's under attack, castling is still legal, because that is not a square the King traverses.
En passant (pawn capture)
When a pawn advances two squares from its starting position and lands directly beside an opponent's pawn, that opponent's pawn can capture it as if it had only advanced one square. Here's the part everyone forgets: this right exists only for the very next move. The square behind the pawn that advanced two squares is cleared from the engine the moment any other move is played — so if you wait a turn, the capture right is completely gone and never returns.

Pawn promotion
When a pawn reaches the back rank (8th for White, 1st for Black), it promotes. Four options exist: Queen, Rook, Bishop, or Knight — promoting to a Queen is not mandatory; our engine accepts all four as valid. The board won't leave this unsaid: when a move requiring promotion is played, a choice window opens on the screen and you select which piece you want. If this choice never reaches the server (for example, in a bot move or if connection fails), the system silently promotes to a Queen — if you're a human player this won't affect you, because the board already asks every time.

Trying all three on the board
Castling, en passant, and promotion — all three play the same way whether you drag or tap on the board; both produce the same move. The move list records these three moves in its own notation: castling as O-O or O-O-O, and promotion as =Q/=R/=B/=N. On a wide screen this list is a fixed panel beside the board; on a narrow screen it's a page you can open and close — so you can look back and read a move in a single line. Whatever board you pick — the engine has no knowledge of boards or themes, so the castling conditions, en passant window, and promotion options work exactly the same on every board.
When you pick a piece, the squares it can reach are marked on the board: captures appear with a ring, empty but legal squares appear with a dot, and if the King is in check the square turns red. Every square the engine currently allows — including any move leading to castling, en passant, or promotion — appears in these marks, so you can answer the question \"can I castle right now\" not by memorizing the rules but by looking at the board itself.
If you notice you played something wrong right away, your only option isn't \"pay attention next time\": if you're playing against a bot, you can use the ↩ button on the board to take back your last move and your opponent's reply — the position reverts but your time doesn't come back. You don't have this right in games against humans.
The fastest way to nail these three rules in practice is to actively look for them in a chess game: if your opponent's Rook is still on the corner, count the castling conditions; when you advance a pawn two squares, watch to see if your opponent has the right to capture en passant; when you carry a pawn to the back rank, decide in advance which piece you want to pick. If you want to refresh the basic piece movements, check the piece movements article; if you're starting from scratch, visit the how to play chess guide; if you want to turn these three moves into tactics, see the chess tactics article.
Frequently Asked Questions
When can't you castle?
You can't castle if the King is currently in check, if the square the King will pass through is under attack, or if the King's destination square is under attack. Additionally, if the King or that Rook has moved before, or if the Rook was captured on its starting square, the right is already lost. In addition to these, the squares between the King and Rook must also be empty.
What is en passant (pawn capture)?
When a pawn advances two squares and lands directly beside an opponent's pawn, that opponent can capture it on their next move as if it had only advanced one square. This right exists only for the very next move; once any other move is played, it is completely lost and never returns.
What pieces can a pawn promote to?
Queen, Rook, Bishop, or Knight — all four are valid, promoting to a Queen is not mandatory. When a move requires promotion, the engine offers these four options and the board opens a choice window for the player.
What happens if I don't choose during promotion?
Normally this won't happen because the board opens a choice window for every promotion. But if the choice never reaches the server, the system automatically promotes to a Queen.
What's the difference between kingside and queenside castling?
Kingside castling (O-O) involves the King and the Kingside Rook, while queenside castling (O-O-O) involves the King and the Queenside Rook; in both cases the King slides toward the Rook, and the Rook jumps over it. Both must satisfy the same five conditions at the same time; only the number of squares between them and the direction differs.
If the square the Rook passes through is under attack, does castling fail?
No. The castling rule only requires the squares the King passes through and lands on to be safe; the square the Rook passes through (the b-file for queenside castling) need only be empty — if it's under attack, castling is still legal.