Odds Ratio Calculator

Enter exposed/unexposed case and control counts to compute odds ratio, relative risk, and 95% confidence intervals instantly.

2×2 Contingency Table

Enter the count of subjects in each cell.

Cases Controls Total
Exposed 40
Unexposed 60
Total 50 50 100

Cell Reference

Outcome + Outcome −
Exposed a b
Unexposed c d

OR = (a×d)/(b×c)  |  RR = (a/(a+c)) / (b/(b+d))

Results will appear here.
Odds Ratio (OR)
95% CI: —
Relative Risk (RR)
95% CI: —
Chi-Square
P-Value
NNT / NNH

Detailed Breakdown

Summary

Enter exposed/unexposed case and control counts to compute odds ratio, relative risk, and 95% confidence intervals instantly.

How it works

  1. Enter the four cell counts: exposed cases (a), unexposed cases (b), exposed controls (c), and unexposed controls (d).
  2. The odds ratio is computed as (a × d) / (b × c).
  3. The relative risk is (a / (a+c)) ÷ (b / (b+d)) — the ratio of outcome proportions.
  4. 95% confidence intervals are derived via the Woolf logit method: exp(ln(OR) ± 1.96 × SE), where SE = sqrt(1/a + 1/b + 1/c + 1/d).
  5. A chi-square statistic with Yates' correction tests whether the association differs from chance.
  6. An OR > 1 suggests increased odds in the exposed group; OR < 1 suggests decreased odds.

Use cases

  • Analyze case-control study data in epidemiology research.
  • Report effect size and confidence intervals for clinical trials.
  • Compare treatment vs. placebo response rates.
  • Evaluate risk factors for disease in retrospective studies.
  • Check statistical significance of a 2×2 contingency table.
  • Present OR and RR alongside p-values in academic papers.

Frequently Asked Questions

Last updated: 2026-06-11 · Reviewed by Nham Vu