FEN is a snapshot of one position; PGN is the record of a whole game. A FEN string is a single line that tells software where every piece stands, whose turn it is, and which special moves are still possible. A PGN file lists the moves (plus optional headers such as players, event and result) so the game can be replayed from the start. Use FEN to share a diagram or puzzle; use PGN when the history matters, for example to review a game.
You can turn any PGN into a FEN by playing the moves to the position you want. You cannot turn a FEN back into a PGN, because the path to the position is lost.
FEN, field by field
Here is the position after 1.e4 a6 2.e5 d5, verified in chess.js:
rnbqkbnr/1pp1pppp/p7/3pP3/8/8/PPPP1PPP/RNBQKBNR w KQkq d6 0 3
Open this FEN in the analysis board →
| Field | Value here | Meaning |
|---|---|---|
| 1. Piece placement | rnbqkbnr/.../RNBQKBNR | Ranks 8 down to 1, split by slashes. Uppercase is White, lowercase Black, digits count empty squares. |
| 2. Side to move | w | White to play. |
| 3. Castling rights | KQkq | Both sides can still castle on both wings. A dash means none. |
| 4. En passant square | d6 | Black's pawn just skipped d6, so exd6 is possible this move only. |
| 5. Halfmove clock | 0 | Plies since the last capture or pawn move, used for the fifty-move rule. |
| 6. Fullmove number | 3 | Starts at 1 and increases after each Black move. |
That d6 field is why FEN is more than a picture. The same board without it would forbid the en passant capture. Likewise, a missing K or Q in field 3 forbids castling even when king and rook look untouched.
PGN, the same game as a move record
[Event "FEN vs PGN example"]
[White "Student"]
[Black "Coach"]
[Result "*"]
1. e4 a6 2. e5 d5 3. exd6 *
The headers in square brackets are optional metadata; the official Seven Tag Roster is Event, Site, Date, Round, White, Black and Result. The moves are written in algebraic notation, and * means the game is unfinished. PGN can also hold comments in braces and variations in parentheses. To start from a custom position, add [SetUp "1"] and a [FEN "..."] header. The format was specified by Steven J. Edwards in 1994 (overview of the PGN standard).
Start
What a FEN cannot tell you: a verified example
Play 1.Nf3 Nf6 2.Ng1 Ng8 3.Nf3 Nf6 4.Ng1 Ng8. Every piece is back on its starting square. chess.js gives this FEN:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 8 5
Two things follow:
- The board is identical to the start, but the FEN is not. Fields 5 and 6 read
8 5instead of0 1. - Only the PGN knows the starting position has now occurred three times. Replaying the moves, chess.js reports threefold repetition as true. Loading the FEN alone, it reports false, because a FEN carries no history. Repetition draws depend on history, so for that question only PGN will do.
We checked both results in chess.js; you can reproduce them by pasting the moves into the analysis board.
Which format to use
| Task | Use | Why |
|---|---|---|
| Ask "what is the best move here?" | FEN | The engine needs the position, not the story. Paste it into the move finder. |
| Share a puzzle or diagram | FEN | One line, fits in a message or a link. |
| Review a whole game | PGN | Each move must be evaluated in turn. |
| Save opening analysis with side lines | PGN | Only PGN stores variations and comments. |
| Check a repetition claim | PGN | Requires the move history. |
| Start a game from a set position | FEN, or PGN with a FEN header | Sets the board and the special-move rights. |
On this site, paste a FEN into the move finder or analysis board to get a Stockfish 17.1 evaluation in the browser, build one from scratch in the board editor, or import a full PGN into Game Review to evaluate it move by move.
Fixing an import that fails
- FEN: each of the 8 ranks must add up to 8 squares; there must be exactly one king of each colour; the side not to move cannot be in check; castling letters must match kings and rooks on their home squares.
- PGN: moves must be legal from the stated starting position, castling uses the letter O, and a game from a custom position needs both SetUp and FEN headers. Paste one game at a time.
A valid FEN is not always reachable from a real game. Software checks the basics, not the full history, so treat composed positions as composed.