LGS Record Tool

← Back to the guide

What SGF is: the format of a record file

The moment a record is saved, the stones on the board become text you can copy, paste and send to somebody else. That text uses SGF (Smart Game Format), a format settled around 1990 and now the common currency for passing Go records between programs. Nearly every board program reads it and writes it.

Here is a piece lgs.tw actually wrote (this is what the download button on a record page gives you):

(;GM[1]FF[4]SZ[19]EV[Nineteenth Meijin Challenge]PB[Lai Chun-fu]PW[Hsu Hao-hung]BR[9d]WR[9d]RE[B+R]DT[2026-11-03]KM[6.5]RU[Chinese];B[qd];W[dd];B[pp]C[The opening move, a small approach in the upper right.])

The whole string has three ingredients: tags in square brackets, semicolons, and the closing parenthesis. What comes before the first semicolon describes the game; every semicolon after that starts one move.

The first part: what kind of game this is

GM[1]
The kind of game. 1 is Go, 2 is chess.
FF[4]
The version of the file format. 4 is the one in general use.
SZ[19]
The size of the board. 13 and 19 are the usual ones.
EV
The name of the tournament.
PB / PW
The names of Black and White. BR / WR are their ranks.
RE
The result. B+R means Black won on moves; W+time means White won on time.
DT
The date of the game.
KM[6.5]
The komi. Both 6.5 points and 3.75 stones are in use.
RU
The rules: Chinese, Japanese, AGA and so on.
PL
Who is to play: B or W.
HA[2]
How many handicap stones.
AB / AW
Stones placed before the first move. AB is Black, AW is White.

Coordinates: a letter and a number

A move is written with two characters: the column in lowercase letters counting from a to the right, and the row in numbers counting from 1 downwards. So aa is the top left corner, dd is the fourth column and fourth row, and qd is the seventeenth column, fourth row. A 19 by 19 board uses letters up to t.

One thing that trips people up: SGF does not skip the letter i. Go books and Go boards skip I so it cannot be confused with the digit 1, but SGF has no such habit and ia is an ordinary point.

Note also that the rows count from the top, so d is the fourth row and not the fourth from the bottom. Go records are usually numbered from the bottom, so keep this in mind when you read an SGF written by somebody else.

What one move looks like

A move is a semicolon, then B or W for the colour, then the point, and then a comment if there is one. Comments go in C, and Chinese in them is perfectly fine.

;B[qd]                  Black plays at qd
;W[dd]C[This is a pincer.]  White plays at dd, with the comment "This is a pincer."

lgs.tw keeps the comment of every move, so the comment column beside the board and the numbers on the stones always agree.

An SGF can hold variations

An SGF is a tree, not a line. After any move you may open a parenthesis, and what is inside it is another way the game could have gone:

(;GM[1]SZ[19];B[qd](;W[dd];B[pp])(;W[cd];B[pp]))

The first branch inside the parenthesis is a variation. A program reading this file draws the extra line on the board and lets you click back and forth along it.

A record on lgs.tw is a single line: the site stores one path, not a tree of them. What you can do is branch off from any move and save the line you had in mind as a new record. That is how you make a variation diagram.

Why it is worth knowing

  • A record is text, so you can type one by hand in a plain editor, or have a program write it for you.
  • The same file opens in almost any board program: board software, AI engines and record websites all read SGF.
  • SGF can carry comments and marks, and they travel with the record instead of being lost in another program.
  • Once you know the format, an .sgf file on the internet stops being a mystery attachment.

To get your own record file back, press download SGF on the record page (you need to be signed in). The file opens directly in any board program.