What is the PGN file format?
.pgn (Portable Game Notation) is the most popular chess game data standard. .pgn files store chess match moves along with match date, location, event name, round, result of the game, and player names.
Data structure of a .pgn file
Header data in a .pgn file is formatted using bracketed tag pairs. The mandatory set - the Seven Tag Roster - covers [Event], [Site], [Date], [Round], [White], [Black], and [Result]. Player movements follow in a *movetext* section using Standard Algebraic Notation (SAN), with comments in { } braces and annotations such as ! or ?. There is no binary signature; .pgn files are identified by the opening [Event " tag.
Data saved in text format
.pgn files store information in plain text format (ASCII), and can thus be easily read by humans and programs alike. Multiple games may be concatenated into a single .pgn file, which is common for opening books and tournament databases. Related position formats include .FEN for individual board positions and .EPD for extended position descriptions.
Commonly used standard
.pgn format is commonly used for storing and sharing (including online) chess match data via platforms such as Lichess and Chess.com. .pgn files can be used for post-match and player progress analysis, engine training, and archiving tournament records.
Security & safety
RISK: LOWPGN is plain text with no executable content, so the files are inherently safe to open. The only caveats: a malformed/huge PGN could stress a poorly written parser, and as always download chess software from official sites rather than ad-laden "PGN viewer" portals. There is no macro or script capability in the format.
Format details
in a nutshellPrograms that open PGN files
Technical details
deep spec| MIME type | application/x-chess-pgn |
| File encoding | 7-bit ASCII plain text |
| File signature | No binary magic bytes; identified in practice by opening [Event "..."] bracket tag |
| File structure | Two-section layout: bracketed tag pairs (header) followed by movetext (game moves) |
| Mandatory header tags | Seven Tag Roster - [Event], [Site], [Date], [Round], [White], [Black], [Result] |
| Move notation | Standard Algebraic Notation (SAN) |
| Annotation glyphs | Numeric Annotation Glyphs (NAGs) $1-$255; common shorthand: !, ?, !!, ??, !?, ?! |
| Comment syntax | Block comments in { } braces; line comments after ; (to end of line) |
| Variation support | Recursive Analysis Variations (RAVs) encoded in nested parentheses |
| Multi-game support | Multiple complete games can be concatenated in a single .pgn file |
| Result values | Fixed vocabulary: 1-0 (White wins), 0-1 (Black wins), 1/2-1/2 (draw), * (unknown/ongoing) |
| Line length | Spec recommends ≤ 80 characters per line; LF or CRLF line endings accepted |
| Developer | Steven J. Edwards (community-developed specification) |
| Released | 1994 (PGN specification) |
| Open standard | Yes · royalty-free |
| Specification | www.thechessdrum.net |