Skip to content

Odds Ratio Confidence Interval Calculator

Estimate the odds ratio between two groups from a 2 by 2 table of counts, with a confidence interval built on the log scale, where the odds ratio's sampling distribution behaves far better than it does on the raw scale.

What this answers

This calculator answers "how much higher or lower are the odds of an event in one group compared to another, and how precisely is that ratio estimated?" It works on any 2 by 2 table of counts, whether from a case-control study, a cross-sectional survey, or any other design that produces a table shaped this way.

How it is calculated

The odds ratio is (a times d) divided by (b times c) using the table's four cells. Because the odds ratio's sampling distribution is skewed on its natural scale but approximately normal on the log scale, the confidence interval is built in log space, using a standard error from the reciprocals of all four cell counts, then converted back with the exponential function. When any single cell is exactly 0, the log odds ratio would otherwise be undefined, so this calculator automatically applies the standard 0.5 (Haldane-Anscombe) continuity correction to every cell and flags that it did so.

Worked example

For a table of 10 events and 20 non-events in Group 1, and 5 events and 25 non-events in Group 2, the odds ratio is (10 times 25) divided by (20 times 5), exactly 2.5. The 95% confidence interval, built from the log-odds standard error of about .625, spans roughly .74 to 8.5, a wide range reflecting the relatively small cell counts involved.

Assumption audit

Calculated from your data: the odds ratio itself, its log-scale standard error, and whether any cell was exactly 0 (triggering the automatic continuity correction).
Evidence to review: how small the smallest cell count is; very sparse cells make this Wald-based interval less reliable, and an exact method such as Fisher's Exact Test may be more appropriate for the accompanying significance test.
You must verify: your table's orientation (which row and column mean what) before interpreting the direction of the ratio, and that the odds ratio is the right measure for your design, since it can substantially overstate the relative risk when the event is common.

What this result does not mean

An odds ratio is not the same as a risk ratio, and treating it as one overstates the effect whenever the outcome is not rare; use the Risk Ratio Confidence Interval Calculator directly if you have cohort-style data with a known denominator and want a risk ratio instead.

Limitations

The automatic continuity correction changes the estimate itself, not just the interval, so a table with a zero cell should be treated as a genuinely uncertain estimate regardless of how narrow the corrected interval happens to look.