Our visual editor automatically generates clean TikZ LaTeX code. Ready to compile.
The Sarmate.net probability tree editor is a visual WYSIWYG online editor that lets you create weighted tree diagrams directly with your mouse — no prior LaTeX knowledge required. Name the events, enter the probabilities on the branches and add children. The corresponding TikZ code is generated in real time, ready to be used in your documents.
Whether you're a math teacher preparing a test on conditional probability, a student solving Bayesian problems, or a professor creating lecture slides — the editor saves you valuable time. Hand-coding a probability tree in TikZ requires nested child blocks, careful indentation and precise edge labels. With the visual editor, you no longer need to worry about it.
In a few steps, create a complete probability tree diagram:
Choose a built-in preset (coin flip, conditional probability, binomial trial…) or start from an empty tree. Click + to add child nodes.
Click on a node to edit its label. LaTeX formulas are supported: $\overline{A}$, $B \cap C$, etc. The KaTeX preview shows the result instantly.
Enter probabilities directly on the branches: $\frac{1}{3}$, $P(A)$, etc. Choose the position (above / below / on the line) for each label.
The TikZ code is generated in real time in the lower panel. Click Copy to paste it into your document, or Test to compile it directly in the online editor.
$\overline{A}$, $R_1$, $E \cup F$$P(A)$, $1-p$)This editor is ideal for classic probability exercises:
Tree with P(A), P(B|A), Bayes' formula.
Binomial experiments, coin flips, dice rolls.
Drawing with and without replacement, multiple colors.
Sensitivity, specificity, positive predictive value.
Hand-coding a probability tree in TikZ is tedious and error-prone. Each node requires nested child { node { } } blocks, and weight labels need precise positioning (edge from parent node[midway, ...]). A missing brace breaks the entire document. With the visual editor:
Discover our other free WYSIWYG editors for LaTeX:
See all editors: Visual LaTeX editors | Overleaf alternative
No download, no installation, no signup. Open the editor and start right away.
Open the editor — FreeOpen the visual editor, click to add nodes (events) and edges (probabilities), and Sarmate generates the matching TikZ-LaTeX code automatically. You can then copy the code into your document, no installation needed.
Yes. The TikZ code is plain LaTeX — paste it into any editor and tweak colors, spacing, labels, or add packages. The output is human-readable, not minified.
No. The editor works directly in your browser without signup. Sarmate offers a free account if you want to save your trees in the cloud, but it's optional.
Conditional probability trees (Bayes), independent and dependent events, multi-level trees with up to 4-5 branches per node, and weighted edges. The editor supports both fractions and decimals on probabilities.