How do I add the replayer to the post initially, and what additional features can I take advantage of?

NOTE: if you have a question about why the replayer isn't working for the PGN in your post, it's better to ask a new Meta question instead of posting an answer here.


This post is a work in progress, please feel free to add or embellish...

Most of the details here come from balpha's post.


There are two basic ways to use the replayer: first, you can use the replayer to simply display a FEN position, and second, you can post a pgn game and then others can click through the moves.

The basic idea is that you post the pgn or FEN in a code block. In order to create a code block, indent the pgn or FEN by four spaces. As a shortcut, you can either click the editor's "Preformatted text" button, or press Ctrl-K.


In order to simply show a position, just post the FEN string in a code block. It will automatically be converted into a diagram.


r1br2k1/pp3ppp/2n2n2/1Bb3B1/8/2p2N2/PPP2PPP/R4RK1 w - - 1 13

r1br2k1/pp3ppp/2n2n2/1Bb3B1/8/2p2N2/PPP2PPP/R4RK1 w - - 1 13

Is converted into:


Entire Game

In order to display an entire game, you can post the entire pgn in a code block. Most chess software allows you to copy/paste the pgn from a game, but wikipedia also has a good summary if you want to just type the pgn yourself.

There is one caveat - the pgn you post must include a FEN header.

[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"]

[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"]

This was done in order to create an "opt-in" experience for the replayers (i.e. only display a replayer if you actively choose to have one), but this is open for debate.

As a shortcut, if you are starting from the start position, you can just include a blank FEN header:

[FEN ""]

[FEN ""]

Additional Features

It is possible to enter entire variations and annotations for your games as well. If you simply copy/paste a pgn file from your external program, it will usually work correctly (after you add a FEN string). In order to enter variations, you can use parentheses for the variation moves. You can enter comments in curly braces too:

1. e4 e5 2. Nf3 Nc6 (2... Nf6 {Nf6 instead of Nc6 is called the Petroff Defense})

1. e4 e5 2. Nf3 Nc6 (2... Nf6 {Nf6 instead of Nc6 is called the Petroff Defense})

Variations can be nested as well.

  • 4
    The embedded image should be replaced by a complete working example of an embedded replayer.
    – Stevoisiak
    Jul 26 '17 at 14:12
  • 1
    I am seeing blank spaces for png chess.stackexchange.com/questions/22141/… what I am doing wrong please?
    – user16971
    Jul 29 '18 at 0:13
  • Sometimes FEN doesn't work
    – user24344
    Sep 14 '20 at 4:56
  • How do you find the FEN string? Apr 19 at 20:25

Anyone got a clue why the (3rd) replayer there is not working ?

I tried fiddling a lot with it, the position looks fine (if I remove the moves, it displays fine, looks legal to me, etc.), and I retyped the moves many times, tryed to mess with the move number, to no avail. The first move in itself (11. Rc3) is not accepted, and actually ruins the display of the position.

(Or is it just me ?)

  • There was a similar bug report on meta about variations needing to start with 1... or 1. instead of 11... It could be related to that - it works fine when I test with the github code, so I'm not entirely sure.
    – Andrew Mod
    Dec 8 '12 at 17:07
  • Ok, thanks, it's fixed now (starting at move 1). It seems any move below and including 9 will work, but from 10 and up, it fails. Is there a proper place to document that ? Dec 8 '12 at 17:15

I noticed one more feature that has been missed out from your list but I have no idea how to annotate it, so will appreciate it if someone can fill the blanks in.

How can you specify which position is the current relevant one that you want the starting from. e.g. If I have imported a PGN (to include the entire game as reference) but I'm only interested in replaying the last 5 full moves, how can you jump to e.g. move 55/60 upon loading?

  • 1
    You can add a "StartPly" header to do this: [StartPly "110"] for example to start on move 55.
    – Andrew Mod
    Oct 22 '15 at 16:38

What am I doing wrong?
Why is this: Why is pawn to d3 the best move here? pair of replayers ignoring the FEN header? (Mine is the comment comparing ... Kg7 to ... f5).

  • 1
    Missing the empty newline between tag section and movetext sections. Fixed that for you.
    – Remellion
    Feb 15 '20 at 8:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .