Skip to content
Portable Game Notation (PGN) implementation in .NET
C# F# PowerShell
Branch: master
Clone or download
iigorr Merge pull request #17 from Yokomojamo/master
Fix BoardSetup indexer bug
Latest commit ce04637 Dec 30, 2015


Type Name Latest commit message Commit time
Failed to load latest commit information.
src Fix BoardSetup indexer bug Dec 30, 2015
test omitted piece letter implies a pawn move. closes #15 Jul 28, 2015
LICENSE added license (APL 2.0) and icon Oct 27, 2013 Update Jul 21, 2014

Portable Game Notation (PGN) implementation in .NET

About PGN

Read more about PGN on Wikipedia.

Here is an excellent spec document.

About pgn.NET

pgn.NET is a library which can be used to handle chess games and read/write them in the PGN format. It is implemented in F# and C# and uses FParsec.

To support as many .pgn file formats as possible the parsers try to be as tolerant as possible. It mostly conforms to this specs. However, other than the specification says we use UTF-8 as encoding, cause it's the 21st century.

How To Use

using ilf.pgn;
using ilf.pgn.Data;

// ...

var reader = new PgnReader();
var gameDb = reader.ReadFromFile("Tarrasch.pgn");

Game game = gameDb.Games[0];



You can download the NuGet Package or just clone, build and reference the assemblies.

NuGet package via console:

PM> Install-Package pgn.NET

NuGet package in Visual Studio:

Choose your project and open the NuGet Package Manager: vs step1

Search for "" in the online directory, then click "Install" on the package: vs step2

The project should now reference the pgn.NET assembly

How To Contribute

  1. Fork
  2. Clone
  3. Code
  4. Create Pull Request


Bugfix Release 1.1.1

Release 1.1

  • Bugfix: zero-length move text bug (IndexOutOfRange)
  • Introduce MoveTextEntryList, a MoveEntry list which provides simplifed access to moves.
  • Change type of Game.MoveText and RAVEntry.MoveText to MoveTextEntryList
  • Add missing API doc
  • Add support for frameworks: net40, net45, wp71

Release 1.0

This is the initial release of pgn.NET, a library to parse PGN chess databases which includes

You can’t perform that action at this time.