Skip to main content
v2026.11,986 entries · CC-BY 4.0

MrBayes: Bayesian Phylogenetic Software, Install and Run

MrBayes install routes, the official quick-start commands, default settings, convergence checks and output files for Bayesian phylogenetics.

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:

  1. Load the data. execute primates.nex. MrBayes accepts the shortest unambiguous abbreviation of a command, so exe primates.nex also works. The file must be in the current directory or you give its path, and the file name must not contain blanks.
  2. 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).
  3. 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.
  4. Stop when converged. When the run ends, MrBayes asks Continue the analysis? (yes/no). Answer no only 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 answer yes to extend the run.
  5. Summarise. Run sump to summarise parameter samples, then sumt to 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 mcmc and again in sumt. If it is too high, answer yes at the continue prompt to extend the run.
  • ESS (effective sample size). It appears in the sump table as min ESS and avg ESS. If it is too low, run longer.
  • PSRF (potential scale reduction factor). It also appears in the sump table. 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 yes at the continue prompt, or restart from the checkpoint with mcmc 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 mpirun example 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 help to list commands and help <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.

MrBayes 3.2 default MCMC settings and convergence thresholds
Setting or diagnosticDefault or thresholdRole
Ngen1000000Generations per run
Nruns2Independent analyses
Nchains43 heated plus 1 cold
Samplefreq500Sampling interval
Diagnfreq5000Diagnostics interval
Burninfrac0.25Burn-in fraction
Checkfreq2000Checkpoint interval
Avg std dev of split frequenciesbelow 0.01Very good convergence indication
Min ESSabove 100Below 100 indicates poor mixing
PSRF1.0 to 1.2Goal; near 1.0

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about MrBayes: Bayesian Phylogenetic Software, Install and Run

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →