Skip to content
Aback Chess
Sponsors

What is PGN? How chess games are recorded

PGN is the standard text format for recording chess games. Learn its headers, movetext, comments, variations and results, with examples.

Notation and formats · 5 min read · 1043 words · updated

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-0
A complete PGN: seven headers, then the movetext, then the result.

The 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.

HeaderRecords
EventThe name of the tournament or match
SiteWhere it was played
DateStart date as YYYY.MM.DD, with ?? for unknown parts
RoundRound number within the event
WhitePlayer with the white pieces
BlackPlayer with the black pieces
Result1-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 $1
A comment in braces, a variation in parentheses, and a NAG symbol.

NAG 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.

Frequently asked questions

Is PGN the same as FEN?
No. PGN records a whole game as a list of moves; FEN records one position as a single line. A PGN can contain a FEN header if the game does not start from the standard position, but the two formats do different jobs.
How many games can one PGN file hold?
As many as you like. Games are separated by a blank line between the result of one game and the headers of the next, which is why the result terminator matters so much.
Why will my PGN not load?
The usual causes are a missing result terminator, an illegal move somewhere in the movetext, or a FEN header that does not match the position the moves are played from. A parser should tell you which move failed rather than loading a partial game.
Does PGN include the time each move took?
Not in the standard. Clocks are frequently written inside comments by the site that exported the file, but there is no structured field for per-move times, so any clock analysis derived from a PGN depends on how that particular site chose to write the comment.