Relative Risk & NNT Calculator
Turn the events and group sizes of a cohort study or trial into relative risk with a 95% confidence interval, absolute and relative risk reduction, and the number needed to treat or harm.
Relative and absolute answer different questions
A trial reports its result as a two-by-two table: how many people in each group had the outcome and how many did not. The default example has 1,000 people in each arm, 30 events among the treated and 50 among the controls. The risks are 3.0% and 5.0%. The relative risk (risk ratio) is 3.0 ÷ 5.0 = 0.60, so treated people had 60% of the control risk, a relative risk reduction of 40%. The absolute risk reduction is the plain difference, 5.0% − 3.0% = 2.0 percentage points, and the number needed to treat is its reciprocal, 1 ÷ 0.02 = 50: fifty people treated for the length of the trial to prevent one event. Headlines quote the 40% because it sounds larger. Keep the same 40% reduction but start from a baseline risk of 0.5% and the treated risk becomes 0.3%, the absolute reduction 0.2 points and the NNT 500. The relative effect travels between populations reasonably well; the absolute benefit depends entirely on how likely the outcome was in the first place.
Reading the confidence interval
The interval for a ratio is calculated on the log scale, because ratios are skewed: 0.5 and 2.0 are equally far from 1. The Katz method gives the standard error of ln RR as √(1/a − 1/n₁ + 1/c − 1/n₀). For the example that is √(1/30 − 1/1,000 + 1/50 − 1/1,000) = 0.2266. The natural log of 0.60 is −0.511, and ±1.96 × 0.2266 = ±0.444, so the 95% interval runs from e^−0.955 = 0.385 to e^−0.067 = 0.935. It excludes 1, and the two-sided p value from the same z-test is 0.024. The risk difference has its own interval, 0.28 to 3.72 percentage points here, and inverting its ends gives an NNT interval of 27 to 352. That width is honest: the data are compatible with a treatment that prevents one event for every 27 people and with one that needs 352.
NNT, NNH and the time frame
The NNT is rounded up to a whole person, and it always belongs to a time period and a baseline risk: 50 over a five-year trial is not 50 per year. When the exposed group does worse, the same arithmetic gives the number needed to harm; a rise from 5.0% to 7.0% means one extra event for every 50 people exposed. If the interval of the risk difference crosses zero, the NNT interval runs from benefit through infinity to harm, which is why the calculator says so instead of printing two meaningless numbers. When a cell is zero, the log scale breaks down, so 0.5 is added to every cell (the Haldane correction): 0 of 100 against 5 of 100 gives a corrected RR of 0.091 with a very wide interval of 0.005 to 1.62.
Common misreadings
A relative risk of 0.60 is not “60% fewer events”, it is 40% fewer. Relative risk can only be estimated when the groups were followed forward, as in a cohort study or a trial; in a case-control study the investigator chose how many cases and controls to include, so the risks in each row are artefacts and the odds ratio must be used instead. Finally, a statistically significant relative risk says nothing about whether the absolute benefit is worth the cost, effort or side effects; that judgement belongs to clinicians, patients and guideline panels, not to a calculator.
How to use it
- Enter the number of people with the outcome and the total size of the exposed or treated group.
- Enter the same two numbers for the unexposed or control group.
- Read the relative risk and its 95% interval: below 1 the exposure is associated with fewer events, above 1 with more.
- Read the absolute risk difference and the NNT or NNH, and note the follow-up time of the study they came from.
- Check the notes for a zero-cell correction or an NNT interval that runs through infinity.
Questions from journal club
What is the difference between relative risk reduction and absolute risk reduction?
Relative risk reduction is the proportion of the baseline risk removed, 1 − RR; absolute risk reduction is the difference between the two risks in percentage points. A drop from 5% to 3% is a 40% relative reduction but only a 2-point absolute reduction, which corresponds to a number needed to treat of 50.
How is the number needed to treat calculated?
NNT is 1 divided by the absolute risk reduction, written as a proportion, and rounded up to the next whole person. A reduction from 5.0% to 3.0% is 0.02, so NNT = 1 ÷ 0.02 = 50. It only applies to the follow-up period and the baseline risk of the study it came from.
Why does the NNT confidence interval sometimes include infinity?
When the interval of the risk difference crosses zero, the data are compatible with benefit, no effect and harm. Inverting a number close to zero gives an enormous NNT, so the interval runs from an NNT at one end, through infinity, to a number needed to harm at the other. That is a sign the trial was inconclusive.
Can I calculate relative risk from a case-control study?
No. In a case-control study the researcher decides how many cases and controls to recruit, so the proportion with the outcome in each exposure group is set by the design, not by nature. Use the odds ratio instead; when the outcome is rare, under about 10%, the odds ratio is close to the relative risk.
Disclaimer: These calculators are for education and for reading published research only. They work with summary counts from studies and populations and do not diagnose disease, interpret an individual’s test result or advise on treatment, testing or vaccination. Study measures such as relative risk, NNT and predictive values describe groups, not individuals, and confidence intervals use standard approximations that can differ from exact methods in small tables. Do not use the results for personal health decisions: consult a qualified health professional, and follow national and local public health agencies on outbreaks, screening and vaccination.