Fen
FEN, or Forsyth-Edwards Notation, is a standard notation for describing a particular board position of a chess game. The purpose of FEN is to provide all the necessary information to restart a game from a particular position.
Starting position FEN
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
FEN is widely used in chess software, databases, and publications.
Structure of a FEN String
A FEN string consists of six fields separated by spaces, each describing a different aspect of the position.
Piece Placement
Describes the position of all pieces on the board, from the 8th rank to the 1st rank, using a combination of letters and numbers.
Each rank is separated by a slash (/).
Pieces are represented as:
White pieces: K (King), Q (Queen), R (Rook), B (Bishop), N (Knight), P (Pawn).
Black pieces: lowercase k, q, r, b, n, p.
Numbers indicate consecutive empty squares (e.g., 4 means 4 empty squares).
Active Color
Indicates whose turn it is to move: w for White, b for Black.
Castling Availability
Shows which castling moves are still available
K (White kingside), Q (White queenside), k (Black kingside), q (Black queenside).
If no castling is available, a dash (-) is used.
Example: KQkq means both sides can castle kingside and queenside.
En Passant Target Square
Names the square where an en passant capture is possible, using algebraic notation (e.g., e3).
If no en passant is possible, a dash (-) is used.
Halfmove Clock
The number of half-moves (plies) since the last pawn move or capture, used for the 50-move draw rule.
Example: 0 for a fresh position, increases with each move that doesn't involve a pawn or capture.
Fullmove Number
The number of the current full move, starting at 1 and incrementing after Black's move.
Example FEN
The starting position of a chess game:
Starting FEN rnbqkbnr/pppppppp/5n1/8/8/5N1/PPPPPPPP/RNBQKBNR w KQkq - 0 1
Piece placement rnbqkbnr/pppppppp/5n1/8/8/5N1/PPPPPPPP/RNBQKBNR (standard setup).
Active color w (White to move).
Castling KQkq (all castling available).
En passant - (no en passant).
Halfmove clock 0 (no moves without pawn moves/captures).
Fullmove number 1 (game just started).