Skip to content
Omnikalc

Relative risk, odds ratio and NNT calculator

Compare event rates in two groups with the relative risk, odds ratio, absolute risk reduction and number needed to treat, with confidence intervals.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Value out of range

Results

Relative risk (RR)

0.600

Lower risk in the exposed or treated group

Odds ratio (OR)

0.529

Number needed to treat (or harm)

10.0

RR confidence interval: lower bound
0.337
RR confidence interval: upper bound
1.068
The interval includes 1: the difference is not statistically significant
OR confidence interval: lower bound
0.260
OR confidence interval: upper bound
1.078
Absolute risk reduction (control − exposed)
10.00%
Relative risk reduction
40.0%

Measuring the effect of an exposure or treatment

Clinical trials and epidemiological studies compare how often an event happens in two groups: treated and untreated, exposed and unexposed. Several measures describe the difference, and each answers a slightly different question.

The 2 × 2 table

Event No event
Exposed or treated a b
Control c d

The formulas

  • Risk in each group: a ÷ (a + b) and c ÷ (c + d)
  • Relative risk RR = risk in exposed ÷ risk in control
  • Odds ratio OR = (a × d) ÷ (b × c)
  • Absolute risk reduction ARR = risk in control − risk in exposed
  • Number needed to treat NNT = 1 ÷ |ARR|
  • Relative risk reduction RRR = 1 − RR
  • Confidence interval for RR: exp(ln RR ± z × √(1/a − 1/(a + b) + 1/c − 1/(c + d)))

Worked example

In a trial, 15 of 100 treated patients and 25 of 100 control patients have a heart attack.

  1. Risks: 15% and 25%.
  2. RR = 0.15 ÷ 0.25 = 0.60: treatment lowers the risk by 40% in relative terms.
  3. ARR = 25% − 15% = 10 points.
  4. NNT = 1 ÷ 0.10 = 10: treating 10 patients prevents one heart attack.
  5. OR = (15 × 75) ÷ (85 × 25) ≈ 0.53.
  6. 95% confidence interval for RR: 0.34 to 1.07. It includes 1, so with only 200 patients the result is not statistically significant.

Relative or absolute?

Relative measures sound more impressive. A drug that cuts risk from 2% to 1% has an RRR of 50% but an ARR of only 1 point and an NNT of 100. Good reporting gives both, so patients can weigh the benefit against side effects and cost.

Odds ratio or relative risk?

  • In cohort studies and trials, use the relative risk, which is easier to interpret.
  • In case-control studies, participants are chosen by outcome, so risks cannot be computed and the odds ratio is used.
  • When the event is rare (under about 10%), the OR is close to the RR. When it is common, the OR exaggerates the effect.

Number needed to harm

When the exposure increases the risk, 1 ÷ |ARR| is the number needed to harm: how many people must be exposed for one extra adverse event.

This calculator is for general information and education. It is not medical advice and does not replace the judgment of a doctor, nurse or pharmacist who knows the full clinical picture.

Frequently asked questions

What is the difference between relative risk and odds ratio?

Relative risk compares probabilities: 15% ÷ 25% = 0.6. The odds ratio compares odds: (15/85) ÷ (25/75) ≈ 0.53. They are close when the event is rare and diverge when it is common.

What is the number needed to treat?

NNT = 1 ÷ absolute risk reduction. If treatment lowers the risk from 25% to 15%, 10 people need to be treated to prevent one event.

How do I read the confidence interval?

If the interval for the relative risk or odds ratio includes 1, the data are compatible with no difference at that confidence level. In the example, the 95% interval for RR runs from 0.34 to 1.07.

When should I use the odds ratio?

In case-control studies, where participants are selected by outcome, the relative risk cannot be estimated directly and the odds ratio is used instead. Logistic regression also reports odds ratios.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.