Odds Ratio and Risk Ratio Calculator — Free 2×2 OR, RR, NNT Tool

Odds Ratio & Risk Ratio Calculator - Free 2x2 OR, RR, NNT Tool

Odds Ratio & Risk Ratio Calculator

Enter counts or paste raw comma-separated data. Get the odds ratio, risk ratio, risk difference, NNT, 95% confidence intervals, a chi-square p-value and four publication-ready plots in one click.

2×2 table or raw data 95% CI & p-value CSV upload Zero-cell correction Mobile friendly

Key takeaways

  • Odds ratio (OR) = (a×d)/(b×c) compares odds; risk ratio (RR) = risk1/risk2 compares probabilities.
  • Use RR for cohort studies and randomised trials; use OR for case-control studies and logistic regression.
  • When the outcome is rare (<10%), OR ≈ RR. When it is common, OR overstates the effect.
  • A 95% CI that includes 1 means the result is not statistically significant at α = 0.05.
  • Report the point estimate, the CI, and the absolute risk difference with NNT — never the ratio alone.

1. Set Up Your Data

Binary data? Choose equal to 1 and paste 1s and 0s. Continuous data (e.g. blood pressure, mass, score)? Keep a cutoff to define the event.

Use + on any column to insert another one beside it, and × to remove it. The first two columns are the pair that gets compared — column 1 is the exposure and column 2 the reference.


Click the columns that should each become a cluster — selected columns will be loaded as separate clusters.

2. Results

Odds ratio
Risk ratio
Risk difference
NNT
Relative risk reduction
change vs reference
p-value
Attributable fraction
in the exposed
Total sample

2×2 contingency table

Expected counts under independence

Full results table

Association and effect-size measures

Visualisations

1. Forest plot — OR & RR with CI
2. Risk by group with CI
3. 2×2 mosaic plot
4. Effect measures on a log scale

3. Interpretation of Results — In Detail

3.1 Reading the odds ratio

The odds ratio answers one question: how many times larger are the odds of the outcome in group 1 compared with group 2? Odds are not probabilities. If 45 of 100 exposed people have the outcome, the probability is 0.45 but the odds are 45/55 = 0.818. An OR of 2.45 therefore means the odds are about two and a half times higher in the exposed group, which is not the same as saying the outcome is two and a half times more likely.

  • OR = 1 — no association. The odds are identical in both groups.
  • OR > 1 — the exposure is associated with increased odds. OR = 1.5 is a 50% increase in odds; OR = 3.0 is a tripling.
  • OR < 1 — the exposure is protective. OR = 0.60 means a 40% reduction in odds. To express a protective OR as an increase, invert it: 1/0.60 = 1.67, so the unexposed group has 67% higher odds.

Magnitude conventions used in epidemiology are rough but useful: OR between 1.0 and 1.5 is weak, 1.5 to 3.0 is moderate, 3.0 to 10 is strong, and above 10 is very strong. The same scale applies below 1 after inversion. These are heuristics, not thresholds — a small OR applied to a common disease can carry more public-health weight than a large OR on a rare one.

3.2 Reading the risk ratio

The risk ratio is the more intuitive measure because it compares actual probabilities. RR = 1.80 means the outcome occurred 80% more often in group 1 — a statement most readers, clinicians and reviewers understand without translation. The catch is that the risk ratio requires a valid denominator, meaning you must have sampled people and then followed them to see who developed the outcome. In a case-control study you sampled on the outcome itself, so the risks in the table are artefacts of your sampling fractions and the RR is meaningless. That is precisely why the OR exists.

Compare your two numbers. If OR and RR are close, the outcome is rare and either measure will do. If the OR is much further from 1 than the RR — for example OR = 2.45 versus RR = 1.80 — the outcome is common and quoting the OR as if it were a risk ratio would exaggerate your effect. This is one of the most frequent misreadings in the applied literature, and reviewers look for it.

3.3 Reading the confidence interval

The confidence interval is more informative than the point estimate. Three things to check, in order:

  1. Does it cross 1? If yes, the data are compatible with no effect at your chosen alpha level and the result is not statistically significant. If no, it is.
  2. How wide is it? An OR of 2.5 with CI [2.1, 3.0] and an OR of 2.5 with CI [1.05, 6.0] carry the same point estimate and completely different evidential weight. Width is driven mostly by the smallest cell in your table — the standard error contains 1/a + 1/b + 1/c + 1/d, so a single cell with 3 observations will dominate everything.
  3. Are both limits clinically meaningful? If the lower bound is 1.02, the data are compatible with a trivial effect even though p < 0.05. Statistical significance is not the same as importance.

Note that the interval is asymmetric around the point estimate on the ratio scale (e.g. 2.45 [1.34, 4.49] — the distance up is larger than the distance down). This is correct and expected, because the calculation is symmetric on the natural-log scale and then exponentiated back.

3.4 Reading the risk difference and NNT

Ratios hide the baseline. A risk ratio of 2.0 could mean 2% versus 1% or 60% versus 30% — identical ratios, wildly different consequences. The risk difference restores the baseline: RD = 0.20 means 20 extra events per 100 people. The number needed to treat is simply its reciprocal, 1/0.20 = 5, so five people must be exposed or treated for one additional event to occur. An NNT of 5 is a large effect; an NNT of 300 usually is not, however impressive the accompanying ratio looks.

When RD is positive (group 1 has more events) and the event is harmful, report NNH — number needed to harm — instead. This tool labels it automatically based on the sign of RD.

3.5 Reading the p-value

The p-value is the probability of observing an association at least this extreme if the true OR were exactly 1. It tells you nothing about effect size and nothing about the probability that your hypothesis is true. Report it alongside the CI, never instead of it. If any expected cell count is below 5 the chi-square approximation degrades and you should switch to Fisher's exact test; the tool flags this for you.

3.6 Decision guide — which measure should you report?

Your designPrimary measureAlso reportWhy
Randomised controlled trialRisk ratioRD + NNTRisks are estimable and readers think in probabilities
Prospective cohort studyRisk ratioRD, adjusted OR if modellingDenominators are true populations at risk
Case-control studyOdds ratioExposure odds by groupRisks are not estimable under outcome-based sampling
Cross-sectional surveyPrevalence ratio (=RR)Prevalence ORRR is preferred unless prevalence is very low
Logistic regression outputOdds ratioPredicted risks at set covariatesThe model coefficient is a log odds ratio by construction
Meta-analysis inputOdds ratioln OR and SE(ln OR)ORs pool symmetrically on the log scale
Outcome above ~20% commonRisk ratioNever quote the OR as a riskThe OR diverges sharply from the RR

3.7 Common mistakes this calculator prevents

  • Zero cells. A zero in any cell makes the OR either 0 or infinite and the standard error undefined. The Haldane-Anscombe correction adds 0.5 to every cell. It is a defensible fix but it biases the estimate towards 1, so always disclose that you used it.
  • Small cells. Any cell below 5 makes the Wald interval unreliable. Prefer exact or profile-likelihood intervals.
  • Confounding. An unadjusted OR from a 2×2 table is crude. If a third variable is associated with both exposure and outcome, stratify (Mantel-Haenszel) or move to logistic regression.
  • Reversed reference group. Swapping which group is group 1 inverts the ratio. Always state the reference group explicitly in your text.
  • Dichotomising a continuous variable. If you set a cutoff to create the event, you lose information and power. Report the cutoff and justify it; do not go hunting for the cutoff that gives the smallest p-value.

4. How to Report Your Odds Ratio and Risk Ratio

4.1 Methods section

State the design, the measure, the software and the handling of edge cases in three or four sentences:

"Associations between exposure and outcome were quantified using odds ratios and risk ratios with 95% confidence intervals derived from the normal approximation on the log scale (Woolf's method). The event was defined as a value of at least 50 units. Where a contingency cell contained zero observations, the Haldane-Anscombe correction of 0.5 was applied to all four cells. Statistical significance was assessed with the Pearson chi-square test with Yates' continuity correction; Fisher's exact test was used where any expected count fell below five. All analyses were two-sided with alpha set at 0.05."

4.2 Results section — sentence templates

Significant, harmful exposure:

"The outcome occurred in 45 of 100 exposed participants (45.0%) compared with 25 of 100 unexposed participants (25.0%). Exposure was associated with significantly increased odds of the outcome (OR = 2.45, 95% CI 1.34 to 4.49, χ²1 = 8.20, p = 0.004). The corresponding risk ratio was 1.80 (95% CI 1.20 to 2.70), an absolute risk difference of 20.0 percentage points (95% CI 7.3 to 32.7), giving a number needed to harm of 5."

Significant, protective exposure:

"Treated participants had 45% lower odds of the outcome than controls (OR = 0.55, 95% CI 0.34 to 0.89, p = 0.015). Absolute risk fell from 32.0% to 21.0%, a risk difference of −11.0 percentage points (95% CI −19.4 to −2.6) and a number needed to treat of 10 (95% CI 6 to 39)."

Non-significant result — do not call it "no difference":

"We found no statistically significant association between exposure and the outcome (OR = 1.31, 95% CI 0.78 to 2.20, p = 0.31). The confidence interval is compatible with effects ranging from a 22% reduction to a 120% increase in odds, so a clinically relevant association cannot be excluded on the basis of this sample."

4.3 Table and figure conventions

  • Report ratios to two decimal places and percentages to one.
  • Always give the CI immediately after the point estimate, in the same units, with "95% CI" spelled out at first use.
  • Give raw counts and denominators (45/100), not percentages alone — readers need to reconstruct your table.
  • Use "to" rather than a dash inside intervals when either limit can be negative, to avoid ambiguity with the minus sign.
  • Report exact p-values to two or three significant figures (p = 0.004, p = 0.31); use p < 0.001 only below that threshold.
  • Name the reference group in the table header or footnote, e.g. "reference: unexposed".
  • Plot ratios on a logarithmic x-axis in forest plots so that OR = 0.5 and OR = 2 are equidistant from the null line.

4.4 Discussion section

Address three things the reviewers will ask about: whether the OR was interpreted as a risk ratio (it should not have been if the outcome is common), whether confounding was addressed, and whether the precision of the estimate supports the strength of your claim. If your CI is wide, say so before the reviewer does.

5. Formulas Used

1Odds ratio
OR = (a × d) / (b × c)
where a = events in group 1, b = non-events in group 1, c = events in group 2, d = non-events in group 2.
2Risk ratio (relative risk)
RR = [a / (a + b)] ÷ [c / (c + d)] = R₁ / R₂
R₁ is the risk in group 1 and R₂ the risk in group 2. Valid only when the denominators are true cohorts.
3Confidence interval for the log ratio
SE(ln OR) = √(1/a + 1/b + 1/c + 1/d)
SE(ln RR) = √(1/a − 1/(a+b) + 1/c − 1/(c+d))
CI = exp[ ln(ratio) ± z × SE ]
z = 1.6449 (90%), 1.9600 (95%), 2.5758 (99%). The interval is symmetric on the log scale, not on the ratio scale.
4Risk difference, RRR and NNT
RD = R₁ − R₂
SE(RD) = √[ R₁(1−R₁)/n₁ + R₂(1−R₂)/n₂ ]
RRR = (R₂ − R₁) / R₂   NNT = 1 / |RD|
RD is the absolute risk difference. NNT is rounded up to the next whole person; when RD > 0 it is an NNH (number needed to harm).
5Significance test
z = ln(OR) / SE(ln OR)  →  p = 2[1 − Φ(|z|)]
χ²Yates = N(|ad − bc| − N/2)² / [(a+b)(c+d)(a+c)(b+d)]
Φ is the standard normal CDF and N = a+b+c+d. The Wald z-test and the chi-square test usually agree closely; use Fisher's exact test when any expected count is below 5.

6. How to Use This Calculator

  1. Pick your input mode. Use Raw data if you have measurements per participant; use 2×2 counts if you already have a table.
  2. Define the event. With raw data, set the rule and cutoff. For 0/1 data choose "equal to 1".
  3. Rename the groups. Group names are editable and feed straight into the tables and plots. The first group is the exposed/treatment group; the second is the reference.
  4. Paste or upload. Paste comma-separated values, or upload a CSV and click the columns you want — each selected column becomes its own cluster.
  5. Set the confidence level and the zero-cell policy.
  6. Calculate, then read the KPI cards, the 2×2 table, the full results table and the four plots.
  7. Download the .txt for your methods log so your numbers are reproducible.

7. Reference Tables

7.1 How far the odds ratio drifts from the risk ratio

Both groups below have a fixed risk ratio of 2.0. Only the baseline risk changes. This is the single most useful table in the tool: it shows exactly when quoting an OR as though it were a risk becomes indefensible.

Risk in reference groupRisk in exposed groupRisk ratioOdds ratioOR / RR inflationVerdict
1%2%2.002.021.01×OR ≈ RR — interchangeable
2%4%2.002.041.02×Safe
5%10%2.002.111.06×Safe
10%20%2.002.251.13×Borderline — state which you report
20%40%2.002.671.33×Report the RR
30%60%2.003.501.75×Report the RR
40%80%2.006.003.00×Quoting the OR as risk would badly mislead

7.2 Interval width by cell size (balanced 2×2, RR fixed at 2.0)

Precision is driven by counts, not by the size of the effect. A doubling of risk can be statistically invisible at n = 25 per group and rock solid at n = 500.

Per groupa / bc / dOdds ratio95% CISignificant?
2510 / 155 / 202.670.75 to 9.44No
5020 / 3010 / 402.671.09 to 6.51Yes, barely
10040 / 6020 / 802.671.41 to 5.03Yes
250100 / 15050 / 2002.671.79 to 3.97Yes
500200 / 300100 / 4002.672.01 to 3.53Yes, precise
1000400 / 600200 / 8002.672.19 to 3.24Yes, very precise

7.3 Reading an effect size at a glance

Odds ratioEquivalent protective ORChange in oddsConventional label
1.001.00noneNo association
1.200.83+20%Very weak
1.500.67+50%Weak
2.000.50+100%Moderate
3.000.33+200%Moderate to strong
5.000.20+400%Strong
10.00.10+900%Very strong

7.4 Risk difference to NNT

Risk differenceNNT / NNHPractical reading
50 percentage points2Every second person affected — very large
20 points5Large, easily justifies action
10 points10Substantial in most clinical settings
5 points20Meaningful for common outcomes
2 points50Modest; weigh against cost and harm
1 point100Small; needs a cheap, safe intervention
0.1 points1000Population-level relevance only

7.5 Critical z values used for the confidence interval

Confidence levelAlpha (two-sided)zTypical use
90%0.101.6449Exploratory or pilot analyses
95%0.051.9600Default for journal reporting
99%0.012.5758Multiple comparisons or high-stakes claims

8. Example Results

Eight fully worked cases covering the situations you are most likely to meet: common and rare outcomes, tiny samples, a zero cell, a null result, a precise small effect, a case-control design where the risk ratio must not be reported, and a field-ecology application. Each card shows the 2×2 table, every computed measure, a forest plot, what the numbers actually mean, and a sentence you can adapt for your manuscript.

1
Cohort study

Smoking and chronic cough

Common outcome — the odds ratio overstates the risk ratio

A prospective occupational cohort followed 100 smokers and 100 non-smokers for two years and recorded whether each person developed a chronic cough. Everyone was cough-free at enrolment, so both denominators are genuine populations at risk and the risk ratio is fully interpretable.

OR 2.45RR 1.80RD 20.0 ptsNNH 5p 0.005
GroupEventNo eventTotalRisk
Smokers45 (a)55 (b)10045.0%
Non-smokers25 (c)75 (d)10025.0%
MeasureEstimate95% CI
Odds ratio2.451.35 to 4.47
Risk ratio1.801.20 to 2.69
Risk difference20.0 pts7.1 to 32.9 pts
NNH5
χ² (Yates, df = 1)7.93p = 0.005
125Odds ratio2.45 [1.35, 4.47]Risk ratio1.80 [1.20, 2.69]Ratio, log scale — dashed line = no effect (1.0); result is significant at 5%
Figure 1. Smoking and chronic cough — point estimates with 95% confidence intervals on a logarithmic scale; the dashed line marks the null value of 1.0.
What it means

This is the textbook case of a common outcome. Forty-five per cent of smokers coughed compared with twenty-five per cent of non-smokers. The odds ratio of 2.45 is a full 36% larger than the risk ratio of 1.80, and a reader who saw only the OR would conclude the risk had roughly two and a half times, when it actually rose 80%. Because this is a cohort design, the risk ratio is the number that belongs in the abstract.

Write-up

Chronic cough developed in 45/100 smokers (45.0%) versus 25/100 non-smokers (25.0%). Smoking was associated with an increased risk of chronic cough (RR = 1.80, 95% CI 1.20 to 2.70; OR = 2.45, 95% CI 1.34 to 4.49; χ²1 = 7.93, p = 0.005). The absolute risk difference was 20.0 percentage points (95% CI 7.3 to 32.7), giving a number needed to harm of 5.

2
Randomised trial

Vaccine against a rare infection

Rare outcome — odds ratio and risk ratio nearly identical

A double-blind randomised controlled trial allocated 500 participants to a vaccine and 500 to placebo, then counted laboratory-confirmed infections over one season. The outcome is uncommon in both arms.

OR 0.28RR 0.30RD -5.6 ptsNNT 18p < 0.001
GroupEventNo eventTotalRisk
Vaccinated12 (a)488 (b)5002.4%
Placebo40 (c)460 (d)5008.0%
MeasureEstimate95% CI
Odds ratio0.280.15 to 0.55
Risk ratio0.300.16 to 0.57
Risk difference-5.6 pts-8.3 to -2.9 pts
NNT18
χ² (Yates, df = 1)14.79p = < 0.001
0.20.51Odds ratio0.28 [0.15, 0.55]Risk ratio0.30 [0.16, 0.57]Ratio, log scale — dashed line = no effect (1.0); result is significant at 5%
Figure 2. Vaccine against a rare infection — point estimates with 95% confidence intervals on a logarithmic scale; the dashed line marks the null value of 1.0.
What it means

With risks of 2.4% and 8.0%, the outcome is rare, and the odds ratio (0.28) and risk ratio (0.30) are almost identical. This is the regime in which the two measures are genuinely interchangeable, and it is why the OR became the default currency of case-control research and meta-analysis. Both point estimates sit well below 1 with intervals that exclude it, so the vaccine is clearly protective. Note the relative risk reduction of 70% sounds enormous while the absolute reduction is 5.6 percentage points — report both.

Write-up

Infection occurred in 12/500 vaccinated participants (2.4%) and 40/500 placebo recipients (8.0%). Vaccination reduced infection risk by 70% (RR = 0.30, 95% CI 0.16 to 0.56; OR = 0.28, 95% CI 0.15 to 0.54; p < 0.001), an absolute risk reduction of 5.6 percentage points (95% CI 2.9 to 8.3) and a number needed to treat of 18.

3
Pharmacovigilance

A very rare adverse event

Huge point estimate, useless interval — underpowered

A safety database compared 1,000 patients on a new drug with 1,000 on an established comparator, looking for a rare serious adverse event. Only four events occurred in total.

OR 3.01RR 3.00RD 0.2 ptsNNH 500p 0.617
GroupEventNo eventTotalRisk
Drug3 (a)997 (b)10000.3%
Comparator1 (c)999 (d)10000.1%
MeasureEstimate95% CI
Odds ratio3.010.31 to 28.95
Risk ratio3.000.31 to 28.79
Risk difference0.2 pts-0.2 to 0.6 pts
NNH500
χ² (Yates, df = 1)0.25p = 0.617
0.51251020Odds ratio3.01 [0.31, 28.95]Risk ratio3.00 [0.31, 28.79]Ratio, log scale — dashed line = no effect (1.0); result is not significant at 5%
Figure 3. A very rare adverse event — point estimates with 95% confidence intervals on a logarithmic scale; the dashed line marks the null value of 1.0.
What it means

The point estimate of 3.00 looks alarming, but the confidence interval runs from 0.31 to 28.8 — a range spanning a threefold protective effect to a near thirtyfold harm. With three and one events, the standard error is dominated by those tiny cells (1/3 + 1/1 alone contribute most of the variance). This result is uninformative, not reassuring and not alarming. Reporting it as a threefold increase in risk would be indefensible. The correct conclusion is that the study was far too small to characterise this event.

Write-up

The adverse event occurred in 3/1000 (0.3%) drug-exposed and 1/1000 (0.1%) comparator patients. The estimated odds ratio was 3.01 (95% CI 0.31 to 28.9, Fisher's exact p = 0.62). The confidence interval is compatible with both substantial harm and substantial benefit; the study was underpowered to detect a difference of this magnitude and no conclusion about causal risk can be drawn.

4
Zero cell

No events in the treated arm

Haldane-Anscombe correction — and why it is conservative

A small trial randomised 50 patients per arm. No treated patient experienced the outcome; six controls did. The raw odds ratio is 0 and its standard error is undefined, so the calculator applies the Haldane-Anscombe correction of +0.5 to every cell.

OR 0.07RR 0.08RD -11.8 ptsNNT 9p 0.035
GroupEventNo eventTotalRisk
Treated0 (a)50 (b)500.0%
Control6 (c)44 (d)5012.0%
MeasureEstimate95% CI
Odds ratio0.07 (+0.5 correction)0.00 to 1.24
Risk ratio0.080.00 to 1.33
Risk difference-11.8 pts-21.3 to -2.2 pts
NNT9
χ² (Yates, df = 1)4.43p = 0.035
0.010.020.050.10.20.51Odds ratio0.07 [0.00, 1.24]Risk ratio0.08 [0.00, 1.33]Ratio, log scale — dashed line = no effect (1.0); result is not significant at 5%
Figure 4. No events in the treated arm — point estimates with 95% confidence intervals on a logarithmic scale; the dashed line marks the null value of 1.0.
What it means

A zero cell breaks the arithmetic: dividing by b×c gives zero, and the log of zero is undefined. Adding 0.5 to all four cells restores a finite estimate, but that correction pulls the result towards the null, so the corrected OR is conservative — the true effect is at least as strong. The interval still brushes 1, so at 50 per arm this promising signal falls just short of conventional significance. Always disclose the correction in your methods; a reviewer who recomputes your table from the raw counts will otherwise get a different number.

Write-up

No events were observed among 50 treated patients (0.0%) compared with 6/50 controls (12.0%). Because one cell contained zero observations, the Haldane-Anscombe correction (+0.5 to all cells) was applied, giving OR = 0.07 (95% CI 0.004 to 1.24) and RR = 0.08 (95% CI 0.005 to 1.30). The correction biases the estimate towards the null, so this represents a conservative bound; a larger trial is required for confirmation.

5
Null result

A negative finding

"No evidence of an association" is not "no association"

A cross-sectional survey of 200 participants found the outcome in 30 of 100 exposed and 28 of 100 unexposed individuals.

OR 1.10RR 1.07RD 2.0 ptsNNH 51p 0.876
GroupEventNo eventTotalRisk
Exposed30 (a)70 (b)10030.0%
Unexposed28 (c)72 (d)10028.0%
MeasureEstimate95% CI
Odds ratio1.100.60 to 2.03
Risk ratio1.070.69 to 1.65
Risk difference2.0 pts-10.6 to 14.6 pts
NNH51
χ² (Yates, df = 1)0.02p = 0.876
0.512Odds ratio1.10 [0.60, 2.03]Risk ratio1.07 [0.69, 1.65]Ratio, log scale — dashed line = no effect (1.0); result is not significant at 5%
Figure 5. A negative finding — point estimates with 95% confidence intervals on a logarithmic scale; the dashed line marks the null value of 1.0.
What it means

The odds ratio of 1.10 sits almost exactly on the null line and the interval comfortably contains 1. The right phrasing is "no evidence of an association", never "no association" and never "the groups were the same". Look at the interval width before you decide how strong your negative claim can be: here the upper limit of 2.02 means a doubling of odds has not been excluded, so this is a soft null, not a definitive one. Contrast with example 6, where a much tighter interval supports a genuinely confident statement.

Write-up

The outcome was present in 30/100 exposed (30.0%) and 28/100 unexposed participants (28.0%). We found no evidence of an association (OR = 1.10, 95% CI 0.60 to 2.02; RR = 1.07, 95% CI 0.69 to 1.66; p = 0.88). The confidence interval remains compatible with effects ranging from a 40% reduction to a doubling of odds, so a clinically relevant association cannot be excluded.

6
Large trial

A small but precise effect

Modest ratio, narrow interval — the mirror image of example 3

A pragmatic trial of 10,000 patients compared an intervention with standard care. Event rates were 10.4% and 12.0%.

OR 0.85RR 0.87RD -1.6 ptsNNT 63p 0.012
GroupEventNo eventTotalRisk
Intervention520 (a)4480 (b)500010.4%
Standard care600 (c)4400 (d)500012.0%
MeasureEstimate95% CI
Odds ratio0.850.75 to 0.96
Risk ratio0.870.78 to 0.97
Risk difference-1.6 pts-2.8 to -0.4 pts
NNT63
χ² (Yates, df = 1)6.28p = 0.012
0.5786440.9594641.575Odds ratio0.85 [0.75, 0.96]Risk ratio0.87 [0.78, 0.97]Ratio, log scale — dashed line = no effect (1.0); result is significant at 5%
Figure 6. A small but precise effect — point estimates with 95% confidence intervals on a logarithmic scale; the dashed line marks the null value of 1.0.
What it means

Here the ratio is modest (OR 0.85) but the interval is narrow enough to exclude the null decisively. This is the mirror image of example 3: a small effect measured precisely rather than a large effect measured badly. The absolute picture keeps it honest — a 1.6 percentage point reduction with an NNT of 63. Whether that is worth doing depends entirely on cost, harm and the seriousness of the outcome, which is a judgement your discussion section must make explicitly rather than leaving the reader to infer from a p-value.

Write-up

The primary outcome occurred in 520/5000 intervention patients (10.4%) versus 600/5000 receiving standard care (12.0%). The intervention reduced the odds of the outcome by 15% (OR = 0.85, 95% CI 0.75 to 0.96; RR = 0.87, 95% CI 0.78 to 0.97; p = 0.011). The absolute risk reduction was 1.6 percentage points (95% CI 0.4 to 2.8), corresponding to a number needed to treat of 63.

7
Case-control

Asbestos and lung cancer

Risk ratio is not estimable — report the odds ratio only

Investigators recruited 100 patients with lung cancer and 100 hospital controls, then asked each about historical asbestos exposure. Ninety per cent of cases and sixty per cent of controls reported exposure.

OR 6.00p < 0.001
GroupEventNo eventTotalRisk
Cases (lung cancer)90 (a)10 (b)10090.0%
Controls60 (c)40 (d)10060.0%
MeasureEstimate95% CI
Odds ratio6.002.79 to 12.91
χ² (Yates, df = 1)22.43p = < 0.001
12510Odds ratio6.00 [2.79, 12.91]Ratio, log scale — dashed line = no effect (1.0); result is significant at 5%
Figure 7. Asbestos and lung cancer — point estimates with 95% confidence intervals on a logarithmic scale; the dashed line marks the null value of 1.0.
What it means

The 2×2 table can be filled in and the software will happily print a risk ratio of 1.50 — and that number is meaningless. The investigators chose how many cases and how many controls to recruit, so the apparent "risk" of cancer in this table is an artefact of the sampling ratio; recruiting 200 controls instead of 100 would change the RR while leaving the OR untouched. That invariance is precisely why the odds ratio exists. Report the OR of 6.00 and nothing else, and describe it as an association with exposure odds, not as a risk.

Write-up

Asbestos exposure was reported by 90/100 cases (90.0%) and 60/100 controls (60.0%), giving an odds ratio of 6.00 (95% CI 2.83 to 12.73; χ²1 = 23.0, p < 0.001). Because participants were sampled on outcome status, risks and risk ratios are not estimable from this design and are therefore not reported.

8
Field ecology

Camera-trap detection at edge versus interior

Valid arithmetic, but clustering and detection bias come first

A camera-trap survey deployed 100 stations along a forest edge and 100 in the interior, each for 30 trap-nights, and recorded whether a focal carnivore was detected at least once per station.

OR 2.35RR 1.89RD 16.0 ptsNNH 7p 0.016
GroupEventNo eventTotalRisk
Edge stations34 (a)66 (b)10034.0%
Interior stations18 (c)82 (d)10018.0%
MeasureEstimate95% CI
Odds ratio2.351.22 to 4.53
Risk ratio1.891.15 to 3.11
Risk difference16.0 pts4.0 to 28.0 pts
NNH7
χ² (Yates, df = 1)5.85p = 0.016
125Odds ratio2.35 [1.22, 4.53]Risk ratio1.89 [1.15, 3.11]Ratio, log scale — dashed line = no effect (1.0); result is significant at 5%
Figure 8. Camera-trap detection at edge versus interior — point estimates with 95% confidence intervals on a logarithmic scale; the dashed line marks the null value of 1.0.
What it means

Detection is a binary station-level outcome, so a 2×2 table is legitimate and the risk ratio is interpretable because stations were chosen before any detection occurred. Edge stations detected the species roughly twice as often (34% versus 18%, RR = 1.89). Two ecological caveats matter more than the arithmetic: stations within the same habitat block are not fully independent, which will make this interval too narrow, and unequal detection probability between habitats can create the pattern without any real difference in occupancy. Treat this as a descriptive result and follow it with an occupancy model.

Write-up

The focal species was detected at 34/100 edge stations (34.0%) and 18/100 interior stations (18.0%) over 30 trap-nights per station (OR = 2.35, 95% CI 1.23 to 4.48; RR = 1.89, 95% CI 1.14 to 3.13; χ²1 = 5.99, p = 0.014). Because stations within blocks may not be independent and detection probability may differ between habitats, these unadjusted estimates were followed by a single-season occupancy model incorporating detection covariates.

9. When to Use This Calculator

Use it when

  • You have a binary outcome and two independent groups, and you want the crude association between them.
  • You are writing up a cohort study, a randomised trial, a case-control study or a cross-sectional survey and need OR, RR, RD and NNT together with intervals.
  • You have continuous measurements and a pre-specified clinical or ecological cutoff that defines an event.
  • You need to sanity-check an odds ratio reported in a paper against its own published 2×2 table.
  • You are teaching or learning the difference between odds and risk and want to see both computed side by side on the same data.
  • You want a quick forest plot of a single comparison for a slide or a supplementary figure.

Do not use it when

  • Your data are paired or matched — before/after measurements on the same individuals, matched case-control pairs, or split-plot designs. Use McNemar's test or conditional logistic regression.
  • You need to adjust for confounders — a crude 2×2 ratio can reverse sign once age, sex or site is controlled for. Use Mantel-Haenszel stratification or logistic regression.
  • Your outcome is a rate over person-time — incidence rate ratios require follow-up time in the denominator, not counts of people.
  • Your outcome is continuous — dichotomising to force it into a 2×2 table throws away power. Use a t-test, Mann-Whitney or regression instead.
  • You have more than two exposure levels and want a trend — use the Cochran-Armitage test for trend or logistic regression with an ordinal term.
  • Your observations are clustered — repeated visits, households, litters, camera stations. Independence is violated and intervals will be too narrow.
  • You are planning a study rather than analysing one — you need a power and sample size calculator, not an effect size calculator.

10. Assumptions and Limitations

  • Observations are independent; each participant appears in exactly one cell.
  • Both the exposure and the outcome are binary (or have been dichotomised by your cutoff).
  • The Wald confidence interval assumes an approximately normal sampling distribution of the log ratio, which fails with small or zero cells.
  • The risk ratio requires cohort-style sampling; it is not interpretable in a case-control design.
  • No adjustment for confounders is performed. Use Mantel-Haenszel stratification or logistic regression when confounding is plausible.
  • Matched or paired designs need conditional methods (McNemar's test, conditional logistic regression), not this unmatched 2×2 approach.
  • Clustered data (repeated measures, sites, litters) violate independence and need GEE or mixed models.

11. Conclusion

The odds ratio and the risk ratio answer closely related but genuinely different questions, and choosing between them is a design decision rather than a stylistic one. If your participants were recruited before the outcome occurred — a cohort study, a randomised trial, a prospective field survey — then risks are estimable and the risk ratio is the measure your readers will understand fastest. If your participants were recruited because of their outcome status, as in a case-control study, then risks are not estimable at all and the odds ratio is the only valid ratio measure available. The same arithmetic applies in both cases, but the interpretation does not transfer.

The second decision is how much of the picture to report. A ratio on its own is an incomplete result because it is silent about the baseline. Two studies can both report a risk ratio of 2.0 while one describes twenty extra cases per hundred people and the other describes one extra case per ten thousand. Pairing every ratio with the absolute risk difference and its reciprocal, the number needed to treat, closes that gap and is now expected by most journals in health and applied ecology alike. This calculator returns all four measures together for exactly that reason.

Precision deserves as much attention as the estimate itself. Because the standard error of the log ratio sums the reciprocals of all four cells, one sparse cell can widen a confidence interval enough to make an apparently large effect uninformative. Before you write a strong sentence in your abstract, look at the width of the interval and at the smallest count in your table. If a cell is under five, treat the Wald interval as provisional and move to an exact method. If a cell is zero, apply the Haldane-Anscombe correction, state that you did, and be candid that the corrected estimate is conservative.

Finally, remember what a 2×2 table cannot do. It cannot separate association from causation, it cannot adjust for a confounder, and it cannot rescue a design that sampled the wrong people. It is the right first step and a poor last one. Use these numbers to describe the association cleanly and honestly, then move to stratified or regression-based methods when the research question demands adjustment. Reported this way — estimate, interval, absolute difference, and an explicit statement of the reference group and the design — your result will be reproducible, reviewable, and directly comparable with the rest of your field's literature.

12. Frequently Asked Questions

What is the difference between an odds ratio and a risk ratio?

A risk ratio compares probabilities; an odds ratio compares odds (probability divided by its complement). They agree when the outcome is rare and diverge as it becomes common, with the OR always further from 1.

When should I use an odds ratio instead of a risk ratio?

Use the OR for case-control studies, for any analysis based on logistic regression, and for meta-analysis where ORs are the pooled currency. Use the RR for cohort studies and randomised trials.

What does an odds ratio of 2 mean?

The odds of the outcome are twice as high in group 1 as in group 2. It does not mean the outcome is twice as likely unless the outcome is rare.

What does an odds ratio of 0.5 mean?

The odds are halved — a 50% reduction. Equivalently, the reference group has twice the odds (1/0.5 = 2).

How do I know if my odds ratio is statistically significant?

Check whether the 95% confidence interval includes 1. If it does not, the result is significant at p < 0.05.

Why is my confidence interval asymmetric?

Because it is computed symmetrically on the natural-log scale and then exponentiated. That is the correct procedure, not an error.

What do I do if one cell is zero?

Add 0.5 to all four cells (Haldane-Anscombe). This tool does it automatically when you leave zero-cell handling on "Auto". Disclose the correction in your methods.

Can I calculate a risk ratio from a case-control study?

No. Case-control sampling fixes the number of cases and controls, so the apparent risks are artefacts of your sampling fractions.

What sample size do I need?

There is no universal answer, but every cell should ideally exceed 10 for a stable Wald interval. Run a formal power calculation based on your expected baseline risk and target effect.

Should I use the chi-square test or Fisher's exact test?

Use chi-square when all expected counts are at least 5; otherwise use Fisher's exact test. The tool flags small expected counts for you.

What is the difference between NNT and NNH?

They are the same arithmetic (1/|RD|) labelled by direction: NNT when the intervention reduces a harmful outcome, NNH when it increases one.

Why does my odds ratio look bigger than my risk ratio?

Your outcome is common. The OR inflates relative to the RR as baseline risk rises — a known and expected property, not a mistake.

Can I use this for more than two groups?

Add extra clusters and compare them pairwise against your chosen reference. For a single omnibus model, use logistic regression.

Does this tool adjust for confounders?

No. It gives the crude, unadjusted association. For adjustment, use Mantel-Haenszel stratification or logistic regression.

Which cutoff should I use for continuous data?

One defined a priori from the literature or clinical guidance. Never choose the cutoff that minimises your p-value — that inflates the false-positive rate substantially.

Is the risk difference confidence interval on the same scale?

Yes — it is a Wald interval on the difference of proportions and can legitimately include negative values.

Can I report an odds ratio as a percentage change?

Yes: (OR − 1) × 100 gives the percentage change in odds. Be explicit that it refers to odds, not risk.

How many decimal places should I report?

Two for ratios and their limits, one for percentages, and two to three significant figures for p-values.

Does this work on a phone?

Yes. The layout, tables and all four plots reflow to a single column below 860 px.

Is my data uploaded anywhere?

No. Every calculation and every plot runs entirely in your browser; nothing is transmitted.

13. Cite This Tool

Free to use and free to reference. If this calculator helped with an analysis, a citation or a link is appreciated.

APA 7th edition
StatsUnlock. (2026). Odds Ratio & Risk Ratio Calculator [Interactive statistical tool]. https://statsunlock.com/odds-ratio-risk-ratio-calculator/
BibTeX
@misc{statsunlock_orrr_2026, title = {Odds Ratio and Risk Ratio Calculator}, author = {{StatsUnlock}}, year = {2026}, note = {Interactive statistical tool}, url = {https://statsunlock.com/odds-ratio-risk-ratio-calculator/} }
Methods wording
Odds ratios and risk ratios with 95% confidence intervals were calculated using the StatsUnlock Odds Ratio and Risk Ratio Calculator (statsunlock.com), applying Woolf's log method for interval estimation and the Haldane-Anscombe correction where a contingency cell contained zero observations.

14. Related Tools

Part of the StatsUnlock experimental design and power toolkit — all free, no signup, and they work together.

15. References

  1. Bland JM, Altman DG. (2000). The odds ratio. BMJ, 320(7247), 1468. doi:10.1136/bmj.320.7247.1468
  2. Altman DG, Bland JM. (2011). How to obtain the confidence interval from a P value. BMJ, 343, d2090. doi:10.1136/bmj.d2090
  3. Woolf B. (1955). On estimating the relation between blood group and disease. Annals of Human Genetics, 19(4), 251–253. doi:10.1111/j.1469-1809.1955.tb01348.x
  4. Haldane JBS. (1956). The estimation and significance of the logarithm of a ratio of frequencies. Annals of Human Genetics, 20(4), 309–311. doi:10.1111/j.1469-1809.1955.tb01285.x
  5. Anscombe FJ. (1956). On estimating binomial response relations. Biometrika, 43(3–4), 461–464. doi:10.1093/biomet/43.3-4.461
  6. Zhang J, Yu KF. (1998). What's the relative risk? JAMA, 280(19), 1690–1691. doi:10.1001/jama.280.19.1690
  7. Greenland S. (1987). Interpretation and choice of effect measures in epidemiologic analyses. American Journal of Epidemiology, 125(5), 761–768. doi:10.1093/oxfordjournals.aje.a114593
  8. Cook RJ, Sackett DL. (1995). The number needed to treat. BMJ, 310(6977), 452–454. doi:10.1136/bmj.310.6977.452
  9. Altman DG. (1998). Confidence intervals for the number needed to treat. BMJ, 317(7168), 1309–1312. doi:10.1136/bmj.317.7168.1309
  10. Newcombe RG. (1998). Interval estimation for the difference between independent proportions. Statistics in Medicine, 17(8), 873–890. doi:10.1002/(SICI)1097-0258
  11. Agresti A. (2013). Categorical Data Analysis, 3rd ed. Wiley. doi:10.1002/0471249688
  12. Rothman KJ, Greenland S, Lash TL. (2008). Modern Epidemiology, 3rd ed. Lippincott. Publisher page
  13. Mantel N, Haenszel W. (1959). Statistical aspects of the analysis of data from retrospective studies. JNCI, 22(4), 719–748. doi:10.1093/jnci/22.4.719
  14. Cornfield J. (1951). A method of estimating comparative rates from clinical data. JNCI, 11(6), 1269–1275. doi:10.1093/jnci/11.6.1269
  15. Yates F. (1934). Contingency tables involving small numbers and the chi-square test. JRSS Supplement, 1(2), 217–235. doi:10.2307/2983604
  16. Fisher RA. (1922). On the interpretation of chi-square from contingency tables. JRSS, 85(1), 87–94. doi:10.2307/2340521
  17. Davies HTO, Crombie IK, Tavakoli M. (1998). When can odds ratios mislead? BMJ, 316(7136), 989–991. doi:10.1136/bmj.316.7136.989
  18. Schulz KF, Altman DG, Moher D. (2010). CONSORT 2010 Statement. BMJ, 340, c332. doi:10.1136/bmj.c332
  19. von Elm E, et al. (2007). The STROBE Statement. PLoS Medicine, 4(10), e296. doi:10.1371/journal.pmed.0040296
  20. Wasserstein RL, Lazar NA. (2016). The ASA statement on p-values. The American Statistician, 70(2), 129–133. doi:10.1080/00031305.2016.1154108

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
Next Post

All Categories

Most Recent Posts

Important Charts & Plots

© 2026 STATS UNLOCK . statsunlock.com –  All Rights Reserved.