FEN (Forsyth-Edwards Notation) is a single line of text that describes a complete chess position: where every piece stands, whose turn it is, castling rights, en passant, and the move clocks. A standard game starts at a FEN that begins rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1.
A chess position is a picture. FEN is that picture written down as text, in a form a computer or a player can paste into any chess program. Every analysis tool, database and engine speaks it, which is why it is worth knowing how to read.
FEN stands for Forsyth-Edwards Notation, named after the journalists who devised its ancestor for recording games in print. The version chess software uses today was standardised alongside the Portable Game Notation format, and it is the position half of the pair: PGN records a game, FEN records a single moment in it.
A FEN in one line
The starting position of every chess game is written like this:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1Six fields, separated by single spaces. Read left to right, they describe the board, then the state of the game around it.
| Field | Example | Meaning |
|---|---|---|
| 1 | rnbqkbnr/... | Piece placement, from rank 8 down to rank 1 |
| 2 | w | Side to move: w for White, b for Black |
| 3 | KQkq | Castling rights still available |
| 4 | - | En passant target square, or - if none |
| 5 | 0 | Halfmove clock, for the fifty-move rule |
| 6 | 1 | Fullmove number |
Field 1: where the pieces are
The first field lists eight ranks separated by forward slashes, starting at rank 8 at the top and ending at rank 1 at the bottom. Within a rank, pieces are written as letters and empty squares as digits.
- Uppercase letters are White pieces: K king, Q queen, R rook, B bishop, N knight, P pawn.
- Lowercase letters are Black pieces: k, q, r, b, n, p.
- A digit is a run of that many empty squares. So 8 means an entirely empty rank.
- Ranks are always eight squares wide, so the digits in a rank must add up to 8.
Take the middle of the starting position: 8/8 means ranks 6 and 5 are empty. Now a real position from the Ruy Lopez:
r1bqkbnr/pppp1ppp/2n5/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 2 3Field 2: whose turn it is
A single letter, w or b. This field matters more than it looks. The same arrangement of pieces can be strongly winning for one side to move and losing for the other, particularly in endgames with a lone rook or queen, so a FEN without the correct side to move is not the same position.
Field 3: castling rights
Four characters at most, in the order KQkq, listing which castling moves are still legal. K means White may still castle kingside, Q White queenside, k and q the same for Black. A dash means no castling is available for either side.
Field 4: en passant
If the previous move was a two-square pawn advance that could be captured en passant, this field names the square the pawn passed over: e3 after e2-e4, for example. Otherwise it is a dash.
Notation standards differ slightly here. Some writers record the target square any time a two-square pawn move was played, while others record it only when an enemy pawn is actually positioned to capture. Either way, the field exists so a program can offer the legal en passant capture.
Fields 5 and 6: the clocks
The halfmove clock counts plies since the last capture or pawn move. When it reaches 100, the fifty-move rule allows either player to claim a draw. It resets to 0 after any capture or pawn move.
The fullmove number starts at 1 and increments after every Black move, so it counts complete move pairs rather than individual plies.
Where FEN is useful
- Pasting a specific position into an analysis board without replaying the whole game.
- Sharing a puzzle or a position in a message, where a screenshot would lose the details of turn and castling.
- Recording a position in a database row, because it is one short string rather than a game's worth of moves.
- Setting up an endgame study, where you want to start from a position rather than play into it.
- Comparing positions for repetition, since two visually identical boards with different castling rights are not the same position.