Calculateus

Relative Risk & Odds Ratio Calculator

Calculate relative risk and odds ratio from a 2x2 exposure/outcome contingency table.

Result

Relative Risk (RR)
2
Odds Ratio (OR)
2.429
Risk in Exposed Group
30%
Risk in Unexposed Group
15%

About the Relative Risk Calculator

This calculator computes relative risk and odds ratio from a 2x2 exposure-by-outcome table, the two core measures epidemiologists and researchers use to quantify how strongly an exposure is associated with an outcome. It is built for cohort-style data where you know the full count of exposed and unexposed subjects, split by whether the event occurred.

How It Works

You enter four counts: exposed subjects with the event (a) and without it (b), and unexposed subjects with the event (c) and without it (d). The calculator divides each group's event count by its own row total to get risk in the exposed group and risk in the unexposed group, then divides the two to get relative risk. Odds ratio is computed separately, directly from the cross-product of the four cells rather than from the risk percentages.

Risk(exposed) = a / (a+b); Risk(unexposed) = c / (c+d); Relative Risk = Risk(exposed) / Risk(unexposed); Odds Ratio = (a x d) / (b x c).

Formula & Methodology

To work this by hand, first total each row: exposed total is a+b, unexposed total is c+d. Divide a and c by their respective totals to get the two risk percentages, then divide the exposed risk by the unexposed risk for RR. For the odds ratio, skip the risk calculation entirely and just cross-multiply: a times d, divided by b times c.

Examples

Cohort study with 100 per group

With a=30, b=70 (100 exposed) and c=15, d=85 (100 unexposed), risk in the exposed group is 30/100 = 30% and risk in the unexposed group is 15/100 = 15%, giving a relative risk of 2.0 and an odds ratio of (30 x 85)/(70 x 15) = 2550/1050 = 2.429.

Smaller exposed group

With a=8, b=42 (50 exposed) and c=20, d=180 (200 unexposed), risk is 8/50 = 16% in the exposed group versus 20/200 = 10% in the unexposed group, giving a relative risk of 1.6 and an odds ratio of (8 x 180)/(42 x 20) = 1440/840 = 1.714.

Advantages

  • Reports both relative risk and odds ratio side by side, so you can present the more intuitive relative risk when group sizes are known and fall back on odds ratio for case-control comparisons.
  • Shows the underlying risk percentage for each group individually, not just the ratio between them, making it easier to sanity-check the inputs.
  • Applies input guards that catch impossible or undefined table configurations before returning a misleading number.

Common Mistakes

  • Reading an odds ratio as if it were a relative risk when the outcome is common, which overstates the strength of association since OR diverges from RR as event rates rise.
  • Swapping the exposed and unexposed rows, which flips the direction of the association and can turn an apparent risk factor into an apparent protective factor.
  • Using relative risk from case-control data where true population risk is unknown, when odds ratio is the statistically appropriate measure for that study design.

Edge Cases to Watch For

  • Both group totals (a+b and c+d) must be greater than zero, since risk requires dividing by a nonzero group size.
  • The product b x c cannot be zero, because the odds ratio formula divides by it directly.
  • Risk in the unexposed group cannot be zero, since relative risk divides by it.
  • When the outcome is rare in both groups, relative risk and odds ratio tend to sit close together numerically even though they are computed differently; as the outcome gets more common, the odds ratio moves further from 1 than the relative risk does.

Common Use Cases

  • Epidemiologists and public health analysts quantifying the strength of association between an exposure and a health outcome.
  • Researchers summarizing results from a cohort or case-control study for a report or publication.
  • Students and instructors working through 2x2 contingency table problems in an introductory epidemiology or biostatistics course.
Written & fact-checked by the Calculateus TeamLast updated August 5, 2026How we verify our formulas

Frequently asked questions

What does a relative risk above 1 mean?

An RR above 1 means the exposed group had a higher rate of the outcome than the unexposed group (e.g., RR = 2 means twice the risk); RR below 1 means the exposure was associated with lower risk; RR = 1 means no difference between groups.

Why calculate both relative risk and odds ratio?

Relative risk is more intuitive and directly interpretable, but requires knowing the total group sizes (as in a cohort study). Odds ratio can be calculated even when only cases and controls are sampled (as in a case-control study) where true population risk isn't known - the two converge to similar values when the outcome is rare.

Conclusion

Relative risk and odds ratio answer related but distinct questions about an exposure-outcome relationship, and this calculator produces both from the same four table cells. Checking the underlying risk percentages alongside the ratios helps confirm the result matches what the raw data actually shows.