# What is the odds ratio?

Computes the odds ratio (ad ÷ bc) and the relative risk (risk ratio) from the four counts of a 2 × 2 table, with the risk and odds in each group.

- Page: https://www.acalculator.org/statistics/odds-ratio-calculator
- JSON spec: https://www.acalculator.org/statistics/odds-ratio-calculator.json
- Version: 5470074ab6b0

## Default answer

Example with the default inputs (a: exposed, with the outcome 28, b: exposed, without the outcome 129, c: unexposed, with the outcome 4, d: unexposed, without the outcome 133): The odds ratio is 7.217 and the relative risk is 6.108.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| a | a: exposed, with the outcome | People in the exposed group who have the disease or outcome. |
| b | b: exposed, without the outcome | People in the exposed group who do not have the outcome. |
| c | c: unexposed, with the outcome | People in the unexposed group who have the outcome. |
| d | d: unexposed, without the outcome | People in the unexposed group who do not have the outcome. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| or | Odds ratio (OR) | ad ÷ bc: the odds of the outcome in the exposed group divided by the odds in the unexposed group. |
| rr | Relative risk (risk ratio) | The risk in the exposed group divided by the risk in the unexposed group. |
| riskExposed | Risk, exposed | The share of the exposed group with the outcome, a ÷ (a + b), as a percent. |
| riskUnexposed | Risk, unexposed | The share of the unexposed group with the outcome, c ÷ (c + d), as a percent. |
| oddsExposed | Odds, exposed | The odds of the outcome in the exposed group, a ÷ b. |
| oddsUnexposed | Odds, unexposed | The odds of the outcome in the unexposed group, c ÷ d. |

## Method

Risk, exposed = a ÷ (a + b); risk, unexposed = c ÷ (c + d); relative risk = risk exposed ÷ risk unexposed; odds ratio = (a ÷ b) ÷ (c ÷ d) = ad ÷ bc.

## Assumptions

- a and b are the exposed group (with and without the outcome); c and d are the unexposed group.
- No zero correction: when b or c is 0 there is no answer; when d is 0 the unexposed odds are not shown.
- The page gives point values only, not confidence intervals.

## Worked examples

1. a = 28, b = 129, c = 4, d = 133 gives or = 7.217054, rr = 6.10828, riskExposed = 17.834395%, riskUnexposed = 2.919708%. Source: CDC, Principles of Epidemiology, Lesson 3, section 5, Example A (risk ratio 6.1) and Exercise 3.8 (OR = 28 × 133 ÷ (129 × 4) = 7.2); https://archive.cdc.gov/www_cdc_gov/csels/dsepd/ss1978/lesson3/section5.html.
2. a = 100, b = 1,900, c = 80, d = 7,920 gives or = 5.210526, rr = 5, oddsExposed = 0.052632, oddsUnexposed = 0.010101. Source: CDC, Principles of Epidemiology, Lesson 3, section 5, Table 3.15 (risk 5.0% and 1.0%, RR 5.0, OR 792,000 ÷ 152,000 = 5.2); https://archive.cdc.gov/www_cdc_gov/csels/dsepd/ss1978/lesson3/section5.html.
3. a = 18, b = 134, c = 3, d = 4 gives rr = 0.276316, or = 0.179104. Source: CDC, Principles of Epidemiology, Lesson 3, section 5, Example B (risk 11.8% and 42.9%, RR 0.28); https://archive.cdc.gov/www_cdc_gov/csels/dsepd/ss1978/lesson3/section5.html.

## FAQ

### How do I calculate an odds ratio?

Put the counts in a 2 × 2 table: a and b for the exposed group (with and without the outcome), c and d for the unexposed group. The odds ratio is (a × d) ÷ (b × c). For a = 28, b = 129, c = 4, d = 133: 3,724 ÷ 516 = 7.22.

### How do I calculate relative risk?

Divide the risk in the exposed group, a ÷ (a + b), by the risk in the unexposed group, c ÷ (c + d). With the same table: 28 ÷ 157 = 17.8% and 4 ÷ 137 = 2.9%, so the relative risk is 6.11.

### What is the difference between an odds ratio and relative risk?

Relative risk compares probabilities (cases ÷ everyone in the group). The odds ratio compares odds (cases ÷ non-cases). When the outcome is rare, the two are close; when it is common, the odds ratio is further from 1 than the relative risk.

### What does an odds ratio of 1 mean?

The odds of the outcome are the same in both groups: no association. Above 1, the outcome is more likely in the exposed group; below 1, less likely, which suggests a protective effect.

### When should I use the odds ratio instead of relative risk?

In a case-control study the investigator chooses how many cases and controls to enroll, so the risks in the table are not real risks; the odds ratio is the measure used there. A cohort study or trial can give either.

### What if a cell is zero?

If b or c is 0, the odds ratio has no finite value, and the page gives no answer. Some methods add 0.5 to every cell first (a zero-cell correction); this page does not, so type the corrected counts yourself if your method calls for it.

## Sources

- Centers for Disease Control and Prevention. Principles of Epidemiology in Public Health Practice, 3rd ed., Lesson 3, Section 5: Measures of Association (risk ratio, rate ratio, odds ratio, Examples A and B, Table 3.15), retrieved 2026-10-18. https://archive.cdc.gov/www_cdc_gov/csels/dsepd/ss1978/lesson3/section5.html
