Home Blog Portable Chess Game Notation (PGN): Complete Guide

Portable Chess Game Notation (PGN): Complete Guide

by Chessmad


Portable Chess Game Notation (PGN): Complete Guide

Portable Chess Game Notation (PGN): Have you ever heard of Steven James Edwards? His name is not so famous in the chess world, but his contribution is valuable. Thanks to him, we can appreciate the beauty of chess games and edit them with ease in different computer databases. He introduced to the community the Portable Game Notation (PGN) Standard in 1993. In this article, we will discuss why it was so important and how you could benefit from that invention.

In the modern world, we often tend to take certain things for granted. Imagine, for example, if there was no chess notation. Chess players would have had a hard time discussing chess. “I wanted to push my pawn that stood near his bishop one square ahead, but I thought he would move his queen and place it in front of my king’s knight.”  It is quite hard to understand what moves someone could refer to like that. Many people indeed use this way of describing their games, but knowing the notation makes things much easier. This gets even more important when it comes to writing books and publishing chess games. Humanity solved this issue a long time ago: in 1737, Philipp Stamma wrote a chess book with the algebraic notation.

Portable Chess Game Notation – A bit of history

In the 1990s, chess players started using computers more and more often. It was helpful not only for analyzing chess moves but also, to ease the process of searching for games. In the pre-computer era, chess players would travel to the tournament with big bags full of chess books and magazines. It got to be much more convenient to bring only a computer or a laptop with them to the tournaments.

What did Kasparov have to do with it?

The first computer chess database was presented in 1987: it was ChessBase 1.0. The story of its creation is exciting and inspirational. It was none other than the great chess champion Garry Kasparov who had encouraged its launch and development.

Portable Chess Game Notation PGN

Garry had a lot of ideas on how computers could be useful for chess players. In 1985, he shared the idea of creating a chess database with his friend Frederic Friedel, the future co-founder of ChessBase. Frederic was not a programmer, so he couldn’t create it all by himself. Different companies had contacted him offering their service for that, but there were no results until he met a German programmer Matthias Feist. Matthias went to Friendel and handed him a diskette, asking to have a look. It turned out that he made Garry’s idea come true.

Taking chess databases to the next level

In 1986, Frederic and Matthias went to Basel to present the prototype to Garry Kasparov. According to Frederic, astounded Garry said: “This is the most important development in chess study since Gutenberg.” Later, Garry Kasparov put a lot of effort into taking chess databases to the next level and making them accessible.

garry kasparov

Of course, ChessBase was not the only company to build databases. Besides, the Dutch “New In Chess” made NICBase. In 1993, the same developers, Hans and Nico Kuijf, came up with TascBase.

Every kind of software would use its own format for storing games. The users would often have issues with compatibility and transferring played games from one program to another. Moreover, back then, not every chess format allowed saving annotations. The community of computer and chess enthusiasts tried to find a format that would be convenient to use for everyone regardless of the software. The solution had to be non-proprietary to be more flexible and not dependent on the vendor.

This is when in 1993, Steven J. Edwards devised PGN. It took time for the community to appreciate the pros of this format, but eventually, it has become the most popular way of storing chess games. In addition, every serious chess program supports it nowadays.

Portable Chess Game Notation – The Week In Chess

In 1994, information scientist Mark Crowther started using the PGN format for posting important games that he had collected from different newspapers and magazines. He kept doing that every week, and this is how The Week In Chess got started. This famous project has been live for almost 30 years now. Also, all sorts of chess professionals widely use it.

This is what the first game published by Mark looked like:

Portable Chess Game Notation PGN

You can look at the game in the viewer below (thanks to it being in PGN!):

If you go to theweekinchess.com you can find a lot of old and new games. With its weekly updates, you can keep up with the new developments in the chess world.

How do you open PGN?

As we mentioned before, nearly any chess application supports PGN. The most popular software for working with chess databases is still ChessBase. It is a powerful tool for chess professionals. If you don’t need all the functions ChessBase provides for its users, you can get the ChessBase Reader for free. Another professional tool of that kind is the Russian ChessAssistant.

There are also many free options, for example:

Chess.com and lichess.org also provide their users with the tools for opening, sharing, and editing PGNs. It even allows the creation of GIF animations from the PGN-file of any game you have played.

Portable Chess Game Notation PGN

The structure of Portable Chess Game Notation (PGN)

A PGN-file is basically a text file that a person or software writes in a certain way. It consists of two main parts: the game data and the text with the moves. The first part must include 7 tags: event, site, date, round, white, black, and result. There can also be additional tags to give the information of the annotator, time format, and things like that. The moves are written with the use of an algebraic chess notation.

You can see a sample PGN given in the specification by Steven J. Edwards:

a sample by Steven J. Edwards

The tags have to be opened and closed with square brackets; the tag’s name has to be written after the first bracket; then, the tag’s value within quotation marks has to follow it. It is also possible to add variations; you should use round brackets for that. To add annotations to the moves, you should use curly brackets.

This is how the move text part could look with annotations:

1. e4 e5 {A surprising move. I didn’t expect this from my opponent.} 2. Nf3 Nc6 3. Bb5 a6 {Here I was thinking about taking on c6, but eventually decided to preserve my bishop.} 4. Ba4 ({Usually, I play} 4.Bxc6) 4…Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O {etc.}

Forsyth-Edwards Notation

You can also use PGN for games that start from a certain position. This is helpful for recording games played in Chess960, puzzles, endgame positions, and many other important things. To specify the starting position, you should use the Forsyth-Edwards Notation (FEN) tag. At first glance, FEN looks like a string of random symbols, but it is actually not that hard to understand. Let’s have a look:

[FEN “rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq – 0 1”]

White pieces are described with the lower case, whereas the upper case is used for Black pieces. Forwarding slashes divide 8 intervals. Each of the intervals consists of the information about the pieces standing in the respective rank of the chess board. The pieces are referred to starting from the a-file. If there are squares free of pieces, they are referred to with a number.

In the FEN above, you can see that the first rank is filled with White’s pieces, and the second rank is full of White’s pawns. The following ranks have 8 free squares. The last two ranks are filled with Black pawns and pieces. The following symbols show which side’s turn it is, what are the castling rights, are there any possible en-passant moves, and what is the moves number count. The changes in the FEN address any changes on the board. For example, this is how the FEN will look like after White’s 1.e4:

rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1

Portable Chess Game Notation – Conclusion

The goal of the PGN format was to make different computer programs have a common way of recording chess games. In fact, the format’s specification starts with a Bible quote from the Tower of Babel story; it seems like Steven James Edwards saw PGN as a universal language that could help computers understand each other.

Nowadays, PGN is the main format for recording games and is convenient for both people and computers. Its existence made it much simpler for chess enthusiasts to work with the databases, share the beauty of the game, and study it more.

We also recommend reviewing TheChessWorld Academy

Credits:

Images are taken from ChessBase.



Related Articles