dojotrades.com

How to write castling, en passant and pawn promotion

Most moves are written as a piece letter and a square. Castling, en passant and promotion break that pattern, because each one changes the board in a way that a single square name cannot describe.

You will learn the signs for both kinds of castling and the conditions behind them, which square to write for an en passant capture and how to record the new piece when a pawn reaches the far end.

Castling: O-O and O-O-O

Castling moves two pieces in one turn. The king goes two squares toward a rook, and that rook jumps to the square the king passed over. The record is the letter O repeated with hyphens, with no square name at all.

Where king and rook finish after castling
WrittenNameWhite king and rookBlack king and rook
O-Okingside castlingg1 and f1g8 and f8
O-O-Oqueenside castlingc1 and d1c8 and d8
White king on e1, rooks on a1 and h1, queen on d2 and seven pawns on the second rank; Black has the matching setup on the seventh and eighth ranks.
White to move may castle on either side. O-O puts the king on g1; O-O-O puts it on c1.Open this position in the Board builderr3k2r/pppqpppp/8/8/8/8/PPPQPPPP/R3K2R w KQkq - 0 1

To remember which is which, count the squares between king and rook before the move. There are two on the kingside, matching two letters, and three on the queenside, matching three.

Some scoresheets use zeros in place of the letter. Computer game files use the letter O. A check or mate sign, if needed, follows as it would after any move. The ordinary signs are explained in algebraic notation for beginners.

The spelling is easy. The conditions are where records go wrong, since a move written as O-O must have been allowed at that moment.

All of these must be true

  • The king has not moved earlier in the game.
  • The rook you castle with has not moved.
  • Every square between the king and that rook is empty.
  • The king is not in check.
  • The king does not cross a square that an enemy piece attacks.
  • The king does not land on an attacked square.

The first two conditions are permanent. Once the king has moved, that side cannot castle again, even if the king walks back home. A rook that has moved removes castling on its own side only. The other conditions are temporary: when the obstacle or attack disappears, castling can become possible.

For attacks, only the king's route counts. The rook may be under attack, and on the queenside it may travel across an attacked square.

White king on e1 with rooks on a1 and h1; black rooks on b8 and f8 aim down the open b-file and f-file; black king on h8.
The rook on f8 stops kingside castling. O-O-O is legal although b1 is attacked.White to move. Open this position in the Board builder1r3r1k/6pp/8/8/8/8/P5PP/R3K2R w KQ - 0 1

Here the king would have to pass over f1 to castle short, and the black rook controls it. On the long side the king travels through d1 to c1. Neither is attacked, and the square b1 is crossed by the rook alone.

En passant: write the square the pawn lands on

A pawn that advances two squares from its starting rank can be captured as if it had moved only one. The capturing pawn must stand directly beside it after the jump, on the same rank and a neighboring file. The capture has to be made at once, on the very next move, or the chance is gone.

White pawn on e5 beside a black pawn on d5, with the square d6 empty; kings on e1 and e8 and two pawns each on the g and h files.
The black pawn has just gone from d7 to d5. White may answer exd6 on this turn only.White to move. Open this position in the Board builder4k3/6pp/8/3pP3/8/8/6PP/4K3 w - d6 0 2

The record looks like any pawn capture: the file of the capturing pawn, an x and the square where it arrives. In the diagram the white pawn leaves e5 and appears on d6, and the black pawn on d5 is removed. You write exd6, because d6 is the destination, even though nothing stood there.

Some players add the letters e.p. after the move. Standard computer files do not need them. The skipped square also appears in position codes, in a field described under the six fields of FEN.

Promotion and the equals sign

A pawn that reaches the last rank must be replaced, as part of the same move, by a queen, rook, bishop or knight of its own color. It cannot stay a pawn and it cannot become a king. The choice does not depend on what has been captured, so a second queen is allowed.

Write the destination square, then an equals sign, then the letter of the new piece. If the pawn captured as it promoted, keep the capture form in front. A check or mate sign goes last.

Reading promotion moves
WrittenMeaning
g8=Qa pawn reaches g8 and becomes a queen
g8=Rthe pawn becomes a rook instead
f8=N+the new piece is a knight, and it gives check
bxa8=Qthe b-pawn captures on a8 and becomes a queen

Handwritten records sometimes leave out the equals sign and put the piece letter straight after the square. Computer game files keep the sign.

Underpromotion: when a queen is the wrong choice

Choosing anything other than a queen is called underpromotion. You will not need it often, but two reasons for it are easy to see on a board: a new knight can attack where a queen cannot, and a piece with fewer moves can avoid stalemate.

White pawns on f7 and a2 and white king on g1; black king on h7 and black queen on d7.
White to move. f8=N+ checks the king and attacks the queen at once.Open this position in the Board builder8/3q1P1k/8/8/8/8/P7/6K1 w - - 0 1

The black king must step out of check, and White then takes the queen with Nxd7 while keeping the a-pawn. Every other first move, including making a new queen, gives up the win.

White pawn on g7 and white king on g4; black king on h6.
White to move. A new queen is stalemate; g8=R is the winning promotion.Open this position in the Board builder8/6P1/7k/8/6K1/8/8/8 w - - 0 1

After g8=Q the new queen and the white king would cover every square around the black king without checking it, so the game would end in a draw. A rook leaves h7 open. Black can still move, and White keeps enough force to win.

Common mistakes with special moves

  • Writing castling as a king move. The record is O-O or O-O-O, not Kg1.
  • Using the wrong length. Two squares between king and rook go with the short sign, three with the long one.
  • Naming the captured pawn's square. En passant is written with the arrival square.
  • Capturing en passant late. After any other move, that right has expired.
  • Leaving out the new piece. A bare g8 does not say what the pawn became.

If a game record stops making sense, check these move types early. A forgotten promotion leaves the wrong piece on the board, and a forgotten removal after en passant leaves one pawn too many. When two like pieces cause the confusion instead, see how to tell them apart.

To try the situations yourself, set them up in the Board builder, where you can also choose the castling rights and the en passant square. A position code that claims rights the pieces cannot support is one of the faults listed in why a FEN is rejected.

Common questions

Can you castle after your king has been in check?

Yes, as long as the king has not moved. You cannot castle while it is still in check.

Can you castle if the rook is attacked?

Yes. The safety conditions apply to the king's square, the square it crosses and the square where it lands.

Which square do you write for en passant?

Write the square where the capturing pawn finishes, which is the one the enemy pawn skipped. An example is exd6.

Can you promote to a queen if you still have one?

Yes. A pawn may become a queen, rook, bishop or knight no matter which pieces are still on the board.

Sources

Keep studying

All guides on reading and writing positions