
Chess Game Archive File (PGN and FEN)
PGN and FEN are used to save the chess game. Two types of file are both important role in chess game sharing and saving. But each format have a different purpose and uses.
1. PGN (Portable Game Notation)
According to Wikipedia, .pgn file was developed by Steven J. Edwards in 1993. PGN help chess programs and players can take notes, share and analysis chess games easily. PGN has quickly become popular because its simple syntax.
PGN files will save the information as :
- Event
- Site
- Date of the Game
- Round of the Game
- Player's name (White and Black)
- Result of the Game
- Elo (White and Black)
- Time Control
- Termination (Who win and reason)
- Moves in game
- Name of chess Variant (if you play that)
For example, I downloaded a PGN file from my game history in chess.com :
I opened it with Notepad :
This is what in the pgn file.
What about "Variant", many chess variant games can be saved in png like Chess960 or CrazyHouse,...... :2. FEN (Forsyth–Edwards Notation)
In 19th century, a Scottish journalist named David Forsyth has invented FEN file. FEN is different from PGN, FEN files save the pieces' position in a specific time, this type does not save the moves or any other information of the chess game.
For example, this is a FEN file (create by ChatGPT) and I opened it in Notepad :
And I paste that text in chess.com :
The result :
*Board state (rnbqkbnr/pppp1ppp/8/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R)
Each row is separated by a (/), from row 8 (top) to row 1 (bottom).
The letters represent the pieces:
K (King), Q (Queen), R (Rook), B (Bishop), N (Knight), P (Pawn).
The uppercase letters are White pieces, the lowercase letters are Black pieces.
The numbers represent the number of consecutive empty squares.
*Current move (b)
w = White moves, b = Black moves. Here, it is Black's turn to move.
*Castling right (KQkq)
K = White can castle on the kingside (with rook h1).
Q = White can castle on the queenside (with rook a1).
k = Black can castle on the kingside (with rook h8).
q = Black can castle queenside (with rook a8).
If no one has castling rights, it will be -.
*En passant capture (-)
If a pawn can be captured "en passant", that square will be shown (e.g. e3).
(-) means there is no legal en passant capture.
*Number of moves without a capture or a move (1)
Used to determine the 50-move rule (draw if no pawn or piece is captured within 50 moves).
*Number of moves in the game (2)
Counted from the start of the game, Black is about to make his second move.