Skip to content
Aback Chess
Sponsors

FEN fields explained, with examples

A field-by-field walkthrough of a FEN string: piece placement, side to move, castling rights, en passant, and the halfmove and fullmove clocks.

Notation and formats · 4 min read · 857 words · updated

A FEN string has six space-separated fields: piece placement by rank, side to move, castling rights, the en passant target square, the halfmove clock, and the fullmove number. The first field is the only one that describes the board; the other five describe the state of the game around it.

Most FEN problems come down to one field. This page walks through all six with worked examples, so you can spot which part of a string is wrong rather than guessing.

r3k2r/pppq1ppp/2npbn2/4p3/4P3/2NPBN2/PPPQ1PPP/R3K2R w KQkq - 0 1
A symmetric middlegame position, still on move one because it was built by hand rather than played.

Field 1: piece placement

Eight ranks, separated by slashes, from rank 8 down to rank 1. Each rank is written left to right, file a to file h.

CharacterMeans
K / kKing, White / Black
Q / qQueen
R / rRook
B / bBishop
N / nKnight
P / pPawn
1 to 8That many consecutive empty squares

Read r3k2r as eight squares: rook, then three empty, then the king, then two empty, then a rook. That is a back rank with both rooks still home and the queen and bishops gone, which is why the position above has castling rights for both sides despite being a middlegame.

Field 2: active colour

w or b. Nothing else is accepted. A surprisingly common bug is writing W or leaving the field blank, both of which produce a string that looks plausible and fails to load.

Field 3: castling availability

List the available castling moves in the order KQkq, dropping the ones that are gone. If none remain, write a single dash.

ValueMeaning
KQkqAll four castling moves still available
KqWhite kingside and Black queenside only
-No castling possible for either side

Rights are independent of where the pieces happen to be. If a rook has moved away and come back, the position looks normal but the right is gone, and only this field records that fact.

Field 4: en passant target square

After a two-square pawn advance, this field names the square the pawn skipped over. After 1. e4 it is e3. If the previous move was anything other than a two-square pawn push, it is a dash.

rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1
After 1. e4, the passed-over square e3 is recorded.

Field 5: halfmove clock

The number of plies since the last capture or pawn move. It exists for the fifty-move rule, which lets a player claim a draw once the count reaches 100 plies, that is fifty moves by each side.

  • A capture resets it to 0.
  • Any pawn move resets it to 0, including a non-capturing push.
  • A quiet knight move, for example, increments it by one.

Field 6: fullmove number

Starts at 1 and increases after Black's move. It counts full moves, not plies, so after 1. e4 the number is still 1, and after 1... e5 it becomes 2.

Checking a FEN by hand

  • Split the string on spaces and confirm you have six fields.
  • Count the slashes: there must be exactly seven, giving eight ranks.
  • For each rank, add the digits to the letters and check the total is 8.
  • Confirm field 2 is exactly w or b.
  • Confirm field 3 is a subset of KQkq in that order, or a dash.
  • Confirm field 4 is a valid square on rank 3 or 6, or a dash.

Frequently asked questions

Can I leave out the last two FEN fields?
Some software accepts four fields and assumes a halfmove clock of 0 and fullmove number of 1. Writing all six is safer, since a strict parser will reject the shortened form and the clocks do not affect the evaluation of the position.
Why does my FEN say a pawn can be captured en passant when there is no pawn to capture it?
Conventions differ. Some writers always record the target square after a two-square pawn move, others only when a capture is actually available. Either is readable, but tools may disagree about whether the en passant move should be offered.
Does castling rights affect the evaluation?
Yes, sometimes by a large amount. A position with castling rights can be several tenths of a pawn better for the side that keeps them, because the king reaches safety with a single move. Two boards that look identical but differ in this field are different positions.