Odds Ratio Calculator

Turn a 2x2 table into an odds ratio with a confidence interval and group risks.

Health and FitnessUpdated 2026-10-202 min read
Odds Ratio Calculator
People with the exposure who had the outcome.
People with the exposure who did not have the outcome.
People without the exposure who had the outcome.
People without the exposure who did not have the outcome.
Odds ratio
...
Confidence interval...
Risk in exposed group...
Risk in unexposed group...
Direction...

What it does

An odds ratio compares the odds of an outcome in an exposed group with the odds in an unexposed group. It is the usual measure in case-control studies and a compact summary for any 2x2 table.

This calculator takes the four cell counts, forms the cross-product ratio, and adds a confidence interval using the standard log-odds approximation. It also shows the risk in each group so you can see the absolute scale behind the ratio.

The defaults describe 100 cases among 2,000 exposed people and 80 cases among 8,000 unexposed people. The odds ratio is 5.21 with a 95% interval of 3.87 to 7.02, and the two risks are 5% and 1%.

Odds and risk are not interchangeable. When the outcome is common, an odds ratio is farther from 1 than the corresponding risk ratio, so a value of 5.21 should not be read as five times the risk. The interval and the group risks belong next to the estimate whenever you report it.

How to use

  1. Enter the number of exposed people who had the outcome in cell a.
  2. Enter the number of exposed people who did not have the outcome in cell b.
  3. Enter the number of unexposed people who had the outcome in cell c.
  4. Enter the number of unexposed people who did not have the outcome in cell d.
  5. Pick a 90%, 95%, or 99% confidence level.
  6. Press Calculate and read the odds ratio, interval, and group risks.

Formula

OR = (a x d) / (b x c). SE(ln OR) = sqrt(1/a + 1/b + 1/c + 1/d). CI = exp(ln OR ± z x SE).
a
Exposed people with the outcome.
b
Exposed people without the outcome.
c
Unexposed people with the outcome.
d
Unexposed people without the outcome.
OR
Odds ratio, the odds in the exposed group divided by the odds in the unexposed group.
z
Normal multiplier: 1.645 for 90%, 1.96 for 95%, or 2.576 for 99%.

The tool adds 0.5 to every cell when any count is zero, which keeps the logarithm finite but changes the estimate. The interval is a large-sample approximation and can be unreliable when the cell counts are small. Both exposure groups must contain at least one person.

Worked example

Example: 100 exposed cases and 80 unexposed cases

Defaults: a = 100, b = 1,900, c = 80, d = 7,920, confidence level 95%.

  1. Exposed odds: 100 / 1,900 = 0.05263.
  2. Unexposed odds: 80 / 7,920 = 0.01010.
  3. OR = 0.05263 / 0.01010 = 5.21.
  4. SE of ln(OR) = sqrt(1/100 + 1/1,900 + 1/80 + 1/7,920) = 0.1522.
  5. 95% interval: exp(ln 5.21 ± 1.96 x 0.1522) = 3.87 to 7.02.
  6. Risks: 100 / 2,000 = 5 % and 80 / 8,000 = 1 %.

Reference table

Reading an odds ratio
Odds ratioPlain reading
Below 1Lower odds of the outcome with exposure.
1The odds are the same in both groups.
Above 1Higher odds of the outcome with exposure.
5.21The example estimate: higher odds, with an interval above 1.

Limits

  • Case-control data estimate odds, not incidence, so the OR is not a direct risk ratio.
  • The OR is close to the risk ratio only when the outcome is rare in both groups.
  • The 0.5 correction for a zero cell is a convention, not extra evidence.
  • Matched, weighted, or clustered data need a different analysis.

Common mistakes

  • Putting group totals in the case and non-case cells.
  • Swapping the exposed and unexposed rows, which inverts the ratio.
  • Calling the odds ratio a risk ratio when the outcome is common.
  • Leaving out the baseline risk, which decides the absolute size of the effect.
  • Treating a confidence interval that crosses 1 as proof of no effect.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is the odds ratio for 20 exposed cases, 80 exposed non-cases, 10 unexposed cases, and 90 unexposed non-cases?

OR = (20 x 90) / (80 x 10) = 2.25. The 95% interval is 0.99 to 5.09, so it includes 1.

Both groups have 30 cases and 70 non-cases. What does the tool show?

OR = 1 with a 95% interval of 0.55 to 1.83. The odds are identical in the two groups.

Cell a is zero: 0 exposed cases, 50 exposed non-cases, 5 unexposed cases, and 95 unexposed non-cases. What happens?

The tool adds 0.5 to every cell and reports OR 0.17 with a 95% interval of 0.01 to 3.17.

Questions

When should I use an odds ratio?

Use it for case-control studies or any 2x2 table where odds are the natural measure. For a cohort study with a common outcome, a risk ratio is easier to interpret.

What does an odds ratio of 1 mean?

The odds of the outcome are the same in the exposed and unexposed groups.

Can I enter percentages instead of counts?

No. The standard error needs the four cell counts, and percentages do not carry the group sizes.

Why is the confidence interval so wide?

Small cell counts or a rare outcome leave little information on the log-odds scale, so the interval grows.

Is an odds ratio the same as relative risk?

No. They agree closely only when the outcome is rare. When the outcome is common, the odds ratio sits farther from 1.

What if one cell is zero?

The tool adds 0.5 to every cell before taking logs. State that correction when you report the result.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.