Odds Ratio Calculator

Share calculator:
Embed this tool:

Enter the number of events and non-events in an exposed group and a control group to get the odds ratio, its confidence intervals at the level you choose, and a p-value for the null of no association.

Using the odds ratio calculator

The calculator works from a two-by-two table of counts. Fill in four boxes: how many people in the exposed group had the outcome, how many did not, and the same two numbers for the control (baseline) group. Then choose a confidence level, 95 by default, and press the button.

How the four inputs map onto the table
EventNo event
Exposed groupEvents in exposed groupNon-events in exposed group
Control groupEvents in the control groupNon-events in the control group

You get back the odds ratio, a two-sided confidence interval, a left-sided and a right-sided interval, the p-value and the z-score. Each count must be at least 1, and decimals are cut to whole numbers, because the inputs are people or occurrences rather than measurements. If one of your cells is truly zero, see the section on zero cells below.

Statistical results describe the data you enter. They are not medical or professional advice; see the disclaimer.

Odds, and the odds ratio built from them

Odds compare the number of times something happens with the number of times it does not. If 20 of 100 people have an outcome, the risk is 20/100 = 0.20, but the odds are 20/80 = 0.25, or "one to four". Odds and probability carry the same information, but odds run from 0 to infinity while a probability stops at 1.

The odds ratio (OR) divides the odds in the exposed group by the odds in the control group:

OR = (a ÷ b) ÷ (c ÷ d) = (a × d) ÷ (b × c)a, b: events and non-events in the exposed group; c, d: events and non-events in the control group

  • OR = 1: the exposure and the outcome are not associated; the odds are the same in both groups.
  • OR > 1: the odds of the outcome are higher in the exposed group.
  • OR < 1: the odds of the outcome are lower in the exposed group, so the exposure looks protective.

A ratio of 2.43 means the odds in the exposed group are about 2.43 times the odds in the control group. It does not mean the probability is 2.43 times as large, which is why the next section matters.

Odds ratio versus risk ratio

The risk ratio (relative risk) compares probabilities, the odds ratio compares odds. They are close only when the outcome is rare. Take 30 events among 100 exposed people and 15 among 100 controls: the risk ratio is 0.30 ÷ 0.15 = 2.00, but the odds ratio is (30 ÷ 70) ÷ (15 ÷ 85) ≈ 2.43. The more common the outcome, the further the odds ratio drifts away from the risk ratio.

Case-control studies fix the number of cases and controls in advance, so risks cannot be estimated and the odds ratio is the natural measure. Logistic regression also reports its coefficients as odds ratios. When you have a cohort or a trial and want a statement about risk, use the relative risk calculator; for outcomes that unfold over time, see the hazard ratio calculator.

Standard error and confidence interval formula

The distribution of an odds ratio is skewed, so the interval is built on the logarithmic scale, where the estimate is close to normal, and then converted back. The standard error of the log odds ratio (Woolf's method) uses only the four counts:

SE = √(1/a + 1/b + 1/c + 1/d)

interval = exp( ln(OR) ± z × SE )z is 1.96 for a 95% two-sided interval

Because the interval is symmetric around ln(OR), not around OR, it is wider above the estimate than below it. The z-score reported by the calculator is |ln(OR)| ÷ SE, and the p-value is the area in one tail of the standard normal beyond that z. Double it if you need a two-sided p-value for the hypothesis that OR = 1.

Worked example

A survey finds 30 of 100 users of a new feature churned, against 15 of 100 non-users. So a = 30, b = 70, c = 15, d = 85.

  1. Odds ratio: (30 × 85) ÷ (70 × 15) = 2550 ÷ 1050 ≈ 2.4286.
  2. Standard error: √(1/30 + 1/70 + 1/15 + 1/85) = √0.12605 ≈ 0.3550.
  3. Log odds ratio: ln(2.4286) ≈ 0.8873, so z = 0.8873 ÷ 0.3550 ≈ 2.499.
  4. 95% interval: exp(0.8873 ± 1.96 × 0.3550) = exp(0.1914) to exp(1.5832), which is about 1.21 to 4.87.

The interval excludes 1, and the one-sided p-value is about 0.0062, so the data are not compatible with equal odds at the 5% level. The calculator returns the same figures: OR 2.428571, interval [1.211 , 4.870], z 2.499194.

One-sided versus two-sided intervals

A two-sided interval gives a lower and an upper limit and puts the leftover probability, 5% at the 95% level, half in each tail. A left-sided interval has only a lower limit, [L, +∞): it answers "how small could the odds ratio plausibly be?". A right-sided interval has only an upper limit, (-∞, U]: it answers "how large could it be?". The one-sided limits use z = 1.645 rather than 1.96 at the 95% level, so a one-sided lower bound sits closer to the estimate than the two-sided one.

Choose a one-sided interval only if you decided before seeing the data that a difference in just one direction matters. Otherwise report the two-sided interval. For other intervals and tests see the confidence interval calculator and the p-value calculator.

Limits and common mistakes

  • Zero cells. The formula divides by every count, so a zero makes the odds ratio zero or undefined. A common fix is to add 0.5 to each cell (the Haldane-Anscombe correction) before entering whole numbers; report that you did so.
  • Small counts. The normal approximation behind the interval is weak when any cell is below about 5. Exact methods such as Fisher's test are safer there.
  • Swapped groups. Putting the control group in the exposed boxes turns OR into 1/OR. Check which direction your sentence describes.
  • Confounding. A crude odds ratio from one table ignores other variables. Adjusted estimates need stratification or regression.
  • Reading OR as risk. For common outcomes, saying "2.4 times as likely" overstates the effect; say "2.4 times the odds".

Frequently asked questions

What is a good odds ratio?

There is no universal threshold. An odds ratio of 1 means no association, values above 1 mean higher odds in the exposed group and values below 1 mean lower odds. What counts as important depends on the field, the baseline risk and whether the confidence interval excludes 1.

How do I know if an odds ratio is statistically significant?

Check whether the two-sided confidence interval contains 1. If it does not, the result is significant at the matching level (for example 5% for a 95% interval). The calculator also reports the z-score and a one-sided p-value; double the p-value for a two-sided test.

Can the odds ratio be negative?

No. Odds are never negative, so the odds ratio ranges from 0 to infinity. Its logarithm can be negative, which corresponds to an odds ratio below 1.

Why must every cell be at least 1?

The odds ratio and its standard error divide by all four counts, so a zero cell makes the calculation break down. Add a small continuity correction to the table, or use an exact method, when a cell is empty.

References

  1. Bland JM, Altman DG. The odds ratio. BMJ 2000;320:1468.
  2. Woolf B. On estimating the relation between blood group and disease. Annals of Human Genetics 1955;19:251-253.
  3. Agresti A. Categorical Data Analysis, 3rd edition. Wiley, 2013.

Cite this calculator and page

If you use this page in your work, you can cite it as:

Reeliy Editorial Team. (2026). Odds Ratio Calculator. Reeliy. https://reeliy.com/calculators/odds-ratio-calculator“Odds Ratio Calculator.” Reeliy, 2026, https://reeliy.com/calculators/odds-ratio-calculator.