Odds ratio calculator

Enter the four counts of a 2×2 table, such as cases and controls by exposure, to get the odds ratio, its confidence interval and a test of whether it differs from 1.

Odds ratio2.25
Confidence interval0.994295 – 5.09155
Natural log of the odds ratio
0.81093
Standard error of ln(OR)
0.416667
z statistic
1.94623
p-value, two-sided (OR = 1)
0.05163
Odds in the exposed group (a/b)
0.25
Odds in the unexposed group (c/d)
0.111111

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

How to use it

  1. Arrange the data with exposure in rows and outcome in columns.
  2. Enter a, b, c and d and choose the confidence level.
  3. Read the odds ratio, its interval and the p-value.
Outcome No outcome
Exposed a b
Not exposed c d

Formulas

  • Odds ratio: OR = (a × d) ÷ (b × c)
  • Standard error: SE = √(1/a + 1/b + 1/c + 1/d), on the log scale
  • Confidence interval: exp(ln OR ± z × SE), with z = 1.645, 1.960 or 2.576 for 90%, 95% or 99%
  • Test of OR = 1: z = ln OR ÷ SE, two-sided p from the normal distribution
  • If any cell is 0, ½ is added to all four cells first.

Worked example

20 of 100 exposed people and 10 of 100 unexposed people have the outcome: a = 20, b = 80, c = 10, d = 90.

OR = (20 × 90) ÷ (80 × 10) = 1800 ÷ 800 = 2.25. SE = √(1/20 + 1/80 + 1/10 + 1/90) = √0.1736 = 0.4167. ln 2.25 = 0.811, so the 95% interval is exp(0.811 ± 1.960 × 0.4167) = exp(−0.0057) to exp(1.628) = 0.99 to 5.09. It just includes 1, and p = 0.052.

Common mistakes

  • Swapping b and c inverts the odds ratio. Check that a and d are the “exposed with outcome” and “unexposed without outcome” cells.
  • Reporting an odds ratio as if it were a risk ratio overstates the effect when the outcome is common.

Frequently asked questions

How do I read an odds ratio?

An odds ratio of 1 means the outcome is equally likely in both groups. Above 1, the odds of the outcome are higher in the exposed group; below 1, lower. An OR of 2.25 means the odds are 2.25 times as high.

What does it mean if the interval includes 1?

Then the data are consistent with no association at that confidence level, and the two-sided p-value is above the matching α (for example above 0.05 for a 95% interval).

Is the odds ratio the same as relative risk?

No. They are close when the outcome is rare, but the odds ratio moves further from 1 when the outcome is common. Case-control studies can estimate only the odds ratio; cohort studies and trials can give relative risk.

What happens when a cell is zero?

The odds ratio would be 0 or infinite and its standard error not defined. The calculator then adds ½ to every cell, a common convention, and says so under the result.

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.