Tools

PGN Files: How to Read, Create, and Share Chess Games

PGN, or Portable Game Notation, is a plain-text format for storing chess games. A PGN record combines tag pairs such as player names and result with algebraic movetext, comments, and optional variations. It can be read by people and imported by most chess software.

PGN Files: How to Read, Create, and Share Chess Games

This guide is part of the chess tools collection. Pair a clean PGN export with the game analysis checklist to preserve both the moves and the reasoning behind critical decisions.

The two parts of a PGN game

A PGN record contains:

  1. tag pairs in square brackets; and
  2. movetext containing numbered moves and the result.

Example:

[Event "Training Game"]
[Site "Online"]
[Date "2026.07.16"]
[Round "1"]
[White "Player A"]
[Black "Player B"]
[Result "1-0"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 1-0

The blank line between tags and movetext improves compatibility and readability.

The Seven Tag Roster

The standard roster is:

  • Event — tournament or game name;
  • Site — location or platform;
  • Date — normally YYYY.MM.DD;
  • Round — round identifier;
  • White — White player;
  • Black — Black player; and
  • Result1-0, 0-1, 1/2-1/2, or *.

Additional tags may store ratings, opening codes, time controls, termination, annotator, or other metadata. Software support varies.

Movetext uses algebraic notation

Moves such as e4, Nf3, Bxc6, O-O, and e8=Q follow algebraic notation. Move numbers organize White and Black turns.

The final result token in movetext should match the Result tag. Learn the move symbols in algebraic chess notation.

Comments

Curly braces store comments:

12. d5 {White closes the center and gains queenside space.}

A semicolon can introduce a line comment in some PGN contexts. Curly braces are clearer for portable annotations.

Useful comments explain:

  • the threat;
  • candidate moves;
  • pawn structure;
  • clock time;
  • evaluation in words; and
  • the lesson from an error.

Avoid filling the file with unexplained engine numbers.

Variations

Parentheses store alternative lines:

10. Re1 (10. d4 exd4 11. cxd4) 10...O-O

Variations can be nested, but deep nesting becomes hard to read. Keep the main instructional alternative and remove branches that do not explain a decision.

Annotation glyphs and NAGs

Human-readable symbols include !, ?, !?, and ?!. Numeric Annotation Glyphs use codes such as $1 for a good move in software-oriented PGN.

Applications may render the same glyph differently. Use comments when the reason matters.

Starting from a custom position

A game that begins outside the standard initial position uses setup tags:

[SetUp "1"]
[FEN "8/8/8/4k3/8/4K3/4P3/8 w - - 0 1"]

The FEN must contain all six fields and the movetext must be legal from that position. Read the FEN position guide before creating custom-start PGNs.

PGN versus FEN

  • PGN stores a game, moves, metadata, comments, and variations.
  • FEN stores one position snapshot and limited state.

Use PGN for review and replay. Use FEN when sharing a single puzzle or analysis position.

Importing a PGN safely

Before import:

  1. confirm the file is plain text;
  2. inspect tags for private information;
  3. verify the result matches;
  4. validate move legality;
  5. check custom FEN setup;
  6. preserve the original file; and
  7. note whether the destination app supports comments and variations.

A parser may reject one malformed game while other games in the file remain valid.

Common syntax problems

  • Missing quote or closing bracket in a tag.
  • Result tag and final movetext result disagree.
  • Illegal or ambiguous algebraic move.
  • Unbalanced comment braces or variation parentheses.
  • Custom position without SetUp "1".
  • Incomplete FEN.
  • Nonstandard character encoding.
  • Multiple games without clear separation.

Validate after editing by hand.

Sharing and privacy

PGN tags can reveal names, usernames, event locations, dates, ratings, and annotations. Before publishing:

  • remove personal data not needed for analysis;
  • obtain permission for private comments;
  • avoid exposing a child's identity or schedule;
  • check platform terms for game-data reuse; and
  • preserve attribution when required.

Plain text is easy to copy, which makes privacy review especially important.

A useful annotation workflow

  1. Export the original game.
  2. Add thoughts without an engine.
  3. Mark critical positions.
  4. Add one or two candidate variations.
  5. Verify with an engine.
  6. Replace raw evaluations with explanations.
  7. Save a new annotated copy.

Keep the original untouched so move history and metadata can be recovered.

Frequently asked questions

Can one PGN file contain multiple games?

Yes. Games are stored as consecutive PGN records, each with its own tags and movetext.

Is PGN a video or board image?

No. It is text. Chess software reconstructs the board from the moves.

Can PGN store analysis variations?

Yes. Parentheses contain recursive annotation variations, and braces contain comments.

Why will my PGN not import?

Check tag quotes, result consistency, balanced braces and parentheses, legal notation, and any custom FEN.

Specification reference: Portable Game Notation Specification.

Help shape the 1chess.online pilot

What are you interested in?
What else would you like to see? (optional)