Forsyth-Edwards Notation — FEN — represents one chess position in a single text line.
It does not represent the complete game that led there.
FEN is a position snapshot, not a game record.
A FEN contains six space-separated fields:
- piece placement;
- side to move;
- castling availability;
- en-passant target square;
- halfmove clock;
- fullmove number.
Six-field anatomy
Example starting position:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1Split:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR
w
KQkq
-
0
1| Field | Example | Meaning |
|---|---|---|
| 1 | rnbq... | piece placement |
| 2 | w | side to move |
| 3 | KQkq | castling availability |
| 4 | - | en-passant target |
| 5 | 0 | halfmove clock |
| 6 | 1 | fullmove number |
Piece placement field
FEN describes the board:
- rank 8 first;
- down to rank 1;
- within each rank, file a to h.
Ranks are separated by:
/.
White pieces use uppercase letters:
P N B R Q K.
Black pieces use lowercase:
p n b r q k.
Empty consecutive squares use digits:
1through8.
Example rank
r3k2r
means:
- a-file black rook;
- b/c/d empty =
3; - e-file black king;
- f/g empty =
2; - h-file black rook.
The rank expands to exactly eight squares.
Every FEN rank must decode to exactly eight board squares.
Empty runs
Digits count contiguous empty squares.
Examples:
8= entire rank empty;3p4= three empty, black pawn, four empty;2N5= two empty, White knight, five empty.
Digits do not represent:
- piece counts;
- rank numbers.
Side to move
Second field:
w→ White to move;b→ Black to move.
This information cannot always be inferred from the board picture.
Piece placement alone is not a complete chess position state.
Castling availability
Third field uses:
KWhite kingside right;QWhite queenside right;kBlack kingside right;qBlack queenside right;-none.
Typical ordering:
KQkq.
Rights, not immediate legality
K means White retains kingside castling availability/right in the position representation.
It does not mean White can necessarily castle on the current move.
Castling may still be temporarily illegal because:
- path occupied;
- king in check;
- transit/destination attacked.
FEN castling field stores rights/availability state, not a guarantee that castling is legal right now.
En-passant target square
Fourth field is either:
- a square such as
e3ord6; - or
-.
The traditional FEN specification records an en-passant target square after a pawn double advance.
Critical nuance:
the target field can be present even when no opposing pawn can legally capture en passant.
Example:
- White plays
e2-e4; - traditional FEN target =
e3; - even if Black has no pawn on d4/f4 able to capture.
FEN en-passant target semantics ≠ FIDE repetition identity's legal en-passant possibility test.
This distinction must not be normalized away.
Target is the passed-over square
After White double push:
- target rank is 3.
After Black double push:
- target rank is 6.
Examples:
e3after e2-e4;c6after c7-c5.
Halfmove clock
Fifth field:
- non-negative integer.
It counts plies since the last:
- pawn move;
- capture.
This supports move-count draw logic.
Example:
0immediately after a pawn move/capture;17after seventeen plies without either.
The FEN halfmove clock counts plies, while the FIDE draw rule is described as moves by each player.
Do not confuse:
50in FEN halfmove clock
with
- the completed 50-move claim threshold.
Fullmove number
Sixth field:
- positive integer;
- begins at
1; - increments after Black moves.
Starting position:
1.
After White's first move:
- still
1.
After Black's first move:
- becomes
2.
Fullmove number changes after Black, not after every ply.
Starting position parse
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1Field 1
Standard initial piece placement.
Field 2
w → White to move.
Field 3
KQkq → all four orthodox castling rights available.
Field 4
- → no en-passant target.
Field 5
0 → no prior quiet halfmoves in the count.
Field 6
1 → first fullmove number.
FEN after 1.e4
Traditional FEN:
rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1Notice:
- side = Black;
- e-pawn on e4;
- target
e3; - halfmove = 0;
- fullmove still 1.
e4What FEN preserves — and what it does not
FEN captures enough state to resume or analyze a position in many chess applications, but it is not a historical record.
It preserves:
- where the pieces are;
- whose turn it is;
- orthodox castling-right flags;
- the en-passant target field;
- the halfmove clock;
- the fullmove number.
It does not preserve:
- the complete move sequence that produced the position;
- which pieces were captured and when;
- previous repetition states;
- event, player or clock metadata;
- comments or variations.
Two different games can therefore reach the same FEN. Conversely, two boards with identical visible piece placement can have different FEN strings because side to move, castling rights or en-passant state differ.
Castling rights are historical state
A board image cannot always tell you the correct third FEN field.
Imagine White's king and rook are back on e1 and h1. If the king moved earlier and later returned to e1, White no longer has the right to castle. The visible placement looks compatible with castling, but the historical right has been lost.
This is why a diagram alone cannot reliably generate a full FEN unless the hidden state is supplied or explicitly assumed.
The en-passant field deserves special care
Traditional FEN records the square passed over by a pawn immediately after a two-square pawn advance, even when no opposing pawn can actually make an en-passant capture.
That is a representation rule. It should not be confused with:
- whether an en-passant capture is currently legal;
- whether two positions count as the same for repetition purposes.
Those questions depend on chess-rule semantics, not merely on whether field four contains a coordinate.
Halfmove clock vs fullmove number
The last two fields count different things.
The halfmove clock is a reversible-move counter for draw-rule support. It resets after a pawn move or capture and otherwise increments after every ply.
The fullmove number is a numbering aid. It starts at 1 and increments after each Black move.
A position can therefore have a large fullmove number and a halfmove clock of 0 immediately after a pawn move or capture.
Frequently asked questions
Can FEN tell me the last move?
Usually no. The en-passant field can reveal that the immediately previous move was a two-square pawn advance in the traditional representation, but FEN is not designed to store the complete previous move.
Can the same visible board have multiple valid FEN strings?
Yes. Side to move, castling rights, en-passant state and counters may differ while piece placement remains identical.
Is a valid-looking FEN necessarily a legal chess position?
No. Grammar, state consistency and legal reachability are separate validation layers.
Key takeaways
FEN is one position encoded in six fields.
Critical semantics:
- placement rank 8→1;
- uppercase White/lowercase Black;
- side to move explicit;
- castling rights not current-castle guarantee;
- en-passant target uses traditional double-push semantics;
- halfmove = plies since pawn move/capture;
- fullmove increments after Black.