Chessboard maker

Draw a chess position from a FEN string. Click a square to place or remove a piece, set whose move it is, and get a clean board diagram to drop inline in your document.

FEN chess position syntax

A board is written as a single FEN string — Forsyth–Edwards Notation, the standard way to record a chess position. The editor saves just that FEN line. You may put the word chess on its own line first if you like; it is optional and ignored.

The starting position

A FEN has six space-separated fields: piece placement, side to move, castling rights, en passant target, halfmove clock and fullmove number. The full starting position is below.

You write
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
You get

Piece placement

The first field lists the eight ranks from rank 8 (top) down to rank 1, separated by /. In each rank a letter is a piece and a digit is that many empty squares. Uppercase letters are white pieces, lowercase are black: K king, Q queen, R rook, B bishop, N knight, P pawn. The example below shows a lone white king on e1 and a black king on e8.

You write
4k3/8/8/8/8/8/8/4K3 w - - 0 1
You get

A real position

The w or b after the placement is the side to move; it is shown under the board. The remaining fields (castling, en passant, clocks) are kept exactly as you write them so your FEN round-trips unchanged. Here is the position after 1.e4 c5 2.Nf3.

You write
rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2
You get

Cheat sheet

Write this You get
rank/rank/…/rankEight ranks, rank 8 first, separated by slashes
K Q R B N PA white king, queen, rook, bishop, knight, pawn
k q r b n pThe same pieces in black (lowercase)
18That many empty squares in a rank
w / bWhite or Black to move (second field)
KQkq - 0 1Castling, en passant, halfmove and fullmove fields (kept verbatim)