Statistics

Odds Ratio Calculator

The case-control measure from a 2×2 table: odds ratio with its log-scale interval, the Haldane–Anscombe correction applied and NAMED at zero cells, and the risk ratio printed beside so the divergence is your finding, not a surprise.

Odds Ratio Calculator

Results recalculate instantly on every keystroke. Nothing you type is transmitted.

The 2×2 table
Odds ratio
—
95% Wald interval (log scale)—
The risk ratio, beside it—
Zero cells and the correction—
Design decides the measure—

What this result does not account for

  • 2×2 counts only — no Fisher exact interval (named as out of scope)
  • Wald log interval needs adequate counts; zero cells get the named +0.5 correction
● Zero-Server Execution Updated 11 Aug 2026 Reviewed by Sana Khalid IEEE-754 Double Precision

In short: Table a = 30, b = 70, c = 10, d = 90: the odds of the outcome among the exposed are 30/70; among the unexposed, 10/90. The odds ratio is (30×90)/(70×10) = 3.857143 — exposed odds are 3.86 times the unexposed odds, with a 95% Wald interval of (1.766603, 8.421560) built on the log scale (SE of ln OR = 0.398410). The risk ratio beside it is only 3.000000 — at this table’s 20% outcome rate the OR overstates the RR, exactly the divergence the rare-outcome rule exists for. And the design warning is on the page: in a case-control study the margins were set by the SAMPLER, so only the odds ratio is valid there — the RR column is what a COHORT study would have seen.

Formula

OR = (a×d)/(b×c) · SE(ln OR) = √(1/a + 1/b + 1/c + 1/d) · CI = e^(ln OR ± z·SE)

The interval lives on the LOG scale because the OR itself is bounded at 0 and unbounded above — symmetry there makes the normal approximation honest. Zero cells are handled by the Haldane–Anscombe +0.5 correction, and the page says so when it fires.

Worked Example

  1. Fill the four cells: exposed/unexposed crossed with outcome/no outcome.
  2. Read the OR and its interval; a span crossing 1 is no evidence of association.
  3. Compare the RR card — at rare outcomes they agree; here they visibly diverge.
  4. If a cell is zero, read the correction card: the +0.5 fix is applied and named, never silent.

Defaults: OR 3.857143, CI (1.766603, 8.421560), RR beside 3.000000 at a 20% outcome rate. A zero cell (a = 0) fires the Haldane–Anscombe correction and prints the corrected OR 0.061128 with the fix named.

Strengths & Limits Of This Model

Where this engine is strong

  • RR printed beside the OR so the divergence is owned, not discovered later
  • Zero-cell correction applied transparently and named on the card

Where it stops

  • No exact (Fisher) confidence interval
  • No stratified/Mantel–Haenszel pooling

Risk & accuracy notice. The odds ratio is the most misquoted number in applied research: “the odds tripled” becomes “the risk tripled” somewhere between the analysis and the headline. This page prints the RR beside the OR precisely so the gap is visible at your own table — quote the pair, or the rare-outcome argument that licenses the shortcut.

Practical Use Cases

Epidemiology

exposure–disease from case-control data

Marketing

channel vs conversion in a 2×2

Teaching

why the log scale, watched live

Methodology & Editorial Standards

Computation runs in IEEE-754 double precision at full internal precision; rounding to two decimal places occurs strictly at the display layer, so no cumulative drift enters the result. All monetary outputs use accounting presentation — grouped thousands, two decimals, negatives in parentheses — so figures can be transcribed directly into a model or working paper. Division-by-zero and out-of-domain inputs return an em-dash rather than a misleading number.

This engine was reconciled against an independent reference implementation and hand-verified for the worked example above before release. Our full five-stage review process is published on the About Us page.

Sana Khalid Principal Front-End Engineer · ApexConverter

Statistical inference, experiment design and numerical stability. Last reviewed: 11 August 2026.

Disclaimer. This calculator is provided for informational and modelling purposes only and does not constitute financial, tax, legal, medical, or engineering advice. Verify all figures with a qualified professional before acting on them.


Odds Ratio Calculator — 8 Expert FAQs

8 analyst-written answers to the questions practitioners actually ask — optimised for voice and answer-engine retrieval.

Why does the interval live on a log scale?

The OR cannot be negative and has no ceiling, so its distribution is skewed; taking logs makes it symmetric enough for the normal approximation to be honest. The interval is built as ln OR ± 1.959964×SE and exponentiated back — which is also why the printed span is asymmetric around 3.857143: (1.766603, 8.421560).

Why do OR and RR disagree here?

Because odds and risks are different scales. The OR (3.857143) compares 30/70 against 10/90; the RR (3.000000) compares 0.30 against 0.10. They agree only when the outcome is rare — a common rule of thumb puts the working border near 10%. At this table’s 20% rate the OR visibly overstates the RR, and the card prints both so the gap is a finding, not a trap.

What happens when a cell is zero?

The raw OR collapses to 0 or runs off unbounded and no interval exists. The page applies the Haldane–Anscombe correction — 0.5 added to every cell — and NAMES it on the card: at a = 0 the corrected OR is 0.061128. A corrected estimate is an estimate with a declared patch, which is the only honest kind.

Why is the OR the only valid case-control measure?

Because a case-control study fixes the case/control margins by sampling decision, not by nature: the true risks are not estimable from the table. Odds survive that sampling — the OR is unchanged whatever the margins — which is exactly why case-control literature speaks in odds.

My table is a cohort table — should I quote the OR?

You may, but the RR page is your tool: with a cohort or trial the risks ARE estimable, and the RR is the more honest headline. The two pages cross-link; quote the measure your design licenses, and let the rarity of the outcome decide how close the other one would have been.

What does OR = 1 mean?

That exposure changes nothing: the odds are identical in both arms, and the interval’s job is to say how near 1 your data force the answer to sit. An interval that crosses 1 — however impressive the point estimate — contains the world where exposure does nothing.

Why 1.959964 and not 2?

Because the site computes z* live from the erf-series curve: the exact 97.5th percentile is 1.959964, and 2 is its rounded shadow. Every interval on this site uses the same bisected value, so CIs here and on the confidence-interval page agree to the last digit.

Can I enter rates instead of counts?

No — the four cells are COUNTS of people (or units), and the Woolf SE is built from count reciprocals. A rate like 30% must first become counts somewhere honest: 30 of 100. Feeding percentages into the cells would compute a confident answer to a table that never existed.

Related Statistics Engines