GuidesTools

FEN Explained for Chess Players

FEN is the companion to PGN. PGN records a game, FEN records a single position, and knowing it saves a surprising amount of time.

What it is for

PGN records a game. FEN records a single position, in one line of text, completely.

That difference is the whole point. When you want to show somebody a position without the moves that led to it, or set up an engine at a specific point, or save a puzzle, a whole game is the wrong container. FEN is the right one.

It stands for Forsyth-Edwards Notation, after the journalist who devised it in the nineteenth century and the programmer who adapted it for computers.

The six fields

one position, one line of text rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1 piece placement ranks 8 down to 1, slash separated 4P3 four empty squares, a pawn, three empty b whose turn it is KQkq who can still castle e3 en passant square, or a dash 0 moves since a capture or pawn move 1 the move number six fields, space separated, always in this order
The position after 1. e4, written out in full. Every chess program on earth understands this line.

The pieces. Ranks from 8 down to 1, separated by slashes. Uppercase is White, lowercase is Black. A digit means that many empty squares in a row, so 4P3 is four empty squares, a white pawn, then three more empty squares.

Side to move. w or b. Easy to overlook and it changes everything about the position.

Castling rights. K and Q for White’s kingside and queenside, k and q for Black’s. A dash if nobody can castle any more. This is information you cannot see by looking at a board, which is exactly why it has to be written down.

En passant. The square a pawn could be captured on this move, or a dash. Also invisible from the position alone.

Halfmove clock. Moves since the last capture or pawn move, for the fifty move rule.

Move number. Which move the game is on.

The last two are frequently ignored by casual tools and matter enormously to engines, because they decide draws.

a b c d e f g h rnbqkbnr/ pppppppp/8/8/ 4P3 /8/PPPP1PPP/ RNBQKBNR b KQkq e3 4P3 is rank 4: four empty, a pawn, three empty
This is the board that FEN describes. Reading the string left to right and top to bottom gives you exactly this: seven empty ranks of detail, one pawn moved.

When you would actually use one

Setting up a position to analyse. Paste a FEN into any analysis board and you are there, with no moves to replay.

Asking a question. Sharing a FEN is the precise way to ask about a position. Sharing a screenshot is not, because nobody can paste a screenshot into an engine.

Saving a puzzle. A tactic is a position, not a game.

Starting a repertoire mid-game. If you want to prepare from a specific structure rather than from move one, FEN is how you tell the software where to begin.

The two things that go wrong

A missing or wrong side-to-move field. The same board with w and with b is two completely different positions, and the mistake is silent. If an engine gives you an evaluation that makes no sense, check this first.

Truncated strings. FEN is one line and some chat applications wrap or cut it. If a position will not load, count the fields. There should be six.

Its relationship with PGN

They work together. A PGN file can carry a FEN in its tag pairs, using the FEN and SetUp tags, which is how you record a game that did not start from the normal position.

If you are moving analysis between programs, you will mostly want PGN, because it carries the moves and variations. Reach for FEN when the position alone is the thing you care about. We covered the other half in PGN files explained for chess players.

Worth knowing, not worth memorising

You will never write a FEN by hand. Every program produces them with a copy button.

What is worth having is the ability to read one when something breaks: to glance at a string and see that castling rights are missing, or that it says Black to move when you meant White. That takes about five minutes to learn and saves an hour the first time a position refuses to load.

  • FEN
  • PGN
  • Chess Notation