Home / Science / Health and medicine / Epidemiology / Epidemic model simulator (SIR, SEIR, SEIRS)Tool #462

SIR and SEIR epidemic model simulator with R0, vaccination and interventions

Simulate an outbreak with the SIR, SEIR or SEIRS model: set R0, the latent and infectious periods, the population, vaccination and contact cuts, and see the curve, the peak day, the peak size and the final size. A teaching model, not a forecast.

Keep it one tap away for everyday use.

Bookmark Epidemic model simulator (SIR, SEIR, SEIRS)?

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

  1. Set disease
  2. Contact cuts
  3. Run model
  4. CSV, report
Nothing is uploadedWorks offline once open

For study and teaching, not medical advice. Check with a qualified professional. This is a teaching model, not a forecast.

Model and disease

R0 is how many people one case infects in a fully susceptible population. The latent period is the time from infection to becoming infectious; the infectious period is how long a case can pass it on. Vaccinated people start fully immune. In SEIRS, recovered (and vaccinated) people lose immunity after about the time you give.

A contact cut of 40 % lowers the transmission rate by 40 % on those days (distancing, closures, masks). Overlapping cuts multiply.

What it does

This simulator runs the classic compartmental models of an infectious disease outbreak. Everyone in the population sits in one box at a time: Susceptible, Exposed (infected but not yet infectious), Infectious, or Recovered and immune. The tool moves people between the boxes day by day and draws the curves, so you can see how R0, the length of each stage, vaccination and a period of reduced contact change the outbreak.

It is a teaching model, not a forecast. Real outbreaks depend on age, contact patterns, place, testing and behaviour, which these simple models leave out. Use it to learn how the ideas fit together, not to predict a real epidemic.

How to use it

  1. Choose the model. SIR has no latent stage. SEIR adds one, which slows the outbreak. SEIRS lets immunity wear off, so the disease can come back in waves and settle at a steady level.
  2. Type the population, R0 (how many people one case infects when everyone is susceptible), the latent period and the infectious period in days. For SEIRS, add how long immunity lasts.
  3. Set the initial infectious cases and the share vaccinated at the start (they begin immune).
  4. Optionally add interventions, one per line: from day, to day, and the per cent cut in contacts. “30, 60, 40” cuts transmission by 40 % from day 30 up to day 60.
  5. Read the peak day, peak size and the share infected, and download the daily numbers as CSV or the report as an image, PDF or Word file.

Show as switches the charts between numbers of people and per cent of the population.

The maths

With N people, the transmission rate is β = R0 / D × (1 − cut), where D is the infectious period; σ = 1 / latent period and γ = 1 / D. The SEIR equations are dS/dt = −βSI/N, dE/dt = βSI/N − σE, dI/dt = σE − γI and dR/dt = γI. SIR drops E; SEIRS adds a flow ωR back from R to S, with ω = 1 / immunity duration. The tool solves them with the fourth-order Runge-Kutta method in steps of at most 0.1 day, and finds the peak between steps with a parabola.

Without interventions or waning immunity, the share still susceptible at the end, s∞, solves the final-size equation s∞ = s0 · exp(−R0 (1 − v − s∞)), where s0 is the susceptible share at the start and v the vaccinated share (Kermack and McKendrick, 1927). The tool shows it next to the simulated result. The herd immunity threshold is 1 − 1/R0, and the R at the start is R0 times the susceptible share.

Worked example

The page opens with a made-up disease: SEIR, 100,000 people, R0 = 2.5, a 3-day latent period, a 5-day infectious period and 10 initial cases. The peak comes on day 63.9 with 14,386 people infectious (14.4 %), and 89.3 % of the population is infected in the 200 days, the same as the final-size equation. The herd immunity threshold is 60 %.

Add the line 30, 60, 40 (a 40 % contact cut from day 30 to day 60): the peak moves to day 84.1 and falls to 12,563, and 88.1 % are infected. The cut delays and flattens the curve, but once it ends the outbreak carries on. Switch to SIR and the peak comes much sooner, on day 32.1 with 23,352 infectious.

Tips

  • If the peak day says “still rising at the end”, run more days.
  • Set the vaccinated share above the herd immunity threshold and cases fall from the start.
  • In SEIRS, use a long run (two years or more) to see the waves settle.

Frequently asked questions

Is this the same as the R number in the news? The news usually reports the effective R at a point in time. This tool shows R at the start, R0 times the susceptible share.

Why are cases never exactly zero? The equations treat people as a smooth quantity, so tiny fractions of a person remain. Real outbreaks can die out by chance; this model cannot.

Were these numbers checked? Yes: the curves match SciPy’s solve_ivp to better than one person in ten million, and the final size matches the final-size equation solved with SciPy.

Is my data stored? No. Everything runs in your browser and nothing is sent anywhere.

Draw your own figures from the CSV with the plot maker.

Where the numbers come from

  • SIR model and final-size equation: Kermack and McKendrick (1927), Proceedings of the Royal Society A 115: 700-721.
  • SEIR and SEIRS models: Anderson and May (1991), Infectious Diseases of Humans, Oxford University Press; Keeling and Rohani (2008), Modeling Infectious Diseases in Humans and Animals, Princeton University Press.
  • Example values are made up for teaching.

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

Biodiversity indices #39 Paste species counts for one or more sites and get Shannon, Simpson, evenness, Chao1 richness, rarefaction curves and Bray-Curtis similarity in one table. Runs in your browser. Dose-response and ELISA curve fitter (4PL) #29 Fit a four-parameter logistic curve to dose-response or ELISA data. Get the EC50 or IC50 with its 95 % interval and the Hill slope, and read unknown samples off the curve. Sample size and power calculator #32 How many subjects, samples or survey responses do you need? Sample size for comparing two means, paired data, two proportions, or a survey's margin of error, with power curves. Matches R and G*Power. Uncertainty propagation calculator #25 Type your formula and your measurements with their uncertainties, or paste repeated readings. Get the result with its uncertainty, which input matters most, and a Monte Carlo check. Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser. DALY and QALY calculator with ICER #492 Work out disability-adjusted life years (DALY = YLL + YLD) with optional discounting, QALYs from utilities you enter, and the incremental cost-effectiveness ratio per QALY gained and per DALY averted. Herd immunity threshold calculator #493 Work out the herd immunity threshold from R0, the vaccine coverage needed for a vaccine of a given effectiveness, and the effective R at your coverage, with a chart of the threshold against R0.