Notation

What is FEN in chess?

Updated · Sergei Tovmasian

Short answer

FEN, Forsyth-Edwards Notation, packs a whole position into one line of text with six fields: where the pieces are (rank 8 first, capitals for White), whose turn it is, what castling is still allowed, the en passant square, how many moves since the last capture or pawn move, and the move number.

Here is the starting position of a chess game as one line of text:

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

8
7
6
5
4
3
2
a
b
c
d
e
f
g
h 1
The line above, drawn. The placement reads from rank 8 downwards: Black's back rank, Black's pawns, four empty ranks, White's pawns, White's back rank.

FEN is Forsyth-Edwards Notation, and it does for one position what PGN does for a whole game. Six fields, separated by spaces. Every diagram on this site is one of them.

The six fields

The first field is the pieces. Ranks are listed from 8 down to 1 with slashes between them, and inside each rank the squares run a to h. Capitals are White (K Q R B N P), lower case is Black, and a digit counts empty squares in a row. So rnbqkbnr is Black’s back rank read from a8 to h8, and 8 on its own is a completely empty rank.

The second field is whose turn it is, w or b. One character, and it changes everything about the position.

The third is castling: K and Q for White’s kingside and queenside rights, k and q for Black’s, and a lone - when nobody can castle any more. These are rights, not opportunities. The field says the king and rook have not moved, not that castling is legal this instant.

The fourth is the en passant square, and it is the square a capturing pawn would move to, sitting behind the pawn that has just gone two: d6, not d5. A - means there is nothing to take in passing. Some programs fill the field after every two-square push, others only when a capture is actually available, which is why the same position sometimes appears written two ways.

The fifth is the halfmove clock: single moves played since the last capture or pawn move. At 100, which is fifty by each player, the fifty-move rule is claimable.

The sixth is the move number. It starts at 1 and goes up after each Black move.

Reading a small one

8
7
6
5
4
3
2
a
b
c
d
e
f
g
h 1
The line 8/8/8/8/3k4/8/3P4/3K4 w - - 0 1, drawn: four empty ranks, a black king on d4, an empty rank, a white pawn on d2, a white king on d1, White to move.

Take it a slash at a time. Four 8s, so ranks 8, 7, 6 and 5 are empty. 3k4: three empty squares (a4, b4, c4), a black king on d4, four more empty. 8 again for rank 3. 3P4: a white pawn on d2. 3K4: the white king on d1. Then w for White to move, - for no castling rights, - for no en passant, 0 because nothing has been captured or pushed lately, 1 for move one.

That line is an entire king and pawn ending in fifty characters, which is the point of the format.

Where you meet one

You copy a position out of a book into an engine, and you are typing a FEN. You share a position in a forum post, and you paste a FEN. You set a puzzle in an app, and behind it sits a FEN. A PGN that starts from anywhere other than move one carries a FEN tag to say where.

The name is two people. Forsyth was a Scottish journalist in the nineteenth century who needed a way to print a position inside a column of type; Edwards added the four fields a computer needs, whose turn it is and what is still allowed, when the PGN standard was written.

Getting fluent with the first field is worth one evening, and it is the same skill as naming squares, read aloud from the top left corner.

More questions

What does the number at the end of a FEN mean?

There are two numbers. The first is the halfmove clock: single moves played since the last capture or pawn move, which is what the fifty-move rule counts, so it reaches 100 before a claim is possible. The second is the move number, starting at 1 and going up by one after each of Black's moves.

Why does the FEN start with Black's pieces?

Because the placement field is read from rank 8 downwards, the way a diagram is printed on a page: top row first, left to right. Rank 8 is Black's back rank, so a game's opening FEN begins rnbqkbnr. Lower case letters are Black's pieces and capitals are White's, which is the only thing separating them.

Go deeper

Every puzzle in the app shows its solution in notation. Learn to read it here, then practise.

← All: Notation · Learn chess