Notation & vision
PGN: Portable Game Notation
PGN (Portable Game Notation) is the plain-text format chess sites and programs use to save games: a few tags that say who played, where and how it ended, then the moves. Paste one below to replay it and check it, or read on to write your own.
Try it
Check a PGN
Paste a game. You get its tags in a table, the moves on a board (side lines too), and every problem explained, with the move it happens on.
Valid PGN: 17 moves, White won.
Moves
Click a move, or use the arrow keys. Side lines are in parentheses, comments in gray.
Tags
| Tag | Value | What it says |
|---|---|---|
| Event* | ParisThe tournament, match or event. | |
| Site* | Paris FRAWhere it was played: a city or a website. | |
| Date* | 1858.??.??1858 (month and day unknown). | |
| Round* | ?Unknown. | |
| White* | Morphy, PaulThe player with White. | |
| Black* | Duke Karl / Count IsouardThe player with Black. | |
| Result* | 1-0White won. | |
| ECO | C41Opening code. C covers 1. e4 e5 and the French Defense. | |
| Opening | Philidor DefenseThe opening's name. |
* One of the Seven Tag Roster, the tags every PGN should have.
Free, in your browser: nothing you paste is uploaded.
What a PGN is
A PGN is a text file, usually ending in .pgn, that holds one or more chess games. When you download a game from a chess site, export one from a database, or follow a tournament broadcast, you get PGN. Because it is plain text, any program can read it and you can read it yourself.
Every game has two parts:
- Tags at the top, one per line in square brackets: a name and a value in double quotes. They say who played, where, when and the result.
- The moves (the standard calls them movetext) after a blank line, in the algebraic notation you know from books, ending with the result.
Here is Paul Morphy's Opera Game, from Paris, 1858:
[Event "Paris"] [Site "Paris FRA"] [Date "1858.??.??"] [Round "?"] [White "Morphy, Paul"] [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-0
The format comes from a 1994 standard written by readers of the rec.games.chess newsgroup, with Steven J. Edwards as coordinator: Portable Game Notation Specification and Implementation Guide. The same document defines FEN, the one-line format for a position.
The Seven Tag Roster
The standard asks every game for seven tags, in this order. It calls them the Seven Tag Roster. When something is unknown, the value is ?, not left out.
| Tag | Example | What it holds |
|---|---|---|
Event | Paris | The tournament, match or event. |
Site | Paris FRA | Where: a city (and country code) or a website. |
Date | 1858.??.?? | Year, month, day with dots. ?? for unknown parts. |
Round | ? | The round. ? if unknown, - if not part of one. |
White | Morphy, Paul | White's name, surname first. |
Black | Duke Karl / Count Isouard | Black's name, the same way. |
Result | 1-0 | 1-0, 0-1, 1/2-1/2, or * for unknown. |
A tag line looks like [White "Morphy, Paul"]: an opening bracket, the tag name, a space, the value in double quotes and a closing bracket. A double quote inside a value is written \". Most programs open a game with missing tags, but a game without them can't say who played it.
Other common tags
After the roster a game can carry any other tags. These are the ones you'll meet most in downloads from chess sites:
| Tag | Example | What it holds |
|---|---|---|
WhiteElo, BlackElo | "1650" | The players' ratings. |
TimeControl | "180+2" | Seconds each, plus the increment: 3 minutes + 2 seconds. - for no clock. |
ECO | "C41" | The opening's code, A00 to E99. |
Opening | "Philidor Defense" | The opening's name. |
SetUp, FEN | "1", a FEN | The game starts from this position, not the usual one. |
Annotator | "Steinitz" | Who wrote the comments. |
PlyCount | "33" | Single moves (plies) in the game. |
Termination | "Time forfeit" | How it ended, when that isn't mate. |
SetUp and FEN are for games that don't start from the usual position: a puzzle, an endgame study, a Chess960 game. The FEN tag holds the starting position and SetUp "1" says to use it:
[SetUp "1"] [FEN "6k1/5ppp/8/8/8/8/5PPP/3R2K1 w - - 0 1"] 1. Rd8# 1-0
Clock times aren't tags. Online sites write them into a comment after each move, as [%clk h:mm:ss]: the time left after that move. The command comes from a 2001 supplement to the standard, and sites add others the same way, like [%eval] for a computer evaluation.
1. e4 { [%clk 0:03:00] } 1... e5 { [%clk 0:03:01] }
2. Qh5 { [%clk 0:03:00] } 2... Nc6 { [%clk 0:02:58] }Tags a program doesn't know are kept and ignored, so sites add their own (a link to the game, the players' titles, a time zone).
The moves
The moves are in Standard Algebraic Notation (SAN), the chess notation from books and score sheets:
- Move numbers come before White's move:
1. e4 e5 2. Nf3. A Black move written on its own (after a comment or a side line) gets three dots:7... Qe7. - Pieces are capital English letters: K, Q, R, B, N. Pawn moves have no letter. Squares are a small letter and a digit:
e4. - Captures have an x (
Bxf3), check a + and mate a # (Rd8#), promotion an = (e8=Q). - Castling is
O-OandO-O-Owith the capital letter O. Zeros work in many programs but not all. - The result ends the moves:
1-0,0-1,1/2-1/2or*. It must match the Result tag.
Line breaks and spaces between moves don't matter, so a game can be one long line or wrapped. The standard wraps lines under 80 characters when a program writes a file.
Comments, variations and NAGs
Annotated games add three things to the moves:
- Comments go in curly braces after the move they are about:
{Hits b7 and f7 at once.}. They can't be nested. A semicolon also starts a comment that runs to the end of the line. - Variations (side lines) go in parentheses right after the move they replace.
4... dxe5in the example below is played instead of 4... Bxf3. Variations can hold their own comments and variations. - NAGs (Numeric Annotation Glyphs) are the ! and ? marks stored as numbers after a dollar sign.
4. dxe5 Bxf3 (4... dxe5 5. Qxd8+ Kxd8 6. Nxe5 {wins a pawn})
5. Qxf3 dxe5 6. Bc4 Nf6 7. Qb3 $1 {Hits b7 and f7 at once.} 7... Qe7| NAG | Shown as | Means |
|---|---|---|
$1 | ! | good move |
$2 | ? | mistake |
$3 | !! | brilliant move |
$4 | ?? | blunder |
$5 | !? | interesting move |
$6 | ?! | dubious move |
The standard numbers them from $0 to $139, including the position signs like ± and ∞. See every chess symbol and its PGN code. Many programs also accept the marks written right after the move (Nxb5!) and turn them into NAGs when they save.
Many games in one file
A PGN file can hold any number of games, one after another. Each one starts with its own tags and ends with its result, and a blank line separates them. A tournament download is one file with every game; opening databases are files with millions.
Paste a file with several games into the box above (try Two games) and pick one from the list. The PGN viewer does the same with files you upload or drop.
How to open and save a PGN
- On Chessage, paste, upload or drop a PGN into the PGN viewer to step through it, or into game review to see every move labeled with your accuracy. The GIF maker turns it into an animation, and PGN to PDF lays it out with diagrams to print. The buttons under the box above open the game in the first three.
- On Lichess, every game page can export its PGN, and the Import game page (lichess.org/paste) loads one.
- On Chess.com, the share menu of a finished game has the PGN to copy or download, and the analysis board takes a pasted PGN.
- Desktop programs like ChessBase and SCID open and save PGN files, and can convert them to their own database formats, which are faster to search.
To save a game by hand, write it in any text editor (Notepad, TextEdit) and save it as plain text with the .pgn ending.
PGN vs FEN
| PGN | FEN | |
|---|---|---|
| Holds | A whole game: tags, moves, comments, result | One position |
| Size | Many lines, many games per file | One line |
| Use it to | Save, share and replay games | Set up a position to analyze or play from |
They work together: a PGN starts from a FEN when the SetUp and FEN tags are there, and every position in a PGN game can be written as a FEN. To read one, see what FEN is and how to check one.
Common errors and fixes
The box above catches all of these:
- An illegal move. A typo in a square, or a move left out so that the next one is for the wrong side. Programs stop reading there. Compare the move with the score sheet.
- Piece letters from another language. PGN uses K, Q, R, B and N everywhere. A German S for the knight (Springer) or a French F for the bishop (fou) won't load.
- An ambiguous move. When two knights can reach d2, write which one:
Nbd2, notNd2. - A comment or variation that never closes. One missing
}or)turns the rest of the game into a comment or a side line. - A missing or mismatched result. The moves must end with 1-0, 0-1, 1/2-1/2 or *, the same as the Result tag. Write 1/2-1/2, not ½-½.
- A tag without double quotes.
[White Smith]isn't a tag. Write[White "Smith"]. - A date with dashes. PGN dates use dots:
2026.05.01, not2026-05-01. - Two games with no tags between them. Anything after the result is ignored. Give each game its own tags.