I just read the description of FEN (Forsyth–Edwards Notation) and EPD (Extended Position Description), I have a basic idea of what they are, but I still have some points that are not entirely clear:

  • What are the main differences between those two?
  • When should I use one over the other one?
  • Which one is more common to see?

I am trying to decide which one to use for a personal project, and I can't take this jump without knowing everything about them.

2 Answers 2

  • What are the main differences between the two?

Extended Position Description is a standard for describing chess positions along with an extended set of structured attribute values using the ASCII (American Standard Code for Information Interchange) character set. It is intended for data and command interchange among chess playing programs. It is also intended for the representation of portable opening library repositories. The first four fields of the EPD specification are the same as the first four fields of the closely related FEN specification. Like FEN, EPD can also be used for general position description. However, unlike FEN, EPD is designed to be expandable by the addition of new operations that provide new functionality as needs arise. More information can be found at this site.

  • When should I use one over the other one?

EPD is more expandable by the additon of new operations and is more versatile and is used primarily in chess programs. See bullet point one.

  • Which one is more common to see?

Overall, I would say FEN is more common, but this is relative to what you are trying to do.

  • 1
    I agree that FEN is more common.
    – Seth
    Commented Dec 13, 2012 at 4:49

I'd like to provide some more details. I will answer "bottom up" (last bullet first).

  • FEN is indeed much more common, at least, more commonly seen by "normal users": major online chess sites (chess.com, lichess.org, ...) propose to millions of users at each moment to export the position they're looking at in the FEN format, sometimes also in other formats (including PGN which describes the whole game, as opposed to just the position, with all moves, metadata, possibly analysis with variations and annotations). You will almost never be proposed to share a position in EPD format. However, these same web sites might internally store their opening database and maybe even their entire puzzle database in the EPD format.

  • The purpose of the two is different: FEN contains just exactly the minimum information one has to know about the position to continue playing the game. EPD may contain a lot more subjective and also complementary factual information, see below. So, it depends on what you want to store.

  • As the name says, EPD is an extended position description, and it does extend the FEN format, in a slightly relaxed sense: The first four data fields (Piece placement, Side to move, Castling ability, En passant target square) are exactly the same.

    The FEN format then has exactly two more data fields: Halfmove clock, and Fullmove counter. They are specified as two integers following the ep square, and that's what the FEN string ends with. These last two data are not "rigidly" taken over in the EPD format, but implemented through EPD "Operations".

    The EPD format has a first part consisting of the above mentioned four main data fields. That part is followed by an arbitrarily long list of so-called "Operations" each of which consist of a mandatory <opcode>, followed by zero or more space separated arguments called operands, and a mandatory semicolon ;.

    The <opcode> has the form of a lowercase letter followed by at least one and at most 14 more lowercase letters and/or digits and/or underscores _. Examples include: bm (best move), ce (centipawn evaluation), c0 (primary comment), fmvn (full move number: this is the FEN's Fullmove counter), hmvc (FEN's halfmove clock), id (position identification), pv (predicted variation, i.e., continuation), v0-v9 (variation name, e.g., name of openings and their variations) etc.

    The operands may be (signed or unsigned, integer or decimal) numbers or strings (enclosed in "...") or moves in SAN (standard algebraic notation, like e4, Nbd2+ or bxc1=Q#, without quotes, and not preceded by move numbers nor '...' when it's black's move, e.g., in pv).

    It is somewhat surprising that the halfmove clock is not mandatory in the EPD format, although it is necessary to apply the 75 move rule. But we must admit that application of the 3- or 5-fold repetition would also require to know all previous positions - at least, when the last move wasn't a pawn move or capture.

So, in short, the EPD contains annotations and other, possibly subjective data, which might be of interest especially in databases for use in chess programs (Opening database; test cases for program testing, debugging and/or machine learning, etc...). The FEN is just the raw position.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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