P44 years ago

FEN chess notation explained

What is FEN?

FEN stands for Forsyth-Edwards Notation — chess notation used for displaying a chess position with simple text. It was designed by David Forsyth in the 19th century and later adapted to computing by Steven Edwards.

In a single line, it describes the content of each row on a chess board from top to bottom and left to right.

FEN is particularly useful for displaying a single chess position, share it and discuss with others. It can also be used for posting puzzles or exercises. It provides all necessary information to do a move from a specific place within the game. Though it will not tell you much about what happened before.

Piece location

The board is composed of eight rows, called ranks in chess. Each chess piece is abbreviated by a letter that represents it. The white pieces are written in uppercase, the black pieces in lowercase: king (K, k), queen (Q, q), rook (R, r), bishop (B, b), knight (N, n), pawn (P, p).

Squares that are empty are specified with a digit from 1 to 8 representing a count of consecutive empty squares. A completely empty rank would be specified with 8.

Ranks are separated by slashes /.

The starting position of each chess board is written as follows: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR.

  • ‘rnbqkbnr’ stands for

  • ‘pppppppp’ stands for

  • ‘8/8/8/8/‘ represents four empty ranks

  • ‘PPPPPPPP’ stands for

  • ‘RNBQKBNR’ stands for

Additional fields

None of the below is needed if you simply want to display a chess position in your post on P4. These additional fields are mainly used to describe some extra details about the state of the position.

In addition to a piece location, FEN line can also include a description of five additional fields such as (1) whose move is next, (2) castling availability, (3) en passant target square, (4) half move count, and (5) full move count. All this information fits into a single FEN line, separated by a space character, and can be easily read.

With additional description, the starting position would be written as rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1, with w KQkq - 0 1 added in and can be transcribed as follows:

  • Whose move is next: w stands for white or b for black.

  • Possible castling: if none, simply put -. Otherwise, castling rights are indicated by KQkq, whereK appears if white has kingside castling availability.

  • En passant target square: if none, simply put -. Otherwie the target square for the capture.

  • Half move count: a number of moves since last catch.

  • Full move count: a number of full moves, starts at 1.

Display a chess position

To display a chess position on the chess board in your post on P4, simply put the FEN line inside the backticks ``` as shown in a few examples below. You can draw it without providing a description of any of the additional fields.

Move 1.e4 c5 (With additional fields)

Move 1.e4 c5 2.Nf3 (Without additional fields)

Fischer vs Pal Benko, Yugoslavia, 1959