Draw extensive-form game trees in the browser and export them as images or LaTeX.
Open the editor, nothing to install.
Game Tree Studio is a single-page editor for the game trees used in game theory: decision nodes, chance moves, information sets, payoffs and continua of actions. It runs entirely in the browser, with no build step, no server and no account. Your games are saved in your browser's local storage.
- Quick tree building. Double-click a node to add moves, press
1–6to give it to a player, orNto make it a chance node. - Information sets. Shift-click the nodes a player cannot tell apart and press
I. They are drawn as a dashed line, a dotted line or an oval, and move labels stay in sync across the set. - Chance moves with numeric or symbolic probabilities (
1/3,0.25,\pi,1-\pi). The editor warns when numeric probabilities don't add up to 1. - Payoffs as expressions.
s_1-5, -s_1-5renders as s₁−5, −s₁−5. - Continuum of actions. An arc between the extreme choices, one representative move and a range label such as
x \in [0, 8]. - Highlighted moves (thick line with an arrow) to mark a strategy profile or a backward-induction path.
- Layout control. Top-to-bottom or left-to-right trees, spacing sliders, terminal nodes on one row, drag a node to nudge its subtree, and per-node label positions. Wide payoffs get extra room automatically.
- Notation options. Payoffs as
(3, 1),3, 1or stacked; open-circle or square chance nodes; serif or sans-serif text; optional colors by player. - Export to PNG (3× resolution), SVG, the clipboard, TikZ, GTDraw
.effiles and the editor's own.jsonformat. - Undo and redo, copy and paste of subtrees, keyboard navigation, light and dark themes, and a layout that works on phones.
Open index.html in a recent version of Chrome, Edge, Firefox or Safari. There is nothing to install.
To serve it locally, so it behaves exactly like a hosted copy:
python -m http.server 8000Then visit http://localhost:8000.
- Push this repository to GitHub.
- Open Settings › Pages, set Source to Deploy from a branch, and choose
mainwith the/ (root)folder. - After a minute the editor is live at
https://<your-username>.github.io/<repository-name>/.
| Action | How |
|---|---|
| Add moves | Double-click a node, or select it and press A |
| Assign a player | 1–6, or N for a chance node |
| Edit a label in place | Double-click a move, probability, payoff or player name |
| Jump to the next label while editing | Tab (Shift+Tab goes back) |
| Edit payoffs of a terminal node | Select it and press Enter, then type 3, 5 |
| Select several nodes | Shift-click |
| Join or leave an information set | I / U |
| Highlight the move into a node | H |
| Delete a node and everything after it | Delete or Backspace |
| Copy a subtree, paste it onto a terminal node | Ctrl+C, then Ctrl+V |
| Undo and redo | Ctrl+Z, Ctrl+Y |
| Pan, zoom, fit | Drag empty space, Ctrl + scroll, F |
| Move the selection | Arrow keys |
A continuum of actions is set per node: select a decision node and tick Draw as a continuum in the side panel.
Move labels, probabilities and payoffs accept a small LaTeX-like markup:
| Type | Shows |
|---|---|
s_1, u_{12} |
s₁, u₁₂ |
x^2 |
x² |
\pi, 1-\pi |
π, 1 − π |
\ge, \le, \in |
≥, ≤, ∈ |
\alpha, \theta, \delta |
α, θ, δ |
Minus signs in payoffs and probabilities are typeset as true minus signs. In the TikZ export the same text becomes math mode, and simple fractions such as 1/3 become \tfrac{1}{3}.
| Format | Use it for |
|---|---|
| PNG | Word, Google Docs, slides and course submissions |
| SVG | Vector graphics for the web or for further editing |
| Copy image | Pasting straight into another app |
| TikZ | LaTeX documents. Needs the tikz and amsmath packages. Every element sits at the coordinates shown in the editor. |
GTDraw .ef |
Fine-tuning the typesetting in GTDraw |
| JSON | Saving games as files, sharing them and opening them again (Export › Open game file, or drag the file onto the canvas) |
A game is a JSON object. See examples/example-game.json.
| Field | Meaning |
|---|---|
players |
Player names in payoff order, e.g. [{ "name": "Ann" }, { "name": "Bob" }] |
chanceName |
Name shown at chance nodes, e.g. "Nature" |
root |
Id of the root node |
nodes |
Map from node id to node |
style |
Optional display settings (orientation, spacing, notation, font) |
Each node has these fields (all optional except parent and children):
| Field | Meaning |
|---|---|
parent, children |
Tree structure; children is ordered |
player |
1, 2, … for players, 0 for a chance node, null when unassigned |
iset |
Information set id, shared by all of its nodes |
move |
Label of the move into this node |
prob |
Probability of that move when the parent is a chance node |
pay |
Payoffs at a terminal node, one string per player |
hl |
Highlight the move into this node |
cont, range |
Draw a continuum of moves at this node, with a range label |
label |
Optional node label |
dx, dl |
Manual nudge across the tree (in slots) and extra depth (in levels) |
lpos |
Player name position: auto, left, right, above, below or hide |
index.html page markup
assets/app.css styles; colors are tokens on :root, with dark-mode overrides
assets/app.js the editor: tree model, layout, rendering, export
assets/favicon.svg icon
examples/ sample game files
docs/ images used in this README
Games are kept in localStorage for the address the editor is served from, so a copy on GitHub Pages and a copy opened from disk keep separate libraries. Clearing site data removes them. Use Export › Save game file to keep a copy you can open anywhere.

