Written and maintained by CASRAI Editorial Board
Published · Last updated
On this page
MrBayes is free, open-source software for Bayesian inference of phylogeny: it reads an aligned sequence (or other character) matrix in Nexus format, runs Markov chain Monte Carlo (MCMC) to sample trees and model parameters, and reports a consensus tree with posterior probabilities as branch support. You run it from a command line with a handful of commands: execute to load the data, lset to set the model, mcmc to run the chains, then sump and sumt to summarise the results. This guide covers installation routes, the official quick-start sequence, the default settings, how to judge convergence, and what each output file contains. Facts come from the MrBayes manual (version 3.2), the project download page and the GitHub repository, all read on 2026-11-12.
What MrBayes is used for in research
MrBayes estimates a posterior distribution of phylogenetic trees. Instead of a single best tree, it samples many trees in proportion to their posterior probability, so branch support is a probability that a clade is correct under the model and the data. The consensus tree it writes carries those clade probabilities. Researchers use it for species and gene trees from DNA, RNA or protein alignments, and the manual’s tutorials work through a primate example data set (primates.nex).
Two practical facts frame every run. First, MrBayes is licensed under the GNU General Public License (GPL-3.0 on its GitHub repository), and the project site describes it as free software. Second, it is driven by typed commands rather than menus, and its built-in help command lists all commands while help <command> (for example help lset) explains one. The manual command saves all help text to a file; run it right after startup so the file records default values.
For background on the method, see Markov chain Monte Carlo. For the wider workflow of alignment, model choice and tree drawing, see how to make a phylogenetic tree.
How to install or access it
The official download page is on the project site (nbisweden.github.io/MrBayes), and the code is maintained at github.com/NBISweden/MrBayes. The download page lists 3.2.8 as the current release at the date of reading. The routes it describes are:
| Route | What the download page or repository says |
|---|---|
| Source tarball (Unix, Linux, macOS) | Recommended route; compile on your machine. |
| Git clone and build | The repository gives git clone --depth=1 https://github.com/NBISweden/MrBayes.git, then ./configure, then make && sudo make install, which installs the executable mb in /usr/local/bin. |
| Homebrew (macOS, Linux, WSL) | Listed as an installation option; the INSTALL file in the repository has the details. |
| Windows precompiled | A provisional MrBayes-3.2.7-WIN.zip that is serial and compiled without BEAGLE. |
| Develop branch | Must be compiled from source. |
| MPI version | Recommended when running many parallel chains; requires building with MPI support. |
The serial build uses a single core. The manual states that the MPI version is needed to use multiple cores, with the example mpirun -np 4 mb batch.nex > log.txt &. The BEAGLE library can speed up likelihood calculations and can use a GPU, but the manual notes that setting it up can be challenging and tells readers to follow the INSTALL instructions. Windows users who need MPI or BEAGLE should read the INSTALL file rather than rely on the precompiled serial build.
Step-by-step: a first analysis with the manual’s quick start
The manual’s quick start is a short command sequence. Start the program by typing mb in a terminal in the folder that holds your data file, then enter:
- Load the data.
execute primates.nex. MrBayes accepts the shortest unambiguous abbreviation of a command, soexe primates.nexalso works. The file must be in the current directory or you give its path, and the file name must not contain blanks. - Set the model.
lset nst=6 rates=invgamma. This selects the GTR substitution model with gamma-distributed rate variation and a proportion of invariable sites (GTR+I+Gamma). - Run the chains.
mcmc ngen=20000 samplefreq=100 printfreq=100 diagnfreq=1000. This is the short run used in the manual’s tutorial: 20,000 generations, sampled and printed every 100, with convergence diagnostics every 1,000. - Stop when converged. When the run ends, MrBayes asks Continue the analysis? (yes/no). Answer
noonly once the average standard deviation of split frequencies is below 0.01 (the manual says below 0.05 may be enough if you care only about well-supported parts of the tree). Otherwise answeryesto extend the run. - Summarise. Run
sumpto summarise parameter samples, thensumtto summarise trees.
Your data must be in Nexus format. Commands embedded in the Nexus file can change how MrBayes behaves, so the manual advises deleting or bracketing them, and removing the Equate and Symbols subcommands from the Format line if present.
Default settings you inherit
If you do not change anything, the manual’s defaults apply, and the mcmcp command sets the same parameters without starting a run. The generation count, number of runs and chains, sampling and diagnostic frequencies, burn-in fraction and checkpoint interval are listed in the data table below. The remaining defaults are:
| Setting | Default | Meaning |
|---|---|---|
| Temp | 0.1 | Chain heating temperature |
| Swapfreq | 1 | How often chain swaps are attempted |
| Printfreq | 1,000 | Screen output interval |
| Diagnstat | Avgstddev | Statistic used for convergence |
| Minpartfreq | 0.10 | Minimum frequency for a split to enter diagnostics |
| Stoprule / Stopval | No / 0.05 | Automatic stopping off by default |
The default of two runs with four chains each is what makes the split-frequency diagnostic possible: MrBayes compares the independent runs to see whether they agree.
Output and how to read it
Files MrBayes writes
Each run writes a .p file (tab-delimited parameter samples) and a .t file (Nexus tree samples). The summary commands add further files:
| File | Written by | What it answers |
|---|---|---|
.p |
mcmc (per run) | Sampled parameter values, per generation |
.t |
mcmc (per run) | Sampled trees, in Nexus format |
.ckp |
mcmc | Checkpoint; restart a stopped run with mcmc append=yes |
.parts, .tstat, .vstat |
sumt | Partition (clade) lists and their statistics |
.con.tre |
sumt | Consensus tree with clade support; readable in FigTree (use conformat=simple for a simpler format) |
.trprobs |
sumt | Trees ranked by posterior probability, with credible sets |
FigTree, TreeView and Mesquite can open the tree output for viewing and figure making.
Convergence decision table
Do not interpret the consensus tree until the run has converged. The thresholds the manual gives for the average standard deviation of split frequencies, ESS and PSRF are in the data table below. Where each one appears, and what to do if it fails:
- Average standard deviation of split frequencies. It appears in the screen output during
mcmcand again insumt. If it is too high, answeryesat the continue prompt to extend the run. - ESS (effective sample size). It appears in the
sumptable as min ESS and avg ESS. If it is too low, run longer. - PSRF (potential scale reduction factor). It also appears in the
sumptable. If it is not close to 1.0, run longer or revisit the model.
The sump table also gives mean, variance, HPD interval and median for each parameter, so you can read parameter estimates and diagnostics in one place.
Troubleshooting
- Split frequencies stay high. The run is too short or the chains mix poorly. Answer
yesat the continue prompt, or restart from the checkpoint withmcmc append=yes. - ESS below 100 in sump. The manual reads this as poor mixing; run longer before relying on the estimates.
- The run is slow on a multi-core machine. The serial build uses one core. Build the MPI version to use several, as in the
mpirunexample above. - The data file behaves unexpectedly. Check for commands inside the Nexus file and for blanks in the file name, both flagged in the manual.
- A command is not recognised. Use
helpto list commands andhelp <command>for the options of one.
Free alternatives
Other phylogenetics programs covered on CASRAI use different inference methods, so the choice depends on the question rather than on cost. Descriptions below follow the CASRAI guides for each program.
| Program | Approach | CASRAI guide |
|---|---|---|
| IQ-TREE | Maximum-likelihood trees | IQ-TREE guide |
| BEAST X | Open-source Bayesian phylogenetics | BEAST X guide |
| PAUP* | Parsimony analysis (quick start) | PAUP* guide |
FAQ
What is MrBayes?
MrBayes is free, GPL-licensed software for Bayesian phylogenetic inference. It samples trees and model parameters with MCMC and summarises them as a consensus tree with posterior probabilities.
Is MrBayes free?
Yes. The project site calls it free software and the GitHub repository uses the GPL-3.0 licence.
How do I run MrBayes?
Start mb, then use execute on a Nexus file, lset for the model, mcmc to run, and sump and sumt to summarise.
How long should I run it?
Until the average standard deviation of split frequencies is below 0.01 (0.05 may do for well-supported clades), min ESS is above 100 and PSRF is near 1.0. The default is 1,000,000 generations, and the 20,000 in the quick start is only a tutorial run.
Does MrBayes work on Windows?
The download page offers a provisional precompiled serial build (3.2.7, without BEAGLE). WSL users can install it through Homebrew.
How do I cite MrBayes?
Ronquist F et al. (2012) MrBayes 3.2. Systematic Biology 61:539-542, doi 10.1093/sysbio/sys029. The citations command prints the citations to use.
Sources
- MrBayes manual page, nbisweden.github.io/MrBayes/manual.html (read 2026-11-12).
- MrBayes download page, nbisweden.github.io/MrBayes/download.html (read 2026-11-12).
- MrBayes source repository and INSTALL, github.com/NBISweden/MrBayes (GPL-3.0; read 2026-11-12).
- Ronquist, Huelsenbeck, Teslenko, Zhang and Nylander, MrBayes version 3.2 manual (2020), Manual_MrBayes_v3.2.pdf (read 2026-11-12).
Data: MrBayes 3.2 default MCMC settings and convergence thresholds
Compiled from the MrBayes 3.2 manual: default values of the main MCMC settings, plus the manual's stated thresholds for convergence diagnostics.
| Setting or diagnostic | Default or threshold | Role |
|---|---|---|
| Ngen | 1000000 | Generations per run |
| Nruns | 2 | Independent analyses |
| Nchains | 4 | 3 heated plus 1 cold |
| Samplefreq | 500 | Sampling interval |
| Diagnfreq | 5000 | Diagnostics interval |
| Burninfrac | 0.25 | Burn-in fraction |
| Checkfreq | 2000 | Checkpoint interval |
| Avg std dev of split frequencies | below 0.01 | Very good convergence indication |
| Min ESS | above 100 | Below 100 indicates poor mixing |
| PSRF | 1.0 to 1.2 | Goal; near 1.0 |
Sources
- MrBayes version 3.2 manual (Ronquist et al.) (accessed 2026-11-12)
- MrBayes manual page (accessed 2026-11-12)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







