Advanced

Viral Infection SIR Model Calculator

Enter population size, transmission rate β and recovery rate γ to model an epidemic using the SIR compartmental model — get R₀, peak infected, herd immunity threshold and the infection curve.
Total population in the modelled community
Number of infectious individuals at day 0

per day

Average contacts per day × prob. of transmission per contact

per day

1/γ = average infectious period in days (e.g. γ=0.1 → 10-day illness)

days

Extend if the epidemic has not fully resolved
Basic reproduction number R₀
3

R₀ = β/γ. Values > 1 produce an epidemic; < 1 fades out.

Herd immunity threshold
66.7%
Herd immunity count
6,667 people
Peak infected
3,018 (30.2%)
Day of peak
day 39
Total attack rate
94.1%
Avg infectious period
10 days
Step by step
  1. 1

    Average infectious period (1/γ)

    1 ÷ 0.1 = 10
    1/γ is the mean number of days a person remains infectious.
  2. 2

    Basic reproduction number R₀

    0.3 ÷ 0.1 = 3
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. This is not medical, health or fitness advice; consult a qualified healthcare professional. Read the full disclaimer.
Quick answer

How does this calculator work?

The SIR model tracks susceptible (S), infectious (I) and recovered (R) individuals over time. The basic reproduction number R₀ = β/γ determines epidemic severity; R₀ > 1 means an outbreak grows. Herd immunity threshold = 1 − 1/R₀. Peak infections and epidemic duration depend on β, γ and initial conditions — the model is an idealised tool for building epidemiological intuition.

Formula
dS/dt = −β·S·I/N • dI/dt = β·S·I/N − γ·I • dR/dt = γ·I • R₀ = β/γ • HIT = 1 − 1/R₀
How this is calculated

The SIR (Susceptible–Infectious–Recovered) model divides a closed population N into three compartments: susceptible individuals S who have not yet been infected, infectious individuals I who can transmit the pathogen and recovered individuals R who are immune (or removed). The transmission rate β captures how quickly susceptibles become infected — it is roughly the product of the average number of daily contacts and the probability of transmission per contact. The recovery rate γ equals 1 divided by the mean infectious period in days.

The basic reproduction number R₀ = β/γ is the expected number of secondary cases from a single infectious individual in a fully susceptible population. When R₀ > 1 the pathogen spreads exponentially at first; when R₀ < 1 the outbreak fades without spreading widely. The herd immunity threshold (HIT = 1 − 1/R₀) is the fraction of the population that must be immune — through prior infection or vaccination — to prevent further epidemic growth. The plot shows the infected compartment I(t) over time, tracing the classic epidemic "bell curve".

The SIR model is a highly simplified abstraction. It assumes a homogeneous, well-mixed population with no births, deaths, age structure or spatial variation. It does not model interventions (lockdowns, mask-wearing), vaccination rollout, reinfection, waning immunity, multiple variants or superspreader dynamics. Real epidemics differ substantially from the model's prediction; use it to build intuition, not to forecast actual outcomes.

Frequently asked questions

For seasonal influenza: β ≈ 0.3/day, γ ≈ 0.1/day (10-day infectious period), R₀ ≈ 3. For measles (unvaccinated): R₀ ≈ 12–18. For COVID-19 (original strain): R₀ ≈ 2–3. These are population-level averages and vary greatly by context.

The SIR model continues spreading past the peak until the susceptible pool is depleted enough, so the total attack rate can be much larger than the peak. In practice, interventions, behaviour change and prior immunity reduce both the peak and the total well below the model's theoretical prediction.

HIT = 1 − 1/R₀ is the proportion of a population that must be immune for the epidemic to stop growing. At that point each infectious person infects fewer than one other on average, and the outbreak declines. For R₀ = 3, HIT = 67%; for R₀ = 12 (measles), HIT = 92%.

Also known as

sir epidemic model calculator
basic reproduction number R0 calculator
herd immunity threshold calculator
infectious disease spread simulation
epidemic curve calculator
epidemiology sir model tool
viral spread R0 beta gamma

APA

TG we-Calculate Editorial Team. (2026). Viral Infection SIR Model Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/viral-infection-sir-calculator

Chicago

TG we-Calculate Editorial Team. "Viral Infection SIR Model Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/viral-infection-sir-calculator.

IEEE

TG we-Calculate Editorial Team, "Viral Infection SIR Model Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/viral-infection-sir-calculator

BibTeX

@misc{wecalculate_viral_infection_sir_calculator, title = {Viral Infection SIR Model Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/viral-infection-sir-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?