FEN Generator (Chess Position to FEN)
Turn a chess position into a FEN string: type the board or a piece list, set side to move, castling and en passant, and check the position for errors.
FEN (Forsyth–Edwards Notation) describes a whole chess position in one line of text, which is what chess engines, analysis boards and puzzle tools expect when you want to set up a specific position. Type the board row by row or list the pieces, set whose move it is, castling rights and en passant, and this generator writes the FEN and checks it for common mistakes.
How to use this tool
- Type the position as 8 rows (rank 8 first) or as a piece list such as White: Kg1 Rf1, Black: Kg8.
- Choose the side to move.
- Tick the castling rights that still exist and add an en passant square if a pawn just moved two squares.
- Set the halfmove clock and move number, then copy the FEN.
Formula
FEN = placement side castling en-passant halfmove fullmove
Placement lists ranks 8 to 1 separated by "/", with uppercase letters for White, lowercase for Black and digits for runs of empty squares. Side is w or b, castling is any of KQkq or "-", en passant is the skipped square or "-", the halfmove clock counts individual player moves (plies) since the last capture or pawn move, and the fullmove number rises after each Black move.
Example
After 1.e4 the white pawn stands on e4, Black is to move and e3 is the en passant square, so the generator gives rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1. Rank 4 reads "4P3": four empty squares, the pawn, three empty squares.
Frequently asked questions
Where do I paste a FEN?
Most analysis boards have a "Load FEN" or "Paste FEN" option, and chess engines accept it through their position command. The FEN sets up the board exactly, including whose move it is.
Should I include an en passant square if no capture is possible?
Standard FEN records the square after every two-square pawn move, whether or not a pawn can capture there. Some programs only write it when a capture is possible; both are accepted by most tools.
What does the check flag?
Missing or extra kings, pawns on the first or last rank, too many pawns or pieces, castling rights without the king and rook on their home squares, an en passant square that does not match the board, and the side not to move being in check.
Sources
Last updated: 2026-10-30