Quick answer
Relative risk is RR = (a ÷ (a + b)) ÷ (c ÷ (c + d)). Of 100 exposed people 20 have the outcome (risk 0.2) and of 100 unexposed 10 do (risk 0.1), so RR = 2.
Enter the four cells of the 2×2 table. The calculator returns the relative risk and the risks in each group.
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 Relative Risk Calculator
- Enter exposed with outcome (a) (0 or more).
- Enter exposed without outcome (b) (0 or more).
- Enter unexposed with outcome (c) (0 or more).
- Enter unexposed without outcome (d) (0 or more).
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed 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
RR = (a ÷ (a + b)) ÷ (c ÷ (c + d))
IEEE-754 double precision; shown to at most 6 decimal places.
Risk in the exposed group divided by risk in the unexposed group.
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.
| Result | Value |
|---|---|
| Relative risk | 2 |
| Risk (exposed) | 0.2 |
| Risk (unexposed) | 0.1 |
The first line is the headline result (relative risk). Below it the relative Risk Calculator lists risk (exposed) and risk (unexposed), which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.
Interpretation
RR = 2 means the exposed group has twice the risk. An RR of 1 means no difference and below 1 means a protective effect. Absolute difference (10 points) tells you the size of the impact.
Study design
RR needs a cohort design, because the group sizes must reflect the population. In case-control studies use the odds ratio. c must be non-zero, and each group needs at least one subject.
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.
| Exposed with outcome | Relative risk | Risk (exposed) | Risk (unexposed) |
|---|---|---|---|
| 10 | 1.111111 | 0.111111 | 0.1 |
| 20 | 2 | 0.2 | 0.1 |
| 40 | 3.333333 | 0.333333 | 0.1 |
| 80 | 5 | 0.5 | 0.1 |
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- Unexposed with outcome (c): entering "0" shows "Relative risk is undefined when the unexposed risk is 0." beside that field and no result.
Choosing between the Relative Risk 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.
| Calculator | You enter | It returns |
|---|---|---|
| [Sample Size Calculator](/statistics/sample-size-calculator/) | estimate a, confidence level and margin of error | Required sample size |
| [Confidence Interval Calculator](/statistics/confidence-interval-calculator/) | sample mean, standard deviation and sample size | Confidence interval |
| [Point Estimate Calculator](/statistics/point-estimate/) | successes and trials | Sample proportion |
| [Standard Error Calculator](/statistics/standard-error-calculator/) | statistic, standard deviation or proportion p and sample size | Standard error |
| [Margin of Error Calculator](/statistics/margin-of-error-calculator/) | for a, confidence level and σ or proportion p | Margin 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
- Each group needs at least one subject; c must be non-zero
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 unexposed with outcome (c) to confirm this.
Frequently asked questions
What is absolute risk reduction?
The difference between the risks.
What is RR = 0.5?
A relative risk of 0.5 means the exposed group has half the risk of the unexposed group, a protective effect.
How does RR relate to OR?
They are close when the outcome is rare.
What does the Relative Risk Calculator calculate?
Relative risk from a 2×2 table. It returns Relative risk, Risk (exposed) and Risk (unexposed).
What formula does the Relative Risk Calculator use?
RR = (a ÷ (a + b)) ÷ (c ÷ (c + d)). Risk in the exposed group divided by risk in the unexposed group.
What do I need to enter in the relative Risk 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. Each group needs at least one subject; c must be non-zero.
What is an example of a relative Risk result?
With exposed with outcome (a) 20, exposed without outcome (b) 80, unexposed with outcome (c) 10 and unexposed without outcome (d) 90, the relative risk is 2.
Related calculators
- 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).
- Standard Error Calculator — Standard error of a mean or a proportion.
- Margin of Error Calculator — Margin of error for a mean or a proportion.
- Odds Ratio Calculator — Odds ratio from a 2×2 table.
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.