How to Get a FEN From Chess.com, Lichess or a Real Board
FEN, short for Forsyth-Edwards Notation, is a single line of text that describes one chess position completely. Paste it into any move calculator and you get exactly the position you meant, without replaying the game.
If you mostly study your own online games, ChessHelper (chesshelper.ai) works directly on Chess.com and Lichess, so you can skip this step. For everything else, our free calculator accepts FEN in the box beside the board, and so does every serious analysis tool, including the Lichess analysis board. This guide shows where to find the FEN on the big sites, how to write one by hand for a position on a real board, and what each part of it means.
What a FEN looks like
Here is the standard starting position:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
It has six fields separated by spaces. The first and longest describes where the pieces are. The other five record whose move it is, castling rights, a possible en passant square, and two move counters. Calculators need all six to be valid, although the last two rarely change the result.
The six fields
We will use a real position: the Ruy Lopez after 1.e4 e5 2.Nf3 Nc6 3.Bb5 a6, with White to move.
r1bqkbnr/1ppp1ppp/p1n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 0 4
| Field | In this example | Meaning |
|---|---|---|
| Piece placement | r1bqkbnr/.../RNBQK2R | Ranks 8 down to 1, separated by slashes |
| Side to move | w | w for White, b for Black |
| Castling rights | KQkq | Who may still castle and on which side; - if nobody |
| En passant square | - | Square a pawn skipped over on the last move, or - |
| Halfmove clock | 0 | Moves since the last capture or pawn move (for the 50-move rule) |
| Fullmove number | 4 | Starts at 1 and goes up after each Black move |
Piece placement
Each rank is read from the a-file to the h-file. Uppercase letters are White pieces and lowercase are Black: K king, Q queen, R rook, B bishop, N knight, P pawn. A digit counts empty squares. In the example, the sixth rank p1n5 reads: Black pawn on a6, one empty square, Black knight on c6, five empty squares. Each rank has to add up to eight.
Side to move
This is the field most often wrong when people type a FEN by hand, and it changes everything. The same piece placement with b instead of w asks a completely different question, and a calculator will happily answer it.
Castling rights
K and Q mean White can still castle kingside and queenside; k and q do the same for Black. A right disappears for good once the king or that rook has moved, even if it later moves back. Castling being temporarily blocked does not remove the right.
En passant square
After a pawn moves two squares, this field names the square it passed over. After 1.e4, for example, our calculator writes:
rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1
Some tools record the square after every double pawn step, as here, and others only when an en passant capture is actually possible. Both versions describe the same position for analysis.
The two counters
The halfmove clock resets to zero after any capture or pawn move and counts up otherwise; at 100 the fifty-move rule allows a draw claim. The fullmove number is for bookkeeping. If you write a FEN by hand, 0 1 is a safe ending.
Getting the FEN from Chess.com
On the Chess.com website, open the finished game or the Analysis Board and step to the position you want. Click the Share button, choose the PGN option, and the FEN appears at the top of the window, ready to copy. That is the method Chess.com describes in its own FEN glossary page. The steps in the mobile app can differ, so the website is the reliable route.
If you want to analyze the whole game rather than one position, copy the PGN instead. PGN stores the complete move list, and many analysis boards can import it directly.
Getting the FEN from Lichess
On Lichess, open the game and go to its analysis board, or open the analysis board directly. Step to the move you want; the FEN of the current position is shown in a text field below the board and updates as you move through the game. Click into it and copy. The same field also accepts a FEN you paste, which is a quick way to move a position between tools.
Getting the FEN for a position on a real board
For a position from a club game, a book or a photo, you have two options. The first is a visual board editor: Lichess has a free one, where you drag pieces onto an empty board, set the side to move and castling rights, and copy the FEN it generates. Some apps can also read a position from a photo or screenshot. Whatever you use, check the side to move and the castling rights before you trust the result, because neither is visible in a picture.
The second option is to write it yourself, which takes about a minute once you know the pattern. Take this simple position: White king g1, rook d1, pawns f2, g2 and h2; Black king g8, pawns f7, g7 and h7. White to move.
Work down from the eighth rank. Rank 8 has six empty squares, the king, and one empty square: 6k1. Rank 7: 5ppp. Ranks 6 to 3 are empty, so each is 8. Rank 2: 5PPP. Rank 1 has three empty squares, the rook on d1, two empty squares and the king on g1: 3R2K1. Nobody can castle, there is no en passant square, and we add 0 1:
6k1/5ppp/8/8/8/8/5PPP/3R2K1 w - - 0 1
Paste that into the calculator and Stockfish returns +M1 with Rd8#, the classic back-rank mate. Black's own pawns block every escape square.
Common FEN mistakes
When a calculator rejects a FEN or gives an answer that makes no sense, the cause is nearly always one of these.
- A rank that does not add up to eight. Count pieces plus digits on every rank.
- The wrong side to move. The engine will analyze the wrong question without complaint.
- Castling rights that cannot be true. If the king is not on its original square, its castling letters must go.
- Upper and lower case mixed up.
Nis a White knight andna Black one. - Missing fields. A bare piece placement without the other five fields is not a complete FEN for most tools.
Our calculator checks every FEN before loading it and tells you what is wrong if it cannot accept it.
What to do with the FEN
Once the position is loaded, choose a depth and calculate. If the score or the suggested move surprises you, our guide to reading engine evaluations explains what the number means, and using a calculator to improve shows a routine for going through a finished game one critical position at a time.
Related guides
More on analysis tools and engines.