Understanding FEN
FEN (Forsyth–Edwards Notation) is the standard text format for a chess position. ChessFEN uses it to pass positions between board images, PGN games, and rendered boards.
Piece placement
A FEN string starts with the piece placement: eight ranks from rank 8 down to rank 1, separated by /.
Uppercase letters stand for White pieces (K, Q, R, B, N, P) and lowercase letters for Black pieces. Digits encode runs of empty squares.
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR
That is the starting position.
The other five fields
A complete FEN adds five space-separated fields: the side to move (w or b), castling rights (KQkq, or - for none), an en passant target square (or -), the halfmove clock, and the fullmove number.
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
ChessFEN distinguishes the first field as a Placement from the six-field Full FEN. A picture can only reveal where the pieces stand, so recognition returns a Placement; the side to move is chosen by the caller and the remaining fields default to - - 0 1.
Where ChessFEN uses FEN
- Recognition reads a board image and returns its Placement, with a per-square breakdown.
- PGN navigation exports the Full FEN after any half-move.
- Rendering turns any syntactically valid FEN into a board image.