Tools  /  free calculator

Odds ratio and relative risk calculator

Enter a 2×2 table. You get the odds ratio and risk ratio with 95% confidence intervals, absolute risk reduction, number needed to treat, a chi-square test, and a sentence you can paste into your results.

Exposed group
Unexposed group
A zero cell was present, so 0.5 has been added to every cell (the Haldane-Anscombe correction). Report that you did this.
Odds ratio (95% CI)
Risk ratio (95% CI)
Risk: exposed vs unexposed
Absolute risk difference
Number needed to treat
Chi-square test
Report it like this
An odds ratio from observational data is not a causal effect

Confounding, selection and measurement bias all sit between this number and a claim about cause. Adjusting for them requires a model, not a 2×2 table — and it is the first thing a reviewer will ask about.

Statistical consultancy →
Sidra Khan This calculator was checked by Sidra Khan, Lead Biostatistician

In short

How do you calculate an odds ratio?

Answer

An odds ratio is the odds of an outcome in the exposed group divided by the odds in the unexposed group, calculated from a 2×2 table as (a×d)/(b×c). Its 95% confidence interval is found on the log scale. If the interval excludes 1, the association is statistically significant at the 5% level.

Send the data. Get a fixed quote.

Attach your dataset or just describe the project. A named statistician replies with a price and a deadline, usually within one working day.