ChessPuzzlePrint Free chess puzzles, tools and printables

FEN Chess Viewer and Validator

Paste a FEN and get a checklist of every rule it passes or breaks, plus a one-line verdict.

What is FEN in chess?

FEN, short for Forsyth-Edwards Notation, is a single line of text that describes one chess position: where every piece stands, whose turn it is, and which castling and en passant options remain. Chess programs, databases and diagram tools use a FEN string to pass a position from one to another. This page has a FEN viewer and validator that reads the FEN you paste in, draws the board, and checks the position against 19 rules. It is free and runs in your browser. Use it to see what a FEN looks like on a board, or when a FEN from another program is rejected and you need to know why.

Fen chess example

How to use the FEN viewer and validator

  1. Paste the FEN into the box. The checklist updates as you type.
  2. Read the verdict at the top: "Legal position", "Drawable but not legal", or "Not a FEN".
  3. Go through the rows marked ✗. Each one says what is wrong and, where it matters, which squares are involved.
  4. Look at the board. The squares named in the failing rows are marked on it.
  5. Ignore rows marked –. These could not be checked because an earlier problem, such as an unreadable placement field, makes the check meaningless. Fix the earlier problem first.
  6. Edit the FEN in the box until every row shows ✓.
  7. Click "Copy FEN" to copy the corrected string.

The checklist is the only place you need to work from. Fixing an early row often clears the rows that depend on it, so start at the top and work down.

The checks fall into two groups. The format group looks at the text itself: six fields, eight ranks, only piece letters and the digits 1 to 8, eight squares per rank, the side to move, the castling field, the en passant field and both move counters. The position group looks at the board: one king per side, kings not touching, no pawns on the first or last rank, at most 8 pawns and 16 pieces per side, and so on through the castling rights, the en passant square and whether the side that just moved left its king in check.

What is FEN in chess?

FEN (Forsyth-Edwards Notation) describes one chess position in a single line of text. Every piece, the side to move and the other key details fit into that line, so a position can be saved, shared or pasted between programs.

The first field, piece placement, lists the ranks from 8 down to 1, separated by "/". Uppercase letters are White's pieces, lowercase letters are Black's, and digits count empty squares. In the starting position the first group, rnbqkbnr, is rank 8, Black's back row: rook, knight, bishop, queen, king, bishop, knight, rook.

What are the six fields of a FEN string?

A FEN string has six fields separated by spaces: piece placement, side to move, castling rights, en passant target square, halfmove clock and fullmove number. Each field has a fixed format.

  1. Piece placement uses the rank notation described above.
  2. Side to move is w for White or b for Black.
  3. Castling rights are KQkq for all four options, or - for none. The letters must come in the order KQkq.
  4. En passant target is the square a pawn could be captured on, or - if there is none.
  5. Halfmove clock counts moves since the last capture or pawn move.
  6. Fullmove number starts at 1 and goes up by one after each Black move.

Why is my FEN invalid?

A FEN is invalid when the text breaks the format, or when the position breaks a rule of chess. The most common format problem is missing the last two fields. Add " 0 1" to the end to supply the halfmove clock and move number.

Other errors come from the position itself. A castling letter needs the king on its original square and a rook in the matching corner. An en passant square must sit on rank 6 when White is to move, or on rank 3 when Black is to move, and the halfmove clock must then be 0. The validator reports a broken format as "Not a FEN" and a broken rule as "Drawable but not legal".

What is the FEN of the starting position?

The FEN of the starting position is rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1. The pieces fill ranks 8 and 1 with pawns on ranks 7 and 2. Then w means White moves first, KQkq means all four castling rights remain, - means there is no en passant square, and the last two numbers are 0 and 1 at the start of the game.

Examples

rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1

Verdict: Legal position
✓ Six fields separated by spaces
✓ Eight ranks separated by “/”
✓ Only piece letters (KQRBNP / kqrbnp) and digits 1–8
✓ Each rank describes exactly 8 squares
✓ Side to move is “w” or “b”
✓ Castling field is “-” or letters from KQkq in that order
✓ En passant field is “-” or a square on rank 3 or 6
✓ Halfmove clock is a whole number, 0 or more
✓ Fullmove number is a whole number, 1 or more
✓ Exactly one king for each side
✓ Kings are not on neighbouring squares
✓ No pawns on rank 1 or rank 8
✓ At most 8 pawns per side
✓ At most 16 pieces per side (king and pawns included)
✓ Extra (promoted) pieces do not exceed missing pawns
✓ Castling rights match kings and rooks on their original squares
✓ En passant square fits the last move
✓ The side that just moved is not in check
✓ The side to move is in check from at most two pieces
The position after 1. e4 with the en passant square written: every check passes.
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQ1BNR w KQkq e3 0 1

Verdict: Drawable but not legal
✗ Exactly one king for each side
  White has 0 kings.
✗ Castling rights match kings and rooks on their original squares
  “K” needs the white king on e1; “Q” needs the white king on e1.
✗ En passant square fits the last move
  With White to move, Black made the last move, so the en passant square must be on rank 6, not e3.
A starting position with the white king removed and a wrong en passant square.
8♚76♞5♝4321abcd♜e♚fgh
Drawable but not legal: The king on e8 is attacked by 3 pieces (d6, e1, b5); one move can give at most a double check.

Questions and answers

What do the three verdicts mean?

"Not a FEN" means the text breaks the format, such as the wrong number of fields or a rank that does not add up to eight squares. "Drawable but not legal" means the board can be drawn, but the position breaks a rule of chess. "Legal position" means every check passed.

Why does a FEN that looks right still get rejected?

A FEN can look correct and still fail if a castling right has no rook in the corner, an en passant square does not match the last move, or the side that just moved leaves its own king in check. The validator names the rule and the squares involved, so you can see which part to change.

Does the validator accept an en passant square after every two-square pawn move?

Yes. The FEN definition records the square after every two-square pawn move, while many programs only write it when a capture is possible. The validator accepts both, as long as the square matches a pawn that could just have moved two squares.

Does a "Legal position" verdict mean the position came up in a real game?

No. It means the position passes every rule that can be checked from the position alone. Some positions pass all checks but cannot be reached from the starting position, for example because of the pawn structure. Proving that requires a retrograde analysis, which this tool does not do.

Why does the validator flag two bishops on the same colour?

Two bishops of the same colour, on squares of that colour, mean one of them was promoted from a pawn. The validator counts it as an extra piece, so the number of promoted pieces cannot exceed the number of missing pawns.

Updated