PGN and FEN: understanding chess formats
What the PGN and FEN notations are for, how to read them and how to use them to import a game or a position.
Updated
If you want to import a game or a position into an analysis tool, you will meet two acronyms: PGN and FEN. They have different roles.
PGN: the whole game
PGN stands for Portable Game Notation. It is a text that contains the list of moves of a game, preceded by information (players, date, result, opening…). Here is a very simple example:
1. e4 e5 2. Nf3 Nc6 3. Bb5 a6
Most chess sites let you copy the PGN of a finished game. You can paste it into Whyknight to analyse each move.
FEN: a single position
FEN stands for Forsyth–Edwards Notation. It is one line of text that describes a position at a given moment, without the move history. Here is the starting position:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
Reading a FEN
A FEN has six parts separated by spaces:
- The pieces, from the eighth rank to the first, separated by “/”. Capital letters are White pieces, lowercase are Black. A digit is a number of empty squares.
- The side to move: “w” if it is White’s turn, “b” for Black.
- Castling rights: K and Q for White (kingside, queenside), k and q for Black; a dash if no castling is possible.
- The possible en passant square, or a dash.
- The half-move counter since the last capture or pawn move (the 50-move rule).
- The move number.
When to use which?
- You want to analyse a whole game: use the PGN.
- You want to study a specific position, such as a puzzle or a screenshot: use the FEN.
Whyknight accepts both, and can also rebuild a position from a picture of a chessboard.
Further reading (Wikipedia) : Forsyth–Edwards Notation · Portable Game Notation
Analyse your own games for free: Whyknight explains every move in simple words.
Open the free analysis
Keep reading
Centipawns, the evaluation bar, mate scores and search depth: understand the numbers a chess engine shows.
The difference between an inaccuracy, a mistake and a blunder, and how an analysis measures how much a move loses.
The principles to follow in the opening, then an overview of six classic openings: Italian, Ruy Lopez, Sicilian, French, Queen’s Gambit and King’s Indian.
A simple five-step method to get the most out of every game you play, with or without an engine.
The essential tactical patterns in chess explained simply, with a method to spot them.
Opposition, the rule of the square, passed pawns and king and rook activity: the essential ideas of endgames.
Doubled, isolated, backward and passed pawns: understand pawn structure and piece values to build a plan.
Checkmate in two moves: how 1.f3 e5 2.g4 Qh4# works and why the f- and g-pawns matter for your king.
How 1.e4 e5 2.Qh5 Nc6 3.Bc4 Nf6?? 4.Qxf7# works, and the one move that defends against it.
The classic trap 1.e4 e5 2.Nf3 d6 3.Bc4 Bg4 4.Nc3 g6?? 5.Nxe5! and the mate with 7.Nd5#.
1.d4 d5 2.c4 e6 3.Nc3 Nf6 4.Bg5 Nbd7 5.cxd5 exd5?! 6.Nxd5?? Nxd5! wins a piece for Black.
Paul Morphy’s famous 1858 game: fast development, a bishop and rook sacrifice, and a final checkmate with 17.Rd8#.