Relative risk and NNT calculator

Enter how many people in each group had the event and how many did not. You get the relative risk with its confidence interval, the absolute risk difference, the relative risk reduction and the number needed to treat.

Relative risk (risk ratio)0.5
Confidence interval of the relative risk0.287219 – 0.870415
Risk in group 1
15 %
Risk in group 2
30 %
Risk difference (group 1 − group 2)
-15 %
Confidence interval of the risk difference
-26.3864 % – -3.61364 %
Relative risk reduction
50 %
Number needed to treat (rounded up, exact)
7 (6.66667)

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Enter the events and non-events in group 1 (treated or exposed): a and b.
  2. Enter the same for group 2 (control or unexposed): c and d.
  3. Choose the confidence level and read the results.

Formulas

With risk r₁ = a/(a + b) in group 1 and r₂ = c/(c + d) in group 2:

  • Relative risk: RR = r₁ ÷ r₂, interval exp(ln RR ± z × SE) with SE = √(1/a − 1/(a + b) + 1/c − 1/(c + d))
  • Risk difference: RD = r₁ − r₂, interval RD ± z × √(r₁(1 − r₁)/(a + b) + r₂(1 − r₂)/(c + d))
  • Relative risk reduction: (r₂ − r₁) ÷ r₂ (shown as an increase when r₁ is larger)
  • NNT or NNH: 1 ÷ |RD|, rounded up
  • z = 1.645, 1.960 or 2.576 for 90%, 95% or 99%. If a or c is 0, ½ is added to every cell for the relative risk and its interval.

Worked example

In a trial, 15 of 100 treated patients and 30 of 100 controls had the event.

Risks: 15% and 30%. RR = 0.15 ÷ 0.30 = 0.5. SE = √(1/15 − 1/100 + 1/30 − 1/100) = √0.08 = 0.283; 95% interval 0.5 × e^(±1.960 × 0.283) = 0.29 to 0.87. Risk difference −15 percentage points, relative risk reduction 50%, and NNT = 1 ÷ 0.15 = 6.67, rounded up to 7.

Common mistakes

  • Quoting only the relative reduction. Always give the absolute risks or the NNT alongside it.
  • Rounding the NNT down: 6.67 means 7 people, because you cannot treat part of one.

Frequently asked questions

What is the difference between relative and absolute risk reduction?

Absolute risk reduction is the plain difference in risk, for example 30% − 15% = 15 percentage points. Relative risk reduction divides that by the control risk: 15 ÷ 30 = 50%. A large relative reduction can be a tiny absolute one when the event is rare.

How is the number needed to treat calculated?

NNT = 1 ÷ |risk difference|, rounded up to a whole person. A risk difference of 15 percentage points gives 1 ÷ 0.15 = 6.67, so 7 people need treatment for one to benefit. If group 1 has the higher risk, the same number is the number needed to harm.

Which group should be group 1?

Put the treated or exposed group in the first row and the control or unexposed group in the second. Swapping them inverts the relative risk.

Relative risk or odds ratio?

Relative risk is easier to explain and is used for cohort studies and trials. Case-control studies cannot estimate risk directly, so they report the odds ratio.

More in Math

All tools in this category: Math ·Updated November 4, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.