Forsyth–Edwards Notation (FEN) is a standard notation for describing a particular board position of a chess game. The purpose of FEN is to provide all the necessary information to restart a game from a particular position.
FEN is based on a system developed by Scottish newspaper journalist David Forsyth. His system became popular in the 19th century, then Steven J. Edwards extended it to support its use by computers. FEN is defined in the "Portable Game Notation Specification and Implementation Guide". In the Portable Game Notation for chess games, FEN is used to define initial positions other than the standard one. FEN does not provide sufficient information to decide whether a draw by threefold repetition may be legally claimed or a draw offer may be accepted; for that, a different format such as Extended Position Description is needed.
Definition
A FEN record defines a particular game position, all in one text line and using only the ASCII character set. A text file with only FEN data records should use the filename extension .fen.
A FEN record contains six fields, each separated by a space...