SGF Organising Utilities

    Keywords: Software

As a result of a discussion on kicked off by Michael Lowe I wrote a quick perl program, and thought it would be a good idea to collect SGF Utilities here on Sensei's Library.

Table of contents


Filters that remove information

CommentFilter by Chris Goldsmith

To start the ball rolling here is the quick program I wrote to filter comments (chatter) out of SGF files, it currently is focussed at files downloaded off of KGS, but can easily be adapted to handle other go servers.


Here is another perl program, this one removes any sgf properties you don't want, and empty comment nodes too.

[ext] KibitzCleaner by Blubb Fallo

This is a very small Python script similar to CommentFilter, but also capable of filtering based on players' ranks.

The link to sourceforge is dead.


Smartgo allows editing of sgf files. It can remove any specified attribute (also comments) from an sgf file. It also allows changing the main line or removing branching from sgf files. It can create diagrams from sgf files.

[ext] SGFC - Removing Comments and more

Dieter: Has someone written a tool which extracts comments from sgf-files into text-files ? As the editor of the Belgian magazine, this would considerably reduce the workload of converting contributed commented games to articles in Gowrite.

(Sebastian:) Yes, our very own Arno has written a tool that does this and much more: [ext] SGFC - all you need to do is check the "delete property" box and enter "C" for "comment" in the text box like this:

LauriPaatero: in GOWrite 2 (2.1.x) you can export game in graphics and HTML. Result is HTML file with comments and links to graphics (EPS or PNG).

Filters that add or merge information

Soksoo Database

eats many sgf files and saves the corner play sequences (joseki and similar) to a new sgf

SGF Merge Trees

Such a tool would be able to merge multiple games into a single tree (same moves must be merged into one node, comments concatenated, conflicting properties detected and warnings displayed ...).

SGF Collection Tools


Since sgf allows multiple games in one file (sgf collection), there should be a tool to manage such collections (and since most editors support only one sgf tree per file it should be a external tool). It should allow to:

  • show a list with all games (with general properties like PB, PW, RB, RW, ...)
  • open one game in game-specific editor (by GM property) by saving it to temporary file
  • if the temporary file is edited, it can be integrated back into the collection (just remember positions of '(;' and ')' to modify the block); backup file needs to be created

The parser would be pretty simple, compared to full sgf parsing (just skip most parts ...).
The whole tool should be game independent (not just Go).

willemien for go only games collections: SmartGo can do this. I am not sure about Drago

SGF Tree to SGF collection tool

willemien I wrote a very basic tool that takes an SGF tree and transforms it into a Sgf collection. (Every path from the root to a leaf/ end node becomes a new game) I am not a great programmer (and the program fails sometimes, but it would be a good idea if somebode(who is better in programming than me) writes a foolproof version.

SGF file tools

SGF file renaming is a perl script that renames sgf files according to the contents of the tag(s) it is given

A similar python script: [ext]

SGF Statistics

MtnViewMark: I have recently taken Arno's sgfc source and build a program that processes collections of SGF files and produces statistics on property and value usage. The [ext] source is available.

I ran it over about five thousand SGF files from the GoDatabases page and all five thousand problems from GoProblemsCom with interesting results:

  • Other than text comments (C and N), move and node annotation is basically never used.
  • The graphic markup (AR, LN, and DD, is never used. Nor is SL.
  • The character set (CA), if ever specified, is almost always UTF-8.

Full details are available: [ext] game-stats.txt and [ext] problem-stats.txt

Yes - I realize this isn't quite the right place in the library for this info... open to suggestions!

BramGo: Your observations of the use of the (CA) just can't be correct. My guess is that most of your sources are websites in English. I've been downloading files from all kinds of asian websites as well, and I've seen a lot of different values in this tag.

Other Formats to SGF

  • For perl programmers, you can check out the Games::Go::Image2SGF CPAN module, which uses image recognition to create SGF diagrams from photographs of a go board.

SGF to Other

[ext] Peter Strempel's Format Conversion Utilities

[ext] Daniel Maslo's SGF to PDF Conversion Online tool (currently offline - Server not found error 25-02-2024)

[ext] SGFtoKifu

SGFtoKifu is a program for generating images containing kifu diagrams from SGF files. It is especially useful if you want to print a game you have in this format to review in a real board.

[ext] PhotoKifu

[ext] PhotoKifu (for Windows), now superseded, created a kifu in PNG format from a preexistent SGF file. It managed handicap stones either Chinese or Japanese but it ignored variations and multiple games in the same file.

[ext] Sgf thumbnail images

Creates thumbnail images of sgf files in your directory listing. For linux systems with gnome2 or gnome3 and nautilus.

Claint: I have gotten these tools working, they are great, but I had to fix 2 bugs in the program to get it to work in gnome2. I'll try to put it somewhere when I get around to it.

[ext] Games-Go-Sgf2Dg

a Perl distribution for the conversion of SGF files into ASCII, MetaPost, PDF, PostScript, TeX, and [ext] Sensei's Library format. It replaced sgf2dg which in turn replaced sgf2tex.

[ext] sgf-render

a command-line utility that can "generate SVG or PNG diagrams of Go games from SGF format game records. SVG output is clean and well labeled for easy re-styling or modification. Supports numbered moves, markup, kifu output, and several customizable styles". Written in Rust.

Detect faulty tsumego

Perl script that looks through all the sgf files in a directory and prints out a list of those where the first move and the last move are different colours. Is confused by variations.

Diverse to SGF

Image to SGF:

[ext] Baduk Cap / 围棋照相机

App converts images of Go boards or diagrams to SGF. Can score the game. Also records live games and builds the game SGF via the video camera. (iOS only, Localizations: English, Simplified Chinese, German)



CompoGo [ext] (CompoGo homepage) eats a picture and gives a diagram to save as SGF file

Chris Ball's [ext] image2sgf

[ext] Go Tracer (dead link)

[ext] VideoKifu

[ext] VideoKifu (for Windows) reconstructs the whole move sequence of a Go game from a possibly unattended video feed, either live or deferred. It produces an SGF file and a game record; the move sequence may be published on the Internet in real-time, via FTP connection (as in this example: [ext] VKTV).

Latest release (demo version) published on May 28th, 2018.

Text to SGF

  • [ext] JText2Sgfs is a Java program, that eats text files (e.g. a Mozilla mailbox), extracts sgf-data and saves them to SGF files.
  • The same did SplitGo (for Java) by Ray Tayek. This program disappeared from the net.
  • A tool to convert a text diagram from rgg to SGF (there is at least one)?

==See also ==

SGF Organising Utilities last edited by on February 26, 2024 - 16:37
RecentChanges · StartingPoints · About
Edit page ·Search · Related · Page info · Latest diff
[Welcome to Sensei's Library!]
Search position
Page history
Latest page diff
Partner sites:
Go Teaching Ladder
Login / Prefs
Sensei's Library