Whyknight

Back to the game › Guides

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.

The starting position in FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

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:

  1. 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.
  2. The side to move: “w” if it is White’s turn, “b” for Black.
  3. Castling rights: K and Q for White (kingside, queenside), k and q for Black; a dash if no castling is possible.
  4. The possible en passant square, or a dash.
  5. The half-move counter since the last capture or pawn move (the 50-move rule).
  6. The move number.

When to use which?

Whyknight accepts both, and can also rebuild a position from a picture of a chessboard.

Further reading (Wikipedia) : Forsyth–Edwards Notation · Portable Game Notation

Put it into practice
Analyse your own games for free: Whyknight explains every move in simple words.
Open the free analysis

Keep reading

How to read the Stockfish evaluation

Centipawns, the evaluation bar, mate scores and search depth: understand the numbers a chess engine shows.

Inaccuracy, mistake, blunder: how to judge a move

The difference between an inaccuracy, a mistake and a blunder, and how an analysis measures how much a move loses.

Chess openings: principles and six major families

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.

Improve at chess by analysing your games

A simple five-step method to get the most out of every game you play, with or without an engine.

Basic tactics: fork, pin, skewer and more

The essential tactical patterns in chess explained simply, with a method to spot them.

Basic endgames you should know

Opposition, the rule of the square, passed pawns and king and rook activity: the essential ideas of endgames.

Pawns and structure: the skeleton of the game

Doubled, isolated, backward and passed pawns: understand pawn structure and piece values to build a plan.

Fool’s Mate: the fastest checkmate in chess

Checkmate in two moves: how 1.f3 e5 2.g4 Qh4# works and why the f- and g-pawns matter for your king.

Scholar’s Mate: the four-move trap and how to stop it

How 1.e4 e5 2.Qh5 Nc6 3.Bc4 Nf6?? 4.Qxf7# works, and the one move that defends against it.

Légal’s Mate: sacrifice the queen, win with minor pieces

The classic trap 1.e4 e5 2.Nf3 d6 3.Bc4 Bg4 4.Nc3 g6?? 5.Nxe5! and the mate with 7.Nd5#.

The Elephant Trap in the Queen’s Gambit Declined

1.d4 d5 2.c4 e6 3.Nc3 Nf6 4.Bg5 Nbd7 5.cxd5 exd5?! 6.Nxd5?? Nxd5! wins a piece for Black.

The Opera Game: Morphy’s 17-move masterpiece

Paul Morphy’s famous 1858 game: fast development, a bishop and rook sacrifice, and a final checkmate with 17.Rd8#.