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.

Try:

Valid PGN: 17 moves, White won.

Start

Moves

1.2.3.Pins the knight, but the bishop will have to take it.4.(4...5.6.and White wins a pawn.)5.6.7.The queen hits b7 and, with the bishop, f7.7...8.9.10.11.12.13.14.15.16.17.1-0

Click a move, or use the arrow keys. Side lines are in parentheses, comments in gray.

Tags

TagValue
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.
ECOC41Opening code. C covers 1. e4 e5 and the French Defense.
OpeningPhilidor DefenseThe opening's name.

* One of the Seven Tag Roster, the tags every PGN should have.

Make a GIF

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.

TagExampleWhat it holds
EventParisThe tournament, match or event.
SiteParis FRAWhere: a city (and country code) or a website.
Date1858.??.??Year, month, day with dots. ?? for unknown parts.
Round?The round. ? if unknown, - if not part of one.
WhiteMorphy, PaulWhite's name, surname first.
BlackDuke Karl / Count IsouardBlack's name, the same way.
Result1-01-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:

TagExampleWhat 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 FENThe 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-O and O-O-O with the capital letter O. Zeros work in many programs but not all.
  • The result ends the moves: 1-0, 0-1, 1/2-1/2 or *. It must match the Result tag.
The end of the Opera Game: the white rook on d8 mates the black king on e8, supported by the bishop on g5
17. Rd8# 1-0: the last move and the result of the Opera Game.

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... dxe5 in 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
After 4...dxe5 5. Qxd8+ Kxd8 6. Nxe5, White's knight on e5 has taken a pawn and the black king stands on d8
The side line's end, after 6. Nxe5: White is a pawn up and Black's king can no longer castle.
NAGShown asMeans
$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

PGNFEN
HoldsA whole game: tags, moves, comments, resultOne position
SizeMany lines, many games per fileOne line
Use it toSave, share and replay gamesSet 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, not Nd2.
  • 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, not 2026-05-01.
  • Two games with no tags between them. Anything after the result is ignored. Give each game its own tags.

Frequently asked questions

What does PGN stand for?

Portable Game Notation. It is the standard text format for saving chess games, written in 1994 by readers of the rec.games.chess newsgroup with Steven J. Edwards as coordinator. Almost every chess site and program reads and writes it.

How do I open a PGN file?

Paste it or drop the file into a PGN viewer, like the free one on Chessage, and step through the moves. Chess sites (Lichess, Chess.com) and desktop programs (ChessBase, SCID) open PGN files too. A PGN is plain text, so any text editor shows it as well.

What is the difference between PGN and FEN?

A PGN records a whole game: who played, the moves and the result. A FEN describes a single position on one line. A PGN can start from a FEN, with the SetUp and FEN tags, and every position in a PGN game can be written as a FEN.

Can one PGN file hold many games?

Yes. Each game starts with its own tags and ends with its result, one after the other. Tournament downloads and opening databases are single PGN files with hundreds or millions of games.

What does * mean at the end of a PGN?

The result is unknown or the game isn't over: an adjourned game, a game in progress or a position you are analyzing. The other results are 1-0 (White won), 0-1 (Black won) and 1/2-1/2 (draw).

What do $1 and $2 mean in a PGN?

They are NAGs, Numeric Annotation Glyphs: annotation symbols stored as numbers. $1 is !, $2 is ?, $3 is !!, $4 is ??, $5 is !? and $6 is ?!. PGN viewers show them as the symbols.

What is [%clk] in a PGN?

The time left on the player's clock after that move, written inside a comment: [%clk 0:02:58] is 2 minutes 58 seconds. Online sites add it to their exports, and viewers show it next to the move.

Why won't my PGN load?

Usually an illegal move (a typo or a missing move), a comment or side line that is never closed, or a tag without double quotes. Paste it into the PGN box on this page: it names the move or the line that stops it and how to fix it.

Keep practicing