XG to MAT Converter

Convert eXtreme Gammon .xg match files to .mat text format. Runs entirely in your browser.

Drag & drop an .xg file here, or

Supports .xg match files from eXtreme Gammon

What is a .mat file?

A .mat file is the plain-text match format most backgammon software reads: download a match from Backgammon Galaxy, Backgammon Heroes, OpenGammon, or BG Hub and you usually get one. GNU Backgammon, eXtreme Gammon, BGBlitz, and Snowie all import it.

An .xg file is eXtreme Gammon's own binary format. It stores the match together with XG's analysis, rollouts, and comments, and only XG reads it. Converting to .mat lets you open an XG match in GNU Backgammon, which is free and runs on Windows, macOS, and Linux, or in anything else that reads .mat. If you own XG, it can export .mat itself with File → Export → JellyFish; this tool is for when you don't have XG at hand, or someone sends you an .xg file.

Want to study the match rather than replay it? The AnkiGammon web app reads the same .xg file, keeps XG's analysis, and turns your mistakes into Anki flashcards.

How to use

  1. Drag an .xg match file onto the box above, or click browse files.
  2. The file is read and converted in your browser. Nothing is uploaded.
  3. Check the preview, then click Download .mat (same file name, ending in .mat) or Copy to Clipboard.
  4. Open the .mat file in GNU Backgammon or any other program that reads .mat.

What gets converted

  • Match length, as the 7 point match header line, or 0 point match for a money session.
  • Player names, accents included.
  • Every completed game, with the score at the start of the game.
  • Every checker play, as the roll and the points each checker moved from and to, higher die first: 64: 24/18 13/9.
  • Cube actions: Doubles => 2, then Takes, Drops, or Beavers.
  • Results: Wins 2 points, with and the match on the game that ends the match.

A .mat file is a plain move list, so XG's analysis, rollouts, and comments, the event details, and hit markers don't carry over. GNU Backgammon works out the Crawford game from the score and resignations from the points won.

Limitations

  • A game still in progress when the file was saved is left out.
  • Games started from a custom position (XG's Setup Position) or played as Nackgammon are converted as if they started from the normal opening position, so they come out wrong.
  • Single-position .xgp files aren't match files; open them in the Position Editor & Converter instead.

Opening the .mat in GNU Backgammon

  1. Choose File → Open (Ctrl+O) and select the .mat file. GNU Backgammon recognizes the format.
  2. Choose Analyse → Analyse match or session, then Analyse → Match or session statistics for the summary.
  3. Or type import mat "path/to/file.mat" in the command panel (View → Panels → Command).

Frequently asked questions

Can GNU Backgammon open .xg files directly?

No. GNU Backgammon imports .mat, SGF, Snowie text, FIBS oldmoves, and a few other formats, but not eXtreme Gammon's .xg. Convert the file to .mat first.

Doesn't eXtreme Gammon export .mat itself?

Yes, with File → Export → JellyFish. eXtreme Gammon is a paid Windows program, though, so this tool covers everyone without it, on any operating system.

Is my match file uploaded anywhere?

No. The file is read and converted by JavaScript in your browser, and the download is generated on your computer.

Why is XG's analysis missing?

The .mat format only records moves, cube actions, and results; it has no place for evaluations or comments. Open the file in GNU Backgammon and run Analyse → Analyse match or session for a fresh analysis, or open it in the AnkiGammon web app, which analyzes a .mat with HedgeHog. To keep XG's own analysis, open the original .xg file in the web app instead: it turns that analysis into flashcards.

What does 64: 24/18 13/9 mean?

The player rolled 6-4 and moved one checker from the 24-point to the 18-point and another from the 13-point to the 9-point. Points are numbered from the moving player's side, 25 is the bar, and 0 is off the board.

Support me