Is there a way to read a .PGN file using Stockfish engine? If there is can you please give a sample commmand? THanks

  • Especially the second answer probably answers your question as well. – BlindKungFuMaster Feb 2 '15 at 14:59
  • 1
    either you want to a) make stockfish start from a position in a pgn file b) make stockfish analyze a game from pgn file (you can do both with sw like arena or chessbase). – Fernando Gonzalez Sanchez Feb 9 '15 at 17:28
  • Looks like we have some necromancy here, but if you're on Windows one good answer is to run SCID + Stockfish. SCID handles the input for you. – Tony Ennis Dec 30 '15 at 4:07
  • I would recommend Arena Chess playwitharena.com By far, The best GUI I have come across to this day... – cascading-style Oct 18 '16 at 5:27

Stockfish is an engine that's called by apps that read PGN files, it doesn't read the PGN data itself.

There are many very good free apps that can read PGN files and analyse the games they contain using Stockfish (which is also free) and/or similar engines (mostly not free)

A lot of good free PGN reader apps that are able to call Stockfish can be downloaded and installed from SourceForge, such as

ChessX An old app but a good one

Scid The most popular app on SourceForge at the time of writing

PGN ChessBook Which comes with the requested Stockfish engine built in

If you search for "pgn" on SourceForge you should find more apps, but in my opinion these are the best ones currently available.

| improve this answer | |

No. Stockfish is an engine not GUI, it doesn't know or understand PGN. The bigger problem is why would you do that? Why would you want to use an engine on a PGN game? This is like giving a calculator you maths exam and hope it'll give out answers magically. Please rethink why you would want to do this.

| improve this answer | |
  • 2
    Stockfish can read in moves in uci-format (e2e4 etc.). Obviously it could just as well have been written in such a way, that it would be able to read in moves in pgn-format. Why is that supposed to be so absurd? – BlindKungFuMaster Feb 2 '15 at 14:34
  • 1
    @BlindKungFuMaster We need to make our terms precise. e2e4 is SAN (standard algebraic notation), you can google about it. PGN is a sequence of SANs including headers, annotation and comments etc. It's absurd to expect an engine to parse headers such as who play the game and when the game was played. – SmallChess Feb 2 '15 at 14:37
  • The question would have made more sense if we're talking about SAN but not PGN. – SmallChess Feb 2 '15 at 14:37
  • 2
    Well, to me the question is about short SAN (like in pgn) as opposed to long SAN (as in the uci move format). – BlindKungFuMaster Feb 2 '15 at 14:42
  • 2
    I deduce from his words that he wants to input the moves from a pgn into stockfish ... – BlindKungFuMaster Feb 2 '15 at 14:47

The answer is NO. The stockfish engine does not have a concept of a chessboard state. Each position should be completely described through FEN notation. If you want to make a move, you then again describe the complete position and append your moves all in one command string then press ENTER on the keyboard. The engine does not remember the current position for you.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.