PGN (Portable Game Notation) is a plain text format for recording a complete chess game. It has two parts: a header block that records players, event, date and result, and a movetext block that lists the moves in standard algebraic notation. It is the format chess sites and programs use to export and share games.
If FEN is a photograph of one position, PGN is a film of the whole game. It is the format you get when you click export on a chess site, and the format a chess program expects when you ask it to load a game.
A PGN file is plain text. It opens in any text editor, it survives being pasted into an email or a chat message, and it is designed to be readable by a human as well as a machine.
The two halves of a PGN
[Event "Casual Game"]
[Site "Local"]
[Date "2026.09.19"]
[Round "-"]
[White "Alice"]
[Black "Bob"]
[Result "1-0"]
1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 1-0The header block
Headers are one per line, each a name and a value in double quotes inside square brackets. The first seven are required by the standard and are known as the Seven Tag Roster: Event, Site, Date, Round, White, Black and Result.
| Header | Records |
|---|---|
| Event | The name of the tournament or match |
| Site | Where it was played |
| Date | Start date as YYYY.MM.DD, with ?? for unknown parts |
| Round | Round number within the event |
| White | Player with the white pieces |
| Black | Player with the black pieces |
| Result | 1-0, 0-1, 1/2-1/2 or * for unfinished |
Additional headers are allowed and common: ECO for the opening classification, WhiteElo and BlackElo for ratings, TimeControl, Opening, and FEN when the game does not start from the standard position.
The movetext block
Moves are written in standard algebraic notation. A move number followed by a dot introduces White's move; three dots introduce Black's when White's move is missing from the record.
- 1. e4 e5 - White's fourth-rank pawn push, then Black's reply.
- 2. Nf3 Nc6 - knight to f3, knight to c6.
- 5. O-O - castling kingside. Castling queenside is O-O-O.
- Qxd5+ - queen captures on d5 and gives check.
- e8=Q - a pawn promoting to a queen.
- exd6 e.p. - an en passant capture, sometimes marked explicitly.
Captures use x, check uses +, and checkmate uses #. A trailing annotation such as ! or ?? is a human comment on move quality rather than part of the move itself.
Comments, variations and annotations
Text in braces is a comment. Parentheses enclose a variation, which is an alternative line starting from the position before the previous move.
1. e4 e5 2. Nf3 {develops and attacks e5} (2. f4 exf4 {the King's Gambit}) 2... Nc6 3. Bb5 $1NAG stands for Numeric Annotation Glyph, a dollar sign followed by a number encoding an assessment: $1 is a good move, $2 a poor one, $4 a blunder, and so on. Dedicated chess software renders these as the familiar symbols, but they live in the file as plain numbers.
How a PGN ends
The movetext finishes with the result, matching the Result header: 1-0 for a White win, 0-1 for Black, 1/2-1/2 for a draw, and * for a game with no result such as an unfinished or analysis-only record.
What PGN cannot hold
- Engine evaluations are not part of the standard, so grades and scores are not portable between programs.
- Clocks are often recorded in comments rather than as structured data, which is why time-based analysis from a PGN is approximate.
- Board colours, or an initial position beyond the FEN header: a position and its mirror look identical in movetext.
- Rendered formatting. Comments are plain text and should be treated that way, not as markup.
Because a PGN is just text, it is also untrusted input. A well-written viewer displays comments as text rather than interpreting them as formatting or code, and rejects a file it cannot parse rather than silently loading part of it.