Skip to content
CalculatorAtlas

Odds Ratio Calculator

Tested

Odds ratio from a 2×2 table.

Tested, not yet published. The formula for this calculator is implemented and passes its automated checks. This page stays non-indexable until it is reviewed and published.

Results

Enter your values and press Calculate. Results appear here.

  • • Result

Quick answer

The odds ratio from a 2×2 table is OR = (a × d) ÷ (b × c). With 20 exposed with the outcome, 80 exposed without, 10 unexposed with and 90 unexposed without, OR = (20 × 90) ÷ (80 × 10) = 2.25, with a 95% CI of 0.99 to 5.09.

Enter the four cells of the 2×2 table. The calculator returns the odds ratio and its 95% confidence interval.

Related tools: Sample Size Calculator: Sample size for estimating a mean or a proportion. Confidence Interval Calculator: Confidence interval for a mean (t or z). Point Estimate Calculator: Point estimates of a proportion (MLE, Laplace and Wilson).

How to use the Odds Ratio Calculator

  1. Enter exposed with outcome (a) (0 or more).
  2. Enter exposed without outcome (b) (0 or more).
  3. Enter unexposed with outcome (c) (0 or more).
  4. Enter unexposed without outcome (d) (0 or more).
  5. Press Calculate to see the result, and use Reset to start again.
Inputs of the Odds Ratio Calculator
InputWhat to enterAllowed values
Exposed with outcome (a)A number≥ 0
Exposed without outcome (b)A number≥ 0
Unexposed with outcome (c)A number≥ 0
Unexposed without outcome (d)A number≥ 0

Formula and method

Formula

OR = (a × d) ÷ (b × c)

IEEE-754 double precision; shown to at most 6 decimal places.

b and c must be non-zero. The 95% interval uses the log-odds standard error √(1/a + 1/b + 1/c + 1/d).

Worked examples

This example is verified: each one is an automated test case that the live calculator must reproduce exactly.

Example 1

Inputs: Exposed with outcome (a) = 20; Exposed without outcome (b) = 80; Unexposed with outcome (c) = 10; Unexposed without outcome (d) = 90.

Results of example 1
ResultValue
Odds ratio2.25
95% CI0.99 to 5.09

The first line is the headline result (odds ratio). Below it the odds Ratio Calculator lists 95% CI, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.

Reading it

An OR of 2.25 means the odds of the outcome are 2.25 times higher in the exposed group. Because the interval (0.99 to 5.09) includes 1, the result isn't statistically significant at the 5% level.

OR versus relative risk

The OR approximates the relative risk only when the outcome is rare. Here the relative risk is 2.0 (0.2 ÷ 0.1), smaller than the OR. All cells must be positive for the interval.

How the result changes with exposed with outcome

Holding every other input at the first worked example, this table changes only exposed with outcome. It shows how sensitive the answer is to that one value; each row was produced by running this calculator.

How the result changes with exposed with outcome
Exposed with outcomeOdds ratio95% CI
101.1250.45 to 2.84
202.250.99 to 5.09
404.52.11 to 9.58
8094.37 to 18.55

What happens with invalid input

These messages are produced by the calculator itself, so you know what to fix.

  • Exposed without outcome (b): entering "0" shows "Cells b and c must be non-zero." beside that field and no result.

Choosing between the Odds Ratio Calculator and similar calculators

Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.

Choosing between the Odds Ratio Calculator and similar calculators
CalculatorYou enterIt returns
[Sample Size Calculator](/statistics/sample-size-calculator/)estimate a, confidence level and margin of errorRequired sample size
[Confidence Interval Calculator](/statistics/confidence-interval-calculator/)sample mean, standard deviation and sample sizeConfidence interval
[Point Estimate Calculator](/statistics/point-estimate/)successes and trialsSample proportion
[Standard Error Calculator](/statistics/standard-error-calculator/)statistic, standard deviation or proportion p and sample sizeStandard error
[Margin of Error Calculator](/statistics/margin-of-error-calculator/)for a, confidence level and σ or proportion pMargin of error

Background: hypothesis testing and inference

A hypothesis test compares a test statistic with what the null hypothesis predicts. The decision rule is to reject the null hypothesis when the p-value is at or below the significance level α, which you should choose before seeing the data (0.05 is conventional, not special). For a two-tailed z test the p-value is 2 × (1 − Φ(|z|)); for a one-sample t test the statistic is (x̄ − μ₀) ÷ (s ÷ √n) with n − 1 degrees of freedom.

Failing to reject the null hypothesis does not prove it true, and a statistically significant result can still be too small to matter in practice.

Assumptions and limitations

  • All cells positive for the interval

If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for exposed without outcome (b) to confirm this.

Frequently asked questions

What does OR = 1 mean?

An odds ratio of 1 means the odds of the outcome are the same in both groups, so there's no association.

What if the interval includes 1?

The result isn't significant.

What is used in case-control studies?

Case-control studies use the odds ratio, because they fix the number of cases and controls so risk can't be computed directly.

What does the Odds Ratio Calculator calculate?

Odds ratio from a 2×2 table. It returns Odds ratio and 95% CI.

What formula does the Odds Ratio Calculator use?

OR = (a × d) ÷ (b × c). b and c must be non-zero.

What do I need to enter in the odds Ratio Calculator?

You enter Exposed with outcome (a), Exposed without outcome (b), Unexposed with outcome (c) and Unexposed without outcome (d).

How is the result rounded or limited?

IEEE-754 double precision; shown to at most 6 decimal places. All cells positive for the interval.

What is an example of a odds Ratio result?

With exposed with outcome (a) 20, exposed without outcome (b) 80, unexposed with outcome (c) 10 and unexposed without outcome (d) 90, the odds ratio is 2.25.

Sources

  • NIST/SEMATECH e-Handbook of Statistical Methods (itl.nist.gov/div898/handbook)
  • Standard textbook definitions (e.g. Moore, McCabe & Craig, Introduction to the Practice of Statistics)

Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.