PGN stands for Portable Game Notation. It’s one of the standards for storing chess games and their associated data in a plain text format. It was first specified in 1993 by Steven J. Edwards.

It’s designed to be (somewhat) easy for humans to write and read, while also being capable of being parsed, generated and analyzed by computers. PGN’s design aims are:

  1. to have its details publicly available and as simple as possible,
  2. to be non-propietary to remove restrictions based on copyright,
  3. to work for a variety of programs,
  4. to be expandable and scalable,
  5. to be international/free of local conventions, and
  6. to be about as complex and long as existing formats

Although the complete specs (HTML) deal with quite complex subjects (character encoding, edge cases, a suggested directory structure…) the core syntax is quite simple. A PGN file contains:

  1. One or more tags: bracket-enclosed pairs of data specifiyng details about the match itself: event, site, date, player names, etc.
  2. The “movetext”: essentially the game moves recorded in Standard Algebraic Notation or Figurine Algebraic Notation
  3. Comments: entered either with a semicolon and through to the end of the line, or by enclosing it in curly brackets
  4. Alternatives: enclosed in parenthesis

An edited sample: the 2018 Chess World Championship Game 1


[Event "Carlsen-Caruana FIDE World Chess Championship"]
[Date "2018.11.09"]
[White "Caruana, Fabiano"]
[Black "Carlsen, Magnus"]
[Result "1/2-1/2"]
[Annotator "https://lichess.org/@/broadcaster"]

1. e4 c5 2. Nf3 Nc6  3. Bb5 g6  4. Bxc6 dxc6 5. d3 Bg7 6. h3 Nf6
7. Nc3 Nd7?! { Inaccuracy. Best move was Qc7. } (7... Qc7 8. Be3 b6 
9. a3 O-O 10. O-O Ba6 11. a4 e5 12. b3)

See also:


Bacon jamAndy’s Brevity Quest 2019 (295 words) → Tickets, money, speech