FREE TOOL

Free Non-Inferiority Sample Size Calculator

Estimate the sample size per group for a non-inferiority trial - testing whether a new treatment is not worse than an active comparator by more than a pre-specified margin, rather than testing for superiority.

Required sample size

337 per group

674 total participants across both groups

What this calculator supports

This calculator covers two designs: a non-inferiority comparison of two independent proportions (e.g. a response rate for a new treatment vs. an active comparator) and a non-inferiority comparison of two independent means (e.g. a continuous outcome against a pre-specified margin), each for a one-sided test.

How a non-inferiority trial differs from a superiority trial

A superiority trial (see the standard sample size calculator) asks whether a treatment is better than a comparator. A non-inferiority trial asks a narrower question: is the treatment not unacceptably worse than an active comparator, by more than a margin the investigators defined in advance? This design is common when the new treatment offers some other advantage - lower cost, fewer side effects, easier administration - and does not need to beat the comparator on the primary efficacy outcome, only avoid being meaningfully worse on it.

Two consequences follow for the sample size calculation: the test is one-sided (you only care about ruling out "worse by more than the margin," not detecting "better than"), and the non-inferiority margin - not a clinically meaningful difference to detect - drives the calculation.

Choosing the non-inferiority margin

The margin is the largest loss of effect, relative to the active comparator, that would still be considered clinically acceptable. It must be pre-specified, clinically justified, and is typically set well inside the comparator’s own established effect over placebo - not chosen after seeing the data, and not simply copied from another trial's margin without justification. Regulatory guidance (FDA and EMA both publish non-inferiority guidance documents) generally expects the margin to be justified by historical evidence of the active comparator’s effect, often using a fraction of that historical effect.

Formula

For two proportions: n = (zα+zβ)²(pT(1−pT)+pC(1−pC)) / (margin − |pC−pT|)², where zα is the one-sided critical value (not divided by 2, unlike a two-sided superiority test). For two means: n = 2σ²(zα+zβ)² / (margin − |μC−μT|)². Both reduce to the simplest, most conservative case when the treatment and comparator are assumed equal (difference = 0), which is the standard assumption unless prior data suggests otherwise.

Why the default alpha is 0.025, not 0.05

A one-sided test at α = 0.025 uses the same critical value (z = 1.96) as a two-sided test at α = 0.05 - which is exactly why regulatory guidance for non-inferiority trials conventionally specifies one-sided 0.025 rather than one-sided 0.05. It keeps the evidentiary bar consistent with a standard superiority trial rather than making it easier to pass by halving the apparent stringency.

Worked example: two proportions

A new treatment is expected to match an active comparator's 80% response rate exactly, with a non-inferiority margin of 10 percentage points, one-sided α = 0.025, and 90% power.

  • Result: 337 participants per group, 674 in total.

Enter 0.80 for both proportions, 0.10 for the margin, 0.025 for α, and 0.90 for power in Two Proportions mode to reproduce this - a commonly cited textbook example for this exact design.

Worked example: two means

A continuous outcome has a common standard deviation of 5, the treatment and comparator are assumed equal, the non-inferiority margin is set at 2 units, one-sided α = 0.025, and 90% power. Enter 10 for both means, 5 for the SD, and 2 for the margin in Two Means mode to compute the required sample size for this scenario.

When not to use this calculator

This calculator assumes two independent, parallel groups with a one-sided non-inferiority hypothesis. It is not designed for equivalence trials (two-sided margins), cluster-randomized designs, crossover trials, survival/time-to-event outcomes, or non-inferiority designs using a synthesis or retention-of-effect method rather than a simple margin. The non-inferiority margin itself must come from clinical and regulatory judgement, not from this tool.

It also does not build in a dropout adjustment - inflate the per-group result by your expected dropout rate (divide by 1 minus the dropout rate) when planning actual recruitment, the same as for a superiority trial.

References

Chow S-C, Shao J, Wang H, Lokhnygina Y. Sample Size Calculations in Clinical Research. 3rd ed. Chapman & Hall/CRC; 2017. Julious SA. Sample sizes for clinical trials with Normal data. Statistics in Medicine. 2004;23(12):1921-1986. FDA Guidance for Industry: Non-Inferiority Clinical Trials to Establish Effectiveness (2016).

FAQ

Frequently asked questions

What is a non-inferiority margin?+

The largest loss of effect, relative to an active comparator, that would still be considered clinically acceptable. It must be pre-specified and clinically justified, typically using historical evidence of the comparator's own effect over placebo.

Why is the test one-sided?+

A non-inferiority trial only asks whether the treatment is not worse than the comparator by more than the margin - it does not test for a difference in the other direction, so only one tail of the distribution is relevant.

Why is the default alpha 0.025 instead of 0.05?+

A one-sided test at 0.025 uses the same critical value (1.96) as a two-sided test at 0.05, keeping the evidentiary bar consistent with a standard superiority trial.

What if I expect the treatment to be slightly better or worse than the comparator?+

Enter your expected proportions or means separately rather than assuming equality - the calculator accounts for any expected true difference, as long as it is smaller than the margin itself.

Can I use this for an equivalence trial?+

No. An equivalence trial uses a two-sided margin (ruling out both "too much worse" and "too much better") and needs a different, typically larger, sample size calculation.

Does this account for dropout?+

No - inflate the per-group result by your expected dropout rate when planning actual recruitment, the same as for a superiority trial.

Need the superiority-trial version instead? See the standard sample size calculator. Pooling non-inferiority trials into a meta-analysis? EvidenceFlow's meta-analysis engine pools extracted effect sizes directly, or start a free EvidenceFlow review.

Start free project