Home / Science / Molecular and cell biology / Systems biology / Gillespie stochastic simulatorTool #988

Gillespie stochastic simulation (SSA) for small reaction networks: many runs, mean and spread vs the ODE, noise and Fano factor

Simulate small reaction networks one molecule at a time with Gillespie's exact stochastic algorithm. Run many times to see the mean, the spread and single runs against the deterministic ODE, and the distribution of counts at the end against a Poisson distribution, with the Fano factor.

Keep it one tap away for everyday use.

Bookmark Gillespie stochastic simulator?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Reactions
  2. Runs
  3. Simulate
  4. Spread
Nothing is uploadedWorks offline once open

Model

The same reaction language as the pathway ODE builder: A + B -> C : k, A <-> B : kf, kr, -> A : k0, A -> : kd, MM(Vmax, Km), Hill(Vmax, K, n). Amounts are numbers of molecules (whole numbers); species not given start at 0.

Each run is exact: the time to the next reaction and which reaction fires are drawn at random from the current propensities. The same seed gives the same runs. Up to 2,000 runs and 5 million reactions in all.

Result

Counts at the end

The band is the mean ± 1 standard deviation across runs. The Fano factor (variance ÷ mean) is 1 for a Poisson distribution, as for a molecule made and destroyed at constant rates; above 1 means bursty, noisier production. For study and planning, not a substitute for professional judgement.

Download

What it does

Inside a cell many molecules exist in tens or hundreds of copies, not in moles. At such small numbers, reactions happen at random moments and two identical cells drift apart. An ODE model gives only the average. Gillespie’s stochastic simulation algorithm (SSA) follows the counts one reaction at a time, so each run is one possible history of one cell.

This page runs the SSA many times and shows:

  • Single runs, to see how jumpy one cell is.
  • The mean of all runs and a band of ± 1 standard deviation, with the ODE curve for comparison.
  • The distribution of counts at the end of the runs, next to a Poisson distribution with the same mean.
  • The Fano factor (variance ÷ mean): 1 for a Poisson distribution, above 1 for bursty noise.

Everything runs in your browser.

How to use it

  1. Pick a starting model or write your own in the same reaction language as the pathway ODE builder: A + B -> C : k, A <-> B : kf, kr, -> A : k0 (made at a constant rate), A -> : kd (removed), MM(Vmax, Km) and Hill(Vmax, K, n).
  2. Give rate constants and whole-number starting counts (molecules). Species not given start at 0.
  3. Set the end time, the number of runs (more runs give smoother averages but take longer), the species to show, how many single runs to draw, and the random seed. Untick the ODE if you do not want its curve.
  4. Read the result, and download the mean and spread over time or the final count of every run as CSV, or the report as an image, PDF or Word file.

For a reaction using two molecules of the same kind (2 A -> B : k) the propensity is k·n(n − 1), so that for large counts it matches the ODE rate k·n².

Worked example

The starting model is birth and death: X is made at k0 = 10 per unit time and each molecule is lost at kd = 1. The ODE settles at k0/kd = 10, and theory says the counts settle into a Poisson distribution with mean 10, so the variance is 10 too.

With 200 runs to t = 10 and seed 1, the page shows X at t = 10: mean 9.99, SD 3.05, a Fano factor of 0.932 and runs between 5 and 15 for 90 % of the cells (lowest 4, highest 18). The histogram follows the Poisson curve, and the ODE value is 10. More runs bring the Fano factor closer to 1.

Switch to Gene expression: mRNA M is made and lost, and each mRNA makes protein P. The protein mean approaches km·kp/(dm·dp) = 100, but the Fano factor is far above 1 (theory: 1 + kp/(dm + dp) ≈ 7.7), because proteins come in bursts from each mRNA.

Toggle with positive feedback shows where the ODE misleads: X switches on its own production (a Hill law with n = 4). The ODE stays in the low state (1.02 at t = 30), but random bursts push some runs over the threshold into a high state, so the end counts split into two groups and the mean of the runs (13 with seed 1) is far from the ODE.

Tips

  • Simulation time grows with the number of reactions fired. Large counts or fast rates make it slow; the page stops at 5 million reactions.
  • For linear models (only first-order and constant reactions) the mean of the runs follows the ODE exactly; for others, such as dimerisation or feedback, they can differ.
  • Change the seed to check a pattern is not chance.

FAQ

Is this the exact SSA? Yes, the direct method: the waiting time to the next reaction is drawn from an exponential distribution with the total propensity, and the reaction is picked in proportion to its propensity.

What about Michaelis–Menten and Hill steps? They use the same rate law on molecule counts, a common shortcut for enzyme or regulation steps; it is an approximation, not an exact model of binding.

Is anything sent anywhere? No. It all runs on this page, also offline. For study and planning, not a substitute for professional judgement.

Where the numbers come from

  • Gillespie, D. T. (1977), Exact stochastic simulation of coupled chemical reactions, J. Phys. Chem. 81, 2340 to 2361 (the direct method); the two-stage gene expression noise result of Thattai, M. and van Oudenaarden, A. (2001), PNAS 98, 8614 to 8619: used as methods, written by fibub.
  • Checked against exact results: the Poisson stationary distribution of the birth-death process (chi-square test with SciPy's Poisson and chi-square functions), the binomial distribution of first-order decay, the mean and Fano factor of the two-stage gene expression model, and the ODE mean of a linear model. Example rates are made up.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Pathway ODE builder #986 Type a pathway as reactions (mass action, reversible, Michaelis-Menten or Hill) and get its differential equations, a simulated time course from an adaptive Runge-Kutta solver, and a least-squares fit of chosen rate constants to your own measured time courses, with standard errors. Gene network viewer #987 Open or paste a gene regulatory network as SIF or GraphML and see it drawn with a force-directed layout, activating edges as arrows and repressing edges as bars, with in- and out-degree for every gene, connected parts, autoregulation, two-gene feedback loops and feed-forward loops sorted into coherent and incoherent. Your file stays on your device. 1D Schrödinger solver #923 Choose a textbook potential, type a formula or draw your own, and get the lowest energy levels and wavefunctions of the one-dimensional Schrödinger equation by the matrix (finite-difference) method, with the exact levels alongside for the box, harmonic oscillator, finite well, Morse, linear and Pöschl–Teller potentials. Adduct and neutral loss calculator #984 Type a formula or a neutral monoisotopic mass and get the m/z of 25 common electrospray adducts in positive and negative mode, the ions left after common neutral losses (water, ammonia, CO2, sugars, phosphate and your own), and match a list of observed m/z values within a ppm tolerance. With no molecule, it turns observed m/z values into candidate neutral masses. Air quality calculator #116 Convert gas concentrations between ppm, ppb, µg/m³ and mg/m³ at any temperature and pressure, and work out the US Air Quality Index (with the 2024 PM2.5 breakpoints), India's National AQI and Canada's Air Quality Health Index from your own readings. Altermagnet checker #117 Enter a crystal and mark which atoms are spin up or spin down. The tool finds the symmetry operations that swap the two spin sublattices and tells you whether the material is a conventional antiferromagnet (spin-degenerate bands), an altermagnet (d-, g- or i-wave spin-split bands) or a ferrimagnet, with the symmetry-allowed form of the spin splitting and a map of where it is positive or negative.