Odds ratio and relative risk are the two standard ways researchers quantify how strongly an exposure is associated with an outcome from a 2×2 contingency table. They answer a similar question in different currencies — odds versus probability — and picking the right one depends on how your study was designed.
How the calculator works
This calculator takes your four cell counts and computes the odds ratio as OR = (a×d)/(b×c) and the relative risk as RR = [a/(a+b)] / [c/(c+d)]. Confidence intervals for both use Woolf's log method: the standard error is calculated on the natural-log scale, added to and subtracted from the log of the point estimate, then exponentiated back to a normal ratio. This is the same approach used in most statistical software and textbooks, and it works well for moderate-to-large samples.
If any single cell in your table is 0, a raw odds ratio calculation would divide by zero. The calculator automatically applies the Haldane-Anscombe continuity correction — adding 0.5 to every cell — so you still get a usable estimate, and it tells you when that correction was applied.
Odds ratio vs. relative risk — which one applies?
In a cohort or randomized study, where you follow defined groups forward in time and observe how many develop the outcome, both odds ratio and relative risk are valid, and relative risk is usually the more intuitive number to report. In a case-control study, where you select subjects based on their outcome status and look backward at exposure, the group sizes are chosen by the researcher rather than reflecting true population incidence — so relative risk is not meaningful there, and the odds ratio is the correct (and often the only) measure to report.
When the outcome is rare (roughly under 10% in both groups), the odds ratio closely approximates the relative risk, which is part of why OR is so commonly used as a stand-in for RR in case-control research. As the outcome becomes more common, the two measures diverge — the odds ratio always moves further from 1 than the relative risk does, in the direction of the effect.
Reading the confidence interval
A 95% confidence interval means that if you repeated the same study many times, about 95% of the intervals you'd calculate would contain the true population odds ratio (or relative risk). The practical shortcut: if the interval for the odds ratio does not include 1, the association is statistically significant at that confidence level. A wide interval usually signals a small sample — collecting more data narrows it.
This tool reports standard-error-based intervals, which are a widely used approximation but can behave oddly with very small or very lopsided tables (for example, when one cell is 0 or 1). For small-sample or sparse tables, an exact method (such as Fisher's exact test) may be more appropriate than the log-based interval shown here — treat this calculator as a fast, standard estimate rather than a substitute for a full statistical analysis.