Skip to content
Calcipedia
Relative Risk Calculator instructional illustration

Relative Risk Calculator

Calculate relative risk (risk ratio), confidence interval, absolute risk difference, NNT, and NNH from a 2x2 cohort or trial table.

Last updated

2x2 cohort table

Enter event and non-event counts for exposed and unexposed groups. The calculator reports the risk ratio, confidence interval, absolute risk difference, and NNT or NNH so the relative effect is not read without its baseline-risk context.

Exposed group

Unexposed group

Use counts, not percentages. Relative risk is most natural for cohort studies, trials, or other data where each group's event probability can be estimated directly.

Relative Risk

2

The exposed group has 100.0% higher risk compared to the unexposed group. The 95% CI crosses 1, so this table does not show a statistically clear difference at that interval.

Risk in exposed
20.00%
100 people in the exposed group.
Risk in unexposed
10.00%
100 people in the comparison group.
95% CI
0.986563 – 4.054479
Absolute risk increase
10.00%
Relative risk increase
100.0%
Statistical signal
CI crosses 1
NNH (Number Needed to Harm)
10

How to interpret

A relative risk of 1 means equal risk in both groups. Values above 1 indicate increased risk in the exposed group; values below 1 indicate decreased risk. The confidence interval shows the range of plausible values — if it crosses 1, the result is not statistically clear at the selected confidence level.

← All Statistics calculators

Epidemiology & Statistics

Relative risk calculator: risk ratio, confidence interval, ARR, NNT and NNH

A relative risk calculator computes the risk ratio from a 2x2 contingency table. It compares the probability of an event in an exposed group to the probability in an unexposed group, providing the relative risk, confidence interval, absolute risk difference, and number needed to treat or harm. Use it when you have cohort, trial, or other direct event-count data and need both the relative effect and the baseline-risk context.

Computing relative risk from a 2x2 table

Relative risk (RR), also called risk ratio, is the ratio of the probability of an event in the exposed group to the probability in the unexposed group. An RR of 1 means no difference in risk. An RR greater than 1 means the exposure increases risk; less than 1 means it decreases risk.

The calculator uses the familiar 2x2 table layout: exposed with event, exposed without event, unexposed with event, and unexposed without event. It first converts each row into an event risk, then divides the exposed risk by the unexposed risk. Because the denominator is a risk rather than an odds value, the result is usually easier to explain to non-specialist readers than an odds ratio when the study design supports direct risk estimation.

The confidence interval is calculated using the log method. If the interval does not include 1, the result is statistically significant at the selected confidence level. The number needed to treat (NNT) or harm (NNH) is the reciprocal of the absolute risk difference.

Counts should represent independent observations. Do not enter percentages, rates per person-year, repeated measures from the same participant, or adjusted model estimates. If the table comes from a stratified analysis, regression model, matched-pair design, or survival analysis, the unadjusted risk ratio from this page may not match the appropriate published effect measure.

RR = [a/(a+b)] / [c/(c+d)]

Relative risk from a 2x2 table where a=exposed events, b=exposed non-events, c=unexposed events, d=unexposed non-events.

CI = exp(ln(RR) ± z × sqrt(1/a - 1/(a+b) + 1/c - 1/(c+d)))

Log-scale confidence interval for the risk ratio. The z value changes with the selected 90%, 95%, or 99% confidence level.

ARD = a/(a+b) - c/(c+d); NNT or NNH = 1 / |ARD|

Absolute risk difference and the corresponding number needed to treat or harm.

How to read the result

Start with the two row risks before reading the headline relative risk. A relative risk of 2 can mean 2% versus 1%, 20% versus 10%, or 80% versus 40%. The ratio is the same, but the practical meaning is very different because the absolute risk difference changes.

The absolute risk difference tells you how many extra events occur per person in the exposed group compared with the unexposed group. A positive difference is an absolute risk increase; a negative difference is an absolute risk reduction. The NNH or NNT converts that difference into a more concrete planning number, rounded up because you cannot treat or expose a fraction of a person.

The confidence interval describes precision, not just statistical significance. A wide interval means the table is compatible with a broad range of true risk ratios, often because the sample is small or events are rare. A narrow interval usually indicates that the table contains more information, although clinical, policy, or operational importance still depends on the size of the absolute risk difference.

When relative risk is the right effect measure

Relative risk is most natural for prospective cohort studies, randomized trials, and other designs where the event probability can be estimated directly in each group. In that setting the row totals represent the denominators at risk, so the ratio compares event probabilities in a way that maps cleanly to plain-language statements such as "twice the risk" or "40% lower risk".

Case-control studies usually cannot estimate the original event risk directly because participants are sampled based on outcome status. In that setting an odds ratio is usually the standard measure, and it may approximate the relative risk only when the event is uncommon in the source population. The calculator links naturally with the odds ratio calculator when the study design or reporting frame calls for odds rather than risk.

Hazard ratios are different again. A hazard ratio compares event intensity over time among participants still at risk, while relative risk compares cumulative event probability at a chosen endpoint. If follow-up time, censoring, or time-to-event modelling is central to the question, use a hazard-ratio or survival-analysis workflow instead of a simple 2x2 risk ratio.

Worked example

Suppose 30 of 100 exposed participants experience an event, while 15 of 100 unexposed participants experience the same event. The exposed risk is 30/100 = 30%, and the unexposed risk is 15/100 = 15%. The relative risk is 30% / 15% = 2.00.

The absolute risk difference is 30% - 15% = 15 percentage points, so the NNH is 1 / 0.15 = 6.67, rounded up to 7. That means roughly one additional event occurs for every seven people in the exposed condition compared with the unexposed condition, assuming the table represents comparable groups and the observed association is relevant to the decision being considered.

If the confidence interval excludes 1, the table supports a statistically clear association at the selected confidence level. If it crosses 1, the data remain compatible with no clear difference, even when the point estimate looks large. The point estimate, interval, baseline risks, and study design all need to be read together.

Zero cells, small samples, and limitations

A zero event count can make the plain log confidence interval undefined. This calculator keeps the observed point estimate visible and applies a 0.5 continuity correction to the confidence interval when at least one cell is zero. That makes the interval displayable, but it should be treated as an approximation rather than a definitive exact interval.

Small samples and sparse events can produce unstable risk-ratio estimates. If any expected cell count is very small, exact methods, Fisher exact testing, or specialist epidemiology software may be more appropriate. The CDC's Epi Info guidance also emphasizes checking table setup and independence assumptions before interpreting risk ratios and odds ratios.

The calculator does not adjust for confounding, clustering, censoring, unequal follow-up time, matching, covariates, survey weights, or multiple strata. It is best used as a transparent first-pass calculation for one unadjusted 2x2 table, not as a replacement for a planned statistical analysis.

Frequently asked questions

What is the difference between relative risk and odds ratio?

Relative risk compares probabilities (risk in exposed vs. unexposed). Odds ratio compares odds. For rare events, they approximate each other. For common events, odds ratios tend to overestimate the relative risk. Study design matters: relative risk is usually natural for cohort studies and trials where event risks are directly observable, while odds ratio is often the reporting frame for case-control studies and logistic-regression models.

What does NNT mean?

Number needed to treat (NNT) is how many patients or participants must receive the treatment for one additional participant to benefit. Lower NNT indicates a larger absolute effect. When the exposure increases risk, the same reciprocal calculation is usually labelled number needed to harm (NNH). The NNT or NNH depends on the absolute risk difference, so it can change even when the relative risk stays the same.

How can I check the relative risk calculator result manually?

The safest manual check is to follow the same formula one step at a time and compare that working with the calculator output. Divide exposed events by the exposed total, divide unexposed events by the unexposed total, then divide the first risk by the second risk. That catches sign errors, bracket mistakes, and input-order mixups without requiring any extra method beyond the underlying maths itself.

Is relative risk the same as risk ratio?

Yes. Relative risk and risk ratio are commonly used for the same ratio of two event probabilities. Some evidence-synthesis and epidemiology references prefer the term risk ratio because it is more explicit that the calculation divides one risk by another. The abbreviation RR is used for both terms.

What does a relative risk of 1 mean?

A relative risk of 1 means the event risk is the same in the exposed and unexposed groups. Values above 1 point to higher risk in the exposed group; values below 1 point to lower risk. Always check the confidence interval and absolute risk difference before deciding whether the result is precise or practically meaningful.

Why does the confidence interval crossing 1 matter?

A risk ratio of 1 represents no difference between the groups. If the confidence interval includes 1, the observed table is still compatible with no clear relative-risk difference at the selected confidence level. If the entire interval is above 1 or below 1, the table gives stronger evidence that the groups differ, although practical importance still depends on the absolute risks.

Can I use this calculator with percentages instead of counts?

No. Enter event and non-event counts, not percentages. The confidence interval depends on the denominators as well as the event rates. A 20% versus 10% comparison from 10 participants per group is much less precise than the same percentages from 10,000 participants per group.

What happens if one cell in the 2x2 table is zero?

The calculator still shows the observed point estimate when it is defined as zero or infinity, and it uses a 0.5 continuity correction for the confidence interval. That is useful for quick interpretation of sparse tables, but zero-cell intervals are approximate. For consequential analysis with sparse events, use exact or specialist methods.

When should I use absolute risk difference instead of relative risk?

Use both whenever possible. Relative risk summarizes the proportional change, while absolute risk difference shows the real event-rate gap. A large relative risk can be modest in absolute terms when baseline risk is tiny, and a moderate relative risk can matter a lot when baseline risk is high.

Can relative risk prove that the exposure caused the outcome?

No. Relative risk measures association in the entered table. Causal interpretation depends on study design, randomization or confounding control, measurement quality, follow-up, missing data, and whether the groups are genuinely comparable. Treat this calculator as an effect-measure tool, not a causal-inference engine.

Also in Statistics

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.