ToolsJuly 10, 2026·5 min read

How to Edit a PGN File (Free Tools and Manual Methods)

How to fix, annotate, or rewrite a chess PGN file — free online editors, desktop apps, and how to hand-edit the text when a tool is not worth it.


Sometimes you do not want to just analyze a PGN — you want to change it: fix a wrong tag, add annotations, delete a few moves, or merge two files. Because PGN is plain text, editing one needs less than you might think. Here are the options, from lightest to heaviest.

Option 1: Edit it as plain text

For small fixes — a wrong name, a typo’d date, a missing result — any text editor works. PGN’s tag format is simple enough to hand-edit safely: [White "Wrong Name"] becomes [White "Correct Name"] with nothing else to break. The one rule to respect is the movetext syntax itself: keep move numbers, algebraic notation, and matched braces/parentheses if the file has comments or variations. See our PGN format guide for the full syntax if you are unsure.

Option 2: A chessboard-based online editor

For anything beyond simple text fixes — adding a variation, reordering moves, or building a game from scratch by clicking pieces on a board — a board-based editor is faster and safer than typing SAN by hand, since it will not let you enter an illegal move. Most let you load an existing PGN, click through it, branch off with a variation at any point, add a comment, and export the result. Lichess’s study feature is a strong free option for this if you also want to share the result publicly.

Option 3: A desktop PGN manager

If you are maintaining a large personal database — years of your own games, or a curated opening repertoire — a dedicated desktop application (the category historically associated with tools like ChessBase and its free alternatives) is worth the setup. These handle bulk operations text editing cannot: searching across thousands of games, merging databases, deduplicating games, and batch-renaming tags. Overkill for editing one file, essential for managing thousands.

What actually needs an editor vs. what does not

  • Fixing a header — plain text is fastest.
  • Adding a comment or variation — a board-based editor is safer than hand-typing braces and parentheses correctly.
  • Trimming a game to a specific position — delete everything in the movetext after the move number you want to stop at, then add the correct result tag (* for unfinished).
  • Combining games into one file — plain text again: paste one full tagged game block directly after another.

A common gotcha: encoding and move numbering

Two things silently break more edited PGNs than anything else. First, special characters in player names (accents, non-Latin scripts) need the file saved as UTF-8, or they render as garbage in some parsers. Second, if you delete moves from the middle of a game by hand, remember that Black’s move number depends on White’s — deleting one full move (a White move and its Black reply) keeps everything aligned; deleting only one side’s move does not, and the file will no longer represent a legal game.

After editing, verify it

The fastest sanity check for any edited PGN is to load it somewhere that plays through the moves and shows you the resulting position. Paste the file into Chesslume and if it loads and plays through cleanly, your edit is syntactically valid — and you get a free Stockfish analysis of the result as a bonus.

Analyze your own games free

Import from Chess.com or Lichess — unlimited, no signup, powered by Stockfish.

Try Chesslume