A game as plain text
PGN stands for Portable Game Notation. It was published in 1994 by Steven J. Edwards so that chess programs could share games, and it is still what every database, website and app uses. A PGN file is ordinary text: you can open one in Notes or Notepad and read it.
Here is the Opera Game, played by Paul Morphy in Paris in 1858, as a complete PGN file:
[Event "Casual game"]
[Site "Paris FRA"]
[Date "1858.??.??"]
[Round "?"]
[White "Paul Morphy"]
[Black "Duke Karl / Count Isouard"]
[Result "1-0"]
1. e4 e5 2. Nf3 d6 3. d4 Bg4 4. dxe5 Bxf3 5. Qxf3 dxe5 6. Bc4 Nf6 7. Qb3 Qe7
8. Nc3 c6 9. Bg5 b5 10. Nxb5 cxb5 11. Bxb5+ Nbd7 12. O-O-O Rd8 13. Rxd7 Rxd7
14. Rd1 Qe6 15. Bxd7+ Nxd7 16. Qb8+ Nxb8 17. Rd8# 1-0The tags at the top
Each line in square brackets is a tag: a name, then a value in double quotes. The first seven are the Seven Tag Roster, and every game should have them, in this order:
| Tag | What it holds | In the Opera Game |
|---|---|---|
| Event | The event, or "Casual game" | Casual game |
| Site | Where it was played | Paris FRA |
| Date | Year, month, day as YYYY.MM.DD; ?? for unknown parts | 1858.??.?? |
| Round | The round, or ? if none | ? |
| White | Surname, then first name, is the convention | Paul Morphy |
| Black | The same for Black | Duke Karl / Count Isouard |
| Result | 1-0, 0-1, 1/2-1/2, or * if unfinished | 1-0 |
Other tags are optional and common: WhiteElo and BlackElo for ratings, TimeControl, ECO for the opening code, Annotator, and FEN with SetUp "1" for a game that starts from a set position.
The moves
After a blank line come the moves, in standard algebraic notation: a move number with a full stop, White's move, then Black's. Castling is written with capital letter O, as O-O and O-O-O, and promotion with an equals sign, as e8=Q. The result is repeated at the very end.
Comments and side lines
Comments go in curly brackets. Side lines go in round brackets, starting with the move they replace. Annotation symbols are written as numbers after a dollar sign, so programs can show them as glyphs:
9. Bg5 b5 $2 {Black opens lines while behind in development.}
(9... Be7 {An example side line.}) 10. Nxb5 $1| Code | Shown as | Means |
|---|---|---|
| $1 | ! | A good move |
| $2 | ? | A mistake |
| $3 | !! | A brilliant move |
| $4 | ?? | A blunder |
| $5 | !? | Interesting |
| $6 | ?! | Dubious |
Many games in one file
One file can hold any number of games, one after another, each starting with its tags. A congress bulletin or a year of online games is usually one long .pgn file. Programs read them one by one.
Opening a PGN
- On a computer, any chess database or website that has an import or analysis board will open it.
- On a phone, open the file from Files, an email or a download and choose a chess app to open it with.
- In Plyfolio, choose Add game, then Import file or Paste PGN. Every game in the file is listed before anything is added, and tags Plyfolio does not use are kept.
Written 4 November 2026. Based on the PGN standard as published by Steven J. Edwards in 1994; some programs add their own tags and comment commands, which Plyfolio keeps as they are.