Forsyth–Edwards Notation
   HOME

TheInfoList



OR:

Forsyth–Edwards Notation (FEN) is a standard
notation In linguistics and semiotics, a notation is a system of graphics or symbols, characters and abbreviated expressions, used (for example) in artistic and scientific disciplines to represent technical facts and quantities by convention. Therefore, ...
for describing a particular board position of a
chess Chess is a board game for two players, called White and Black, each controlling an army of chess pieces in their color, with the objective to checkmate the opponent's king. It is sometimes called international chess or Western chess to dist ...
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; Steven J. Edwards extended it to support use by computers. FEN is defined in the "Portable Game Notation Specification and Implementation Guide". In the
Portable Game Notation Portable Game Notation (PGN) is a standard plain text format for recording chess games (both the moves and related data), which can be read by humans and is also supported by most chess software. History PGN was devised around 1993, by Steven J. ...
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 Draw, drawing, draws, or drawn may refer to: Common uses * Draw (terrain), a terrain feature formed by two parallel ridges or spurs with low ground in between them * Drawing (manufacturing), a process where metal, glass, or plastic or anything ...
by
threefold repetition In chess, the threefold repetition rule states that a player may claim a draw if the same position occurs three times during the game. The rule is also known as repetition of position and, in the USCF rules, as triple occurrence of position.Articl ...
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 A filename extension, file name extension or file extension is a suffix to the name of a computer file (e.g., .txt, .docx, .md). The extension indicates a characteristic of the file contents or its intended use. A filename extension is typically ...
.fen. A FEN record contains six fields, each separated by a space. The fields are as follows: # Piece placement data: Each is described, starting with rank 8 and ending with rank 1, with a "/" between each one; within each rank, the contents of the squares are described in order from the a- to the h-file. Each piece is identified by a single letter taken from the standard English names in algebraic notation (pawn = "P", knight = "N", bishop = "B", rook = "R", queen = "Q" and king = "K"). White pieces are designated using uppercase letters ("PNBRQK"), while black pieces use lowercase letters ("pnbrqk"). A set of one or more consecutive empty squares within a rank is denoted by a digit from "1" to "8", corresponding to the number of squares. # Active color: "w" means that White is to move; "b" means that Black is to move. # Castling availability: If neither side has the ability to castle, this field uses the character "-". Otherwise, this field contains one or more letters: "K" if White can castle kingside, "Q" if White can castle queenside, "k" if Black can castle kingside, and "q" if Black can castle queenside. A situation that temporarily prevents castling does not prevent the use of this notation. # ''
En passant ''En passant'' (, "in passing") is a method of capturing in chess that occurs when a pawn captures a horizontally adjacent enemy pawn that has just made an initial two-square advance. The capturing pawn moves to the square that the enemy paw ...
'' target square: This is a square over which a pawn has just passed while moving two squares; it is given in algebraic notation. If there is no ''en passant'' target square, this field uses the character "-". This is recorded regardless of whether there is a pawn in position to capture ''en passant''. An updated version of the spec has since made it so the target square is only recorded if a legal en passant move is possible but the old version of the standard is the one most commonly used. # Halfmove clock: The number of halfmoves since the last capture or pawn advance, used for the
fifty-move rule The fifty-move rule in chess states that a player can claim a draw if no has been made and no pawn has been moved in the last fifty moves (for this purpose a "move" consists of a player completing a turn followed by the opponent completing a tur ...
. # Fullmove number: The number of the full moves. It starts at 1 and is incremented after Black's move.


Examples

The following example is from the FEN specification: Here is the FEN for the starting position:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
And after the move 1.e4:
rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1
And then after 1...c5:
rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2
And then after 2.Nf3:
rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2


FEN adjustment for chess variants like Chess960

FEN is critical for recording games in chess variants such as
Chess960 Fischer random chess, also known as Chess960 (often read in this context as 'chess nine-sixty' instead of 'chess nine hundred sixty'), is a variation of the game of chess invented by the former world chess champion Bobby Fischer. Fischer annou ...
(also known as Fischer Random Chess), where the initial position is not necessarily the traditional initial position. However, the FEN castling availability encoding (KQkq) is inadequate for variants in which there are two rooks on the same side of the king on the back rank, as if only one rook were available for castling it would be ambiguous which rook it was without knowing their initial positions. The solution implemented by chess engines like Shredder and Fritz_9 is to use the letters of the columns on which the rooks began the game. This scheme is sometimes called Shredder-FEN. For the traditional setup, Shredder-FEN would use AHah instead of KQkq. Another solution is offered by X-FEN, which offers more backward compatibility than Shredder-FEN does, but at the cost of more complexity.


See also

*
Portable Game Notation Portable Game Notation (PGN) is a standard plain text format for recording chess games (both the moves and related data), which can be read by humans and is also supported by most chess software. History PGN was devised around 1993, by Steven J. ...
* Extended Position Description


References


External links


Portable Game Notation Specification and Implementation Guide, Steven J. Edwards
{{DEFAULTSORT:Forsyth-Edwards Notation Computer chess Chess notation Computer file formats