Infectious Disease and Epidemic Calculator (SIR Model)

Model a closed-population outbreak with the classic SIR (Susceptible-Infected-Recovered) differential equations. Enter population size, initial cases, the basic reproduction number (R0), and the infectious period to estimate the epidemic peak, its timing, the final attack rate, and the herd immunity threshold.

Quick Facts

Governing equations
dS/dt=-βSI/N, dI/dt=βSI/N-γI, dR/dt=γI
The Kermack-McKendrick SIR model, solved numerically (Runge-Kutta) from your inputs.
Basic reproduction number
R0 = β / γ
Herd immunity threshold = 1 - 1/R0, valid when R0 > 1.

Your Results

Calculated
Peak infected
-
Simultaneous active cases at the epidemic's high point
Day of peak
-
Days from outbreak start to the peak
Total ever infected
-
Final epidemic size (cumulative)
Herd immunity threshold
-
Population that must be immune to halt spread

Ready

Enter population, R0, and infectious period, then calculate to model the outbreak.

About the Infectious Disease and Epidemic Calculator (SIR Model)

The SIR model, published by Kermack and McKendrick in 1927, is the foundational compartmental model of mathematical epidemiology. It divides a closed population into three groups - Susceptible (S), Infected (I), and Recovered (R) - and describes how people move between them during an outbreak using three coupled differential equations:

  • dS/dt = -βSI/N - susceptible people become infected at a rate proportional to contact with infected people.
  • dI/dt = βSI/N - γI - infected people accumulate new cases and lose cases to recovery.
  • dR/dt = γI - infected people recover (or are removed) at a constant rate.

Here N is the total population, β is the transmission rate, and γ = 1/D is the recovery rate, where D is the average infectious period in days. This calculator takes your population, initial infected count, R0, infectious period, and any initial immunity, derives β and γ, and integrates the three equations numerically (fourth-order Runge-Kutta) to trace the epidemic from day zero until it fades out.

The basic reproduction number, R0

R0 = β/γ is the average number of secondary infections one case produces in a fully susceptible population. It is the single most important input: R0 above 1 means each generation of cases outnumbers the last and the outbreak grows; R0 at or below 1 means the outbreak shrinks from the start, even with zero interventions.

What the calculator reports

From the simulated curves, the calculator reads off the peak number of simultaneous infections and the day it occurs (which happens exactly when the susceptible share of the population falls to 1/R0), the total number of people ever infected once the outbreak has fully run its course (the final epidemic size), and the herd immunity threshold, 1 - 1/R0 - the share of the population that must already be immune for the outbreak to fail to sustain itself.

Assumptions and limits

The classic SIR model assumes a closed, well-mixed population with no births, deaths, or migration during the outbreak; permanent immunity after recovery; and constant transmission and recovery rates (no behavior change, seasonality, or interventions partway through). It also treats everyone as equally likely to contact everyone else, ignoring age structure and network effects. These simplifications make the model transparent and fast to reason about, but real outbreaks - shaped by control measures, heterogeneous mixing, and changing behavior - can diverge from it substantially.

When to consult a professional

This tool performs the standard SIR arithmetic for education, planning, and scenario exploration. It is not surveillance data and does not replace guidance from epidemiologists or public health authorities during an actual outbreak, who combine real case data, contact tracing, and intervention effects that this simplified model does not capture.

Frequently Asked Questions

What is the SIR model?
The SIR model is the classic Kermack-McKendrick framework for a closed-population outbreak. It splits people into Susceptible, Infected, and Recovered compartments and moves them between groups using two rates: a transmission rate that turns susceptible people into infected people, and a recovery rate that turns infected people into recovered (immune) people. This calculator solves those equations numerically from your inputs.
What is R0 and why does it matter?
R0, the basic reproduction number, is the average number of new infections one infected person causes in a fully susceptible population. When R0 is above 1, each generation of cases is larger than the last and the outbreak grows; when R0 is at or below 1, the outbreak shrinks from the start. R0 also sets the herd immunity threshold and the eventual size of an unmitigated outbreak.
How is the herd immunity threshold calculated?
The herd immunity threshold is 1 minus 1 divided by R0. It is the share of the population that needs to be immune (through prior infection or vaccination) so that, on average, each remaining infectious person infects fewer than one other person, which stops sustained growth. It only applies when R0 is greater than 1.