How-to: PGN Editor

What is a PGN Editor Chess Tool?

A PGN Editor is a software application used to create and edit text files containing information about chess and chess960 games formatted using the Portable Game Notation standard.

What can I use it for?

You can use it to format and annotate the moves and details of a chess or chess960 game and make that game available for others to view.

Example:
One of our favorite Caissa members, AgentSmith, recently played a game at his local chess club. In the game, AgentSmith utilized a discovered attack to force his opponent to resign after only a few moves. AgentSmith was so excited about his brilliant chess play that he had to share it with his fellow Caissans. He logged on to Caissa's Web and headed straight for the PGN Editor Chess Tool.

How does the PGN Editor provided by Caissa's Web work?

The Caissa PGN Editor Chess Tool is a web-based software application that can be accessed from any web browser. It uses a familiar "Wizard" approach to creating and editing PGN files. Each stage of the process is broken down into a step-by-step procedure. Users can step through the processes in order, or go back and forth between any of the steps. Upon completion, users can save (output) the PGN file in an easily viewable format. The exact steps for creating a PGN file using the PGN Editor Chess Tool are: 1) Set Up/Import Game/Position, 2) Enter/Edit Chess Moves & Commentary, 3) Enter Chess Game Info, 4) Output the PGN File. A detailed explanation for each of these steps is below.

Step 1: Set Up Position

PGN Editor Step 1 PGN Editor Step 1

You must first decide if you are going to create a PGN file from scratch or import an existing PGN file. If you are importing a PGN file, choose "Import PGN file". If you are starting from scratch, you can choose either "Import FEN String" or "Manually Enter Position."

  • Import PGN File

    By choosing this option you can open a PGN file on your local computer using a text editor, copy the text of the PGN file, paste the text into the PGN Editor text box, and then choose "Import." The game moves are now entered and you can proceed to Step 2: Game moves.

  • Import FEN string

    You can import a FEN (Forsyth-Edwards Notation) string to represent the initial board position. You will be prompted to enter the string into a text field. You can copy the text string or enter it manually. The initial board position is now set and you can proceed to Step 2: Game Moves.

  • Manually Enter Position

    This option offers a graphical board with which you can easily set up an initial board position by dragging and placing pieces on the board. The standard chess board position is set up by default. If you want to start from the first move, this step is complete and you can proceed to Step 2.

    If you want your game to start from a position other than the standard one, you have several ways to do this. First, you can click-and-drag pieces around the board. To remove a piece, simply drag it off the board.

    Alternatively, you can choose Clear Board and then drag-and-drop the piece icons located in the Edit Board Position box onto the blank board. You can always go back to the default position by choosing Set Standard Position.

    If you are editing a Chess960 game, there are two ways to set up a starting position. First, you can enter a Chess960 SPID (Starting Position Identifier) and choose Set. The position will appear on the board. Alternatively, you can clear the board and then drag-and-drop the white pieces into their chosen Chess960 position. You can then choose to Make black pieces mirror white and you are done.

    Finally, you will want to configure the corresponding move list to match the initial board position. In the First Move box, you should specify which move number the initial board position represents. Also, specify if the first move is by the White or Black pieces.

    You have now completed manual entry of the initial board position. You will now proceed to Step 2 and enter chess moves and commentary to your PGN file.

Example cont'd:
AgentSmith has navigated to the PGN Editor Chess Tool screen. He wants to create a PGN file for an OTB (over-the-board) chess game. Thus he does not have an existing PGN file to import. He wants to start from scratch by setting up the initial board position and then manually enter the moves. He chooses "Manually Enter Moves". He wants to show all moves of the game from first to last. Therefore he does not change the default standard board position and chooses "Next" to go to Step 2.

Step 2: Game Moves

A PGN file cannot exist without chess moves. The part of the PGN file containing the move information is called the movetext. In most cases the PGN file will contain all the moves in a chess game—the first move, the last move, and all moves in between. However, depending on the purpose of the PGN file, any number or combination of moves may be featured. For instance, you may want to focus on one series of moves in the middle of the game that spotlights a particularly great strategy. Similarly, you may want to focus on several groups of moves from one game, for instance moves 3 thru 5, then 12 thru 14, and finally 23 thru 28. In addition to the actual moves and move numbers, the movetext portion of the PGN file may also contain commentary and annotations, and will always include a terminating game result. The PGN Editor Tool provided by Caissa's Web allows for creation and editing of all PGN file movetext features.

The procedure for Step 2 depends on how you set up the game in Step 1. If you chose to manually enter the moves or you entered a FEN string, you must first manually enter the moves associated with the starting position you set up. If you imported a PGN file, the moves are already entered and you can begin editing the moves (see below).

PGN Editor Step 2
  • Manually enter moves

    To manually enter the moves, simply click-and-drag a piece on the board to make the move. You should follow the exact sequence of the moves you want to enter, alternating between black and white moves. The move list will update with the moves. Note that the move-making function follows the basic rules of chess moves—you must alternate between white and black moves and you must make legal moves. You can use the playback buttons to click through moves you have already made.

    Now that you have added the moves, let's edit the moves. For the purposes of this document, we will assume you will first enter all the moves and then go back and add comments/annotations. You can of course add these as you enter each move.

  • Editing moves

    To edit a move, use the playback buttons to select a move for editing. You can also click directly on a move in the list to make it current. The current move selected can be identified in the move list as having a background that highlights the move. The options for editing individual moves are as follows.

    Use the text field below the board to add Comments/Annotations. This is a free-form text area that can be used for general comments about the move. More formal annotations can also be added. Comments/annotations are entered into the raw PGN file adjacent to the move to which they are applied, and are enclosed in {curly braces}.

    You can add move Evaluation symbols (?? - blunder, ! - Good move, etc.) from the corresponding drop-down list. You can Delete individual moves from the PGN file using the Delete [move#] link.

    You can Set display focus for the current move. This is a feature specific to the PGN Editor Chess Tool. When you set the display focus to the current move, the move listing will become Bold. Only one move in a PGN file can have the display focus. The display focus means that when the game is viewed in a game viewer, the move with the display focus will appear first. So if white's 15th move has the display focus, when someone views the game, that move will appear immediately when the game comes up for viewing. The viewer can then use the playback buttons to move forward and back through the moves. The display focus is useful if you want to spotlight an individual move but still have the rest of the game available for context.

We have completed Step 2 by adding and editing moves. Let's go on to Step 3.

Example cont'd:
AgentSmith is ready to manually enter moves into his newly created PGN file. He documented the moves and game info of the original OTB game on a chess score sheet. He begins making moves on the PGN editor chess board corresponding to the handwritten moves on the score sheet. They are: 1 e4 e6 2.d4 d5 3.e5 c5 4.c3 cxd4 5.cxd4 Qb6 6.Bd3 Qxd4 7.Bb5+ Bd7 8.Bxd7+ Kxd7 9.Qxd4 and Black resigns. Finished entering the moves, AgentSmith is ready to add comment and annotation. Obviously, Black's troubles began with 6...Qxd4. AgentSmith uses the playback buttons to click back through the moves and make this the current move. He types in the following comment, "Blunder of the century! This is a well-known trap associated with the Advance Variation of the French Defense. How did he not know about it?" Using the Evaluation drop down list, he tags the move with "??". He wants viewers of the game to start from the first move so he does not change the Display Focus. He wants all moves to be included so does not delete any. Done. On to Step 3.

Step 3: Game Info

In addition to the movetext which documents the actual moves of a chess game, PGN files also contain information about the game itself such as who played in the game, its location and date, and what event sponsored it. These individual pieces of information are called tags. In Step 3, the PGN Editor Chess Tool allows you to add this information if you created the PGN file from scratch. If you imported an existing PGN file, this information should already be entered. In this case, you may review and edit the tags as necessary. A description of the information that can be added to your PGN file follows.

PGN Editor Step 3

The most basic information or tags for a PGN file are: Name of the player of the white pieces, name of the player of the black pieces, the event sponsoring the game, the date, the site where the game took place, the playing round of the game within the event, and the result. These tags are known as the STR or Seven Tag Roster. Additionally, the PGN Editor Chess Tool provides two additional tags: the ratings of both players.

To add or edit any of these tags, simply type in the associated text fields. For the result, choose one of three options from the drop-down list: 1-0 (White wins), 0-1 (Black wins), or ½-½ (Draw).

Also in Step 3, The PGN Editor Chess Tool provides Special Viewer Options related to the presentation of the PGN file when it is viewed. They are as follows:

  • Orientation

    This refers to the top-to-bottom orientation of the board and pieces. The standard orientation is to have the white pieces at the bottom. You can also have the board presented from the perspective of the black pieces by choosing the "Black" radio button.

  • Jump to End of Game

    Choosing this option will cause anyone viewing the game to see the last move first (the Display Focus is always on the last move). An example for this would be an ongoing chess lecture in which you review a game by adding a new move and commentary every day. You want returning viewers to start with the last move and commentary, rather than starting with the first move and having to click through to the latest move and commentary.

  • Hide Move Text in Viewer

    If you are creating your PGN file in the form of a chess puzzle, e.g. "Here's the board position—what's the best move?", you can choose this option so the move list is blank. That way the viewer can ponder the possible moves without seeing the actual moves in the move list.

Now that the game info has been added to the moves, comments and annotations, the PGN file is complete. In the final Step 4 we will use the PGN Editor to output the PGN file in various human and machine-readable formats.

Example cont'd:
AgentSmith is ready to add some game info from the handwritten notes on his chess score sheet. For the Event he enters "Ninth Rank Chess Club Meeting." For the site he types "Parkdale Mall." For White he types "AgentSmith." For Black he types "Anonymous Duffer." He types in the date, skips the Round as this doesn't apply, and enters the result as a win for white (1-0). He wants to keep the board orientation with white on the bottom so he keeps the radio button as "White." He wants anyone viewing the game to start with the first move and click through to the end so he does not check the "Jump to the end of game" option. This is not a chess puzzle so he does not check the "Hide text in Viewer" option. AgentSmith has completed the PGN file documenting his resounding victory and is now ready to output the file to show off to his fellow Caissans.

Step 4: Output

The creation/editing of your PGN file is complete. Great! Now what do you do with it? In general you want to save it or "output" it. There are several things to consider when outputting a PGN file. Do you want to archive the file for later review? Or do you want to make it easily and immediately viewable? If viewable, do you want it to be "viewable" by both humans and computers? The output options for your PGN file are described below.

PGN Editor Step 4
  • Finished PGN

    Most of the screen for Step 4 is made up of the raw PGN text file itself. You can review the information for any changes/additions. If you need to make changes, use the "Back" button to go back to the appropriate Step. You can also use the handy tabs along the top of the window to jump directly to a Step. You can also highlight the PGN file text in this area for purposes of copy-and-paste.

  • Preview

    This is not really an output option in itself, rather it gives you a preview of what the output will look like. Specifically, what it would look like if you used the Caissa's Web Chess Game Viewer to view the game.

  • Copy to Clipboard

    Pressing this button will automatically copy the PGN file text to your computer's clipboard. You can then paste the text into various applications or files. For instance, if you want to immediately view the game, you can paste the PGN file text into the Caissa's Web Chess Game Viewer or any other third-party PGN viewer. If you want to save the game for later review you can create a new text file on your computer, paste in the PGN file text and save the file (usually with a ".pgn" extension).

  • Animated GIF

    Another great feature of the PGN Editor Chess Tool is the ability to output a PGN file as an animated graphic file (GIF format). This uses the Caissa's Web Chess Diagram Generator. The result of this output option is a single graphics file, e.g. "mygame.gif." When viewing the file, you will see the board and pieces and the moves being made. The file can then be embedded in bulletin boards or blog posts, or emailed to friends.

  • Embed

    The most effective way to make the game viewable by humans is to embed a Chess Game Viewer with this game into a web-enabled document. Anyone viewing the document will be presented with a chess board and the ability to play through the moves. Simply copy-and-paste the code provided into documents such as blogs and web pages. And don't forget the Caissa Bulletin Boards!

So there you have it. We have reviewed how to create and edit a PGN file and then output the file in human and computer readable formats. There is only one more step left.

Start using the PGN Editor Chess Tool!

Example cont'd:

AgentSmith is ready to output the file so his fellow Caissans can marvel at his chess prowess. But he does not limit himself to just one output format. He outputs the game using all of them! They are listed below.

Raw PGN Text File:

[Event "Ninth Rank Chess Club Meeting"]
[Site "Parkdale Mall"]
[Date "2008.6.19"]
[Round "?"]
[White "AgentSmith"]
[Black "Anonymous Duffer"]
[Result "1-0"]
[WhiteELO "?"]
[BlackELO "?"]

1. e4 e6 2. d4 d5 3. e5 c5 4. c3 cxd4 5. cxd4 Qb6 6. Bd3 Qxd4?? {Blunder of
the century!  This is a well-known trap associated withe Advance Variation of
the French Defense.How did he not know about it?} 7. Bb5+ Bd7 8. Bxd7+ Kxd7
9. Qxd4 1-0

Animated GIF:

Animated Chess Diagram

Embedded Game Viewer:

Share Caissa Share
 This Page
Facebook Bookmark del.icio.us Bookmark StumbleUpon Bookmark Google Bookmark
Sign Up for Free Online Chess
Click here for FREE Sign Up
About Caissa's Web
Who is Caissa? Contact Us Site Map Terms & Conditions Privacy Policy