Statistics & probability

Number needed to treat (NNT) calculator with confidence interval

Work out the number needed to treat from event counts or rates: absolute and relative risk reduction, odds ratio and an NNT interval that stays correct when it includes no effect.

Number needed to treat (NNT) calculator with confidence interval
Esc to restore

Your inputs

Your data stays on this device: nothing is uploaded.

People in the treatment group who had the event, such as a death or a relapse.

Counts: at least 1. Rates: optional; give both group sizes to get intervals, or leave both at 0.

The share of the control group with the event over the follow-up period.

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded, and nothing is saved unless you choose “Save result”.

A clear answer. Here’s how.

The control event rate is CER = events ÷ people in the control group and the treatment event rate EER likewise. For an event to prevent, the absolute risk reduction is ARR = CER − EER (for an event to promote the absolute benefit increase is EER − CER), the relative risk is RR = EER ÷ CER and the relative risk reduction is 1 − RR; the odds ratio is [EER ÷ (1 − EER)] ÷ [CER ÷ (1 − CER)]. The number needed to treat is NNT = 1 ÷ ARR: how many people must be treated, instead of given the control, for one additional person to benefit. When the treatment does worse the difference is negative and the tool reports the number needed to harm, 1 ÷ |ARR|, never a negative NNT. NNTs are conventionally rounded up to the next whole person (Cochrane Handbook); the unrounded value is shown too. The interval for ARR is either the Wald interval ARR ± z × √(CER (1 − CER) ÷ n₀ + EER (1 − EER) ÷ n₁), the usual large-sample interval for a difference of two proportions, or the Miettinen–Nurminen (1985) score interval, found by bisection on the score statistic with the restricted maximum likelihood estimates and the N ÷ (N − 1) variance factor; the score interval is the better choice with small counts. The NNT interval follows Altman (1998): take the reciprocals of both limits of the ARR interval. If both limits favour the treatment the interval is NNTB from 1 ÷ upper limit to 1 ÷ lower limit. If the ARR interval includes zero, the NNT interval includes infinity: it is written as NNTB from x to infinity and NNTH from y to infinity, where x = 1 ÷ upper limit and y = 1 ÷ |lower limit|, and is never shown as a negative number. Event rates get Wilson score intervals, the relative risk a Katz log interval and the odds ratio a Woolf logit interval, with 0.5 added to every cell when one is zero. Entering rates without group sizes gives point estimates only. The NNT depends on the baseline risk and on the length of follow-up, so compare NNTs only over the same period and for patients with similar baseline risk; it is not a property of the treatment alone, and an NNT from a different baseline risk cannot be read off from this one. It does not adjust for covariates, combine trials (use the meta-analysis tool), handle time-to-event data (Altman and Andersen 1999) or give an NNT for a given baseline risk from a relative effect. It is a calculator, not a substitute for a statistician when decisions depend on the answer.

How this is checked

5 reference checks passed These 5 cases were run when this page was built, on 20 October 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.

See the checks and where each expected answer comes from
  1. Case 1

    Inputs
    Events in the treatment group 15People in the treatment group 150Events in the control group 100People in the control group 250
    Expected, and what Toolmoz gave
    Control event rate (CER) expected 40, Toolmoz 40Treatment event rate (EER) expected 10, Toolmoz 10Absolute risk reduction (ARR) expected 30, Toolmoz 30.000000000000004Relative risk (RR) expected 0.25, Toolmoz 0.25Relative risk reduction (RRR) expected 75, Toolmoz 75Odds ratio (OR) expected 0.16666666666666666, Toolmoz 0.16666666666666666Number needed to treat (unrounded) expected 3.3333333333333335, Toolmoz 3.333333333333333Number needed to treat (rounded up) expected 4, Toolmoz 4
    Where the expected answer comes from
    Wikipedia’s number needed to treat example: 15 events among 150 treated and 100 among 250 controls, so EER = 0.1, CER = 0.4, ARR = 0.3, NNT = 1 ÷ 0.3 = 3.33 (rounded up to 4), RR = 0.25, RRR = 75% and OR = (15/135) ÷ (100/150) = 1/6
    Allowed difference
    ±1e-9
  2. Case 2

    Inputs
    Interval for the difference in rates score
    Expected, and what Toolmoz gave
    Control event rate (CER) expected 20.2636, Toolmoz 20.263591433278417Treatment event rate (EER) expected 15.486, Toolmoz 15.485996705107082Absolute risk reduction (ARR) expected 4.7776, Toolmoz 4.777594728171336Absolute risk reduction (ARR): 95% CI lower limit expected 0.4675, Toolmoz 0.4674853946922842Absolute risk reduction (ARR): 95% CI upper limit expected 9.0991, Toolmoz 9.099094247114097Relative risk (RR) expected 0.764228, Toolmoz 0.7642276422764227Odds ratio (OR) expected 0.721026, Toolmoz 0.7210256897890617Relative risk reduction (RRR) expected 23.5772, Toolmoz 23.57723577235773Number needed to treat (unrounded) expected 20.931034, Toolmoz 20.931034482758612Number needed to treat (rounded up) expected 21, Toolmoz 2195% CI lower limit, NNTB expected 10.990105, Toolmoz 10.99010487024204395% CI upper limit, NNTB expected 213.910426, Toolmoz 213.91042615528903Interval for the NNT expected NNTB from 11 to 214, Toolmoz NNTB from 11 to 214
    Where the expected answer comes from
    StatsDirect’s NNT page (Haynes and Sackett 1993: 123 deaths among 607 controls, 94 among 607 treated): risks 0.202636 and 0.15486, relative risk 0.764228, odds ratio 0.721026, relative risk reduction 0.235772, risk difference 0.047776 (Miettinen–Nurminen limits 0.004675 to 0.090991), NNT 20.931034 with limits 10.990105 to 213.910426, rounded up to 21 (11 to 214); the values are printed to 4 to 6 digits, hence the tolerance
    Allowed difference
    ±0.0001
  3. Case 3

    Inputs
    The tool’s default inputs
    Expected, and what Toolmoz gave
    Absolute risk reduction (ARR): 95% CI lower limit expected 0.4754823089222396, Toolmoz 0.4754823089222704Absolute risk reduction (ARR): 95% CI upper limit expected 9.079707147420429, Toolmoz 9.07970714742040295% CI lower limit, NNTB expected 11.01357107408583, Toolmoz 11.01357107408586395% CI upper limit, NNTB expected 210.3127668969783, Toolmoz 210.3127668969647Interval for the NNT expected NNTB from 12 to 211, Toolmoz NNTB from 12 to 211Relative risk (RR): 95% CI lower limit expected 0.5988798222637981, Toolmoz 0.598879822263799Relative risk (RR): 95% CI upper limit expected 0.9752271950182969, Toolmoz 0.9752271950182952Odds ratio (OR): 95% CI lower limit expected 0.5363740499186663, Toolmoz 0.5363740499186674Odds ratio (OR): 95% CI upper limit expected 0.9692453343233596, Toolmoz 0.9692453343233577Control event rate: 95% CI lower limit expected 17.257468789098265, Toolmoz 17.257468789098283Control event rate: 95% CI upper limit expected 23.64372663778784, Toolmoz 23.643726637787815Treatment event rate: 95% CI lower limit expected 12.825933870192374, Toolmoz 12.825933870192388Relative risk reduction (RRR) expected 23.577235772357717, Toolmoz 23.57723577235773
    Where the expected answer comes from
    The same trial with the Wald default: SE = √(0.202636 × 0.797364 ÷ 607 + 0.15486 × 0.84514 ÷ 607) = 0.0219500, so ARR 0.0477759 ± 1.959964 × 0.0219500 = 0.004755 to 0.090797 (percent: 0.4755 to 9.0797); the NNT limits are 1 ÷ 0.090797 = 11.01 and 1 ÷ 0.004755 = 210.3, rounded up to 12 and 211; Katz limits exp(ln 0.764228 ± 1.959964 × √(1/94 − 1/607 + 1/123 − 1/607)) and Woolf limits exp(ln 0.721026 ± 1.959964 × √(1/94 + 1/513 + 1/123 + 1/484)) and the Wilson limits for 123 of 607 from an independent Python decimal script
    Allowed difference
    ±1e-9 relative
  4. Case 4

    Inputs
    Events in the treatment group 10People in the treatment group 100Events in the control group 12People in the control group 100
    Expected, and what Toolmoz gave
    Absolute risk reduction (ARR) expected 2, Toolmoz 1.9999999999999991Absolute risk reduction (ARR): 95% CI lower limit expected -6.668271715444613, Toolmoz -6.668271715444556Absolute risk reduction (ARR): 95% CI upper limit expected 10.668271715444613, Toolmoz 10.668271715444554Number needed to treat (rounded up) expected 50, Toolmoz 50Interval for the NNT expected NNTB from 10 to infinity, NNTH from 15 to infinity, Toolmoz NNTB from 10 to infinity, NNTH from 15 to infinity
    Where the expected answer comes from
    Altman’s (1998) rule when the ARR interval includes zero: 12 events among 100 controls and 10 among 100 treated give ARR = 0.02 with SE = √(0.12 × 0.88 ÷ 100 + 0.10 × 0.90 ÷ 100) = 0.0442267 and limits 0.02 ± 1.959964 × 0.0442267 = −0.066683 to 0.106683; inverting gives 1 ÷ 0.106683 = 9.37, written NNTB from 10 to infinity, and 1 ÷ 0.066683 = 14.996, written NNTH from 15 to infinity (the same rule gives NNTB 10 to infinity and NNTH 50 to infinity for ARR limits of −2% and 10%)
    Allowed difference
    ±1e-9
  5. Case 5

    Inputs
    Enter ratesEvent rate in the treatment group (%) 18Event rate in the control group (%) 30People in the treatment group 0People in the control group 0
    Expected, and what Toolmoz gave
    Absolute risk reduction (ARR) expected 12, Toolmoz 12Relative risk (RR) expected 0.6, Toolmoz 0.6Relative risk reduction (RRR) expected 40, Toolmoz 40Number needed to treat (unrounded) expected 8.333333333333334, Toolmoz 8.333333333333334Number needed to treat (rounded up) expected 9, Toolmoz 9
    Where the expected answer comes from
    Cochrane Handbook chapter 15: a risk difference of −0.12 gives an NNT of 9 (1 ÷ 0.12 = 8.33 rounded up); here 30% of controls against 18% of treated give ARR = 12 points, RR = 18 ÷ 30 = 0.6 and RRR = 40%
    Allowed difference
    ±1e-9

What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

Enter
Events and group sizes (counts)
Events in the treatment group
94
People in the treatment group
607
Events in the control group
123
People in the control group
607
The event is
An outcome to prevent (death, relapse, infection)
Interval for the difference in rates
Wald (the usual simple large-sample interval)
Confidence level
95%

Example result

First 5 rows of the example result
MeasureEstimate95% CI lower95% CI upperMethod or note
Control event rate (CER)20.26%17.26%23.64%Wilson score interval
Treatment event rate (EER)15.49%12.83%18.58%Wilson score interval
Absolute risk reduction (ARR), in percentage points4.78%0.48%9.08%Wald interval
Relative risk (RR)0.76420.59890.9752Katz log interval
Relative risk reduction (RRR)23.58%2.48%40.11%1 − RR, from the Katz interval

Event rates: 20.26% with the control and 15.49% with the treatment over the same follow-up. NNT = 1 ÷ absolute risk reduction, rounded up to a whole person as is conventional (the unrounded value is shown too). It depends on the baseline risk and on the follow-up time, so compare NNTs only over the same period and for similar patients: it is not a property of the treatment alone. The interval for the difference is 95% Wald; the NNT interval inverts both of its limits, and when it includes 0 it is written as NNTB from x to infinity and NNTH from y to infinity, never as a negative number. Relative risk uses the Katz interval and the odds ratio the Woolf interval. Results from one trial may not apply to other people.