Free tool · Sample sizeUpdated October 8, 2026

Non-inferiority trial sample size calculator for means and proportions

Enter the margin, the expected difference, a one-sided alpha and power. Get the evaluable participants per group, enrolment after dropout, and the formula with your numbers substituted, so you can check every step.

  • Continuous and binary outcomes
  • One-sided alpha, default 0.025
  • Formula shown with your inputs

Free sandbox · No credit card · 21 CFR Part 11 aligned

Binary outcome: 85% success in both arms, one-sided alpha 0.025, 90% power

Margin

10 points

Evaluable per group

268

Enrol per group (10% dropout)

298

Total enrolment

596

Margin 15 points120/1100

120 per group

Margin 10 points268/1100

268 per group

Margin 5 points1072/1100

1,072 per group

Halving the margin roughly quadruples the sample size.

What this calculator does

  • A non-inferiority trial tests whether the new treatment is not worse than the active control by more than a margin M chosen in advance.
  • Continuous outcomes: n per group = 2σ²(z₁₋α + z₁₋β)² / (Δ + M)², where Δ is the expected true difference (experimental minus control).
  • Binary outcomes: n per group = (z₁₋α + z₁₋β)² [pC(1 - pC) + pE(1 - pE)] / (pE - pC + M)².
  • Alpha is one-sided, conventionally 0.025, which matches checking the lower limit of a two-sided 95% confidence interval against -M.
  • The margin drives everything: halve it and the sample size roughly quadruples.

Free tool

Calculate a non-inferiority sample size

Pick a continuous or binary primary outcome, enter the inputs and an expected dropout rate. Higher values are treated as better. It runs in your browser; nothing is saved or sent.

Primary outcome
%
Evaluable per group
132
264 in total, 1:1
Enrol per group
147
294 in total with 10% dropout

n = 2 × σ² × (z₁₋α + z₁₋β)² / (Δ + M)² = 2 × 10² × (1.960 + 1.282)² / (0 + 4)² = 131.3

z₁₋α = 1.960 (one-sided α 0.025), z₁₋β = 1.282 (power 90%). Enrolment = evaluable ÷ (1 − dropout), rounded up.

Planning aid and reference only, not validated software. Convention: higher values are better and the margin M is entered as a positive number, so H₀ is (experimental − control) ≤ −M. Continuous formula after Julious (Stat Med 2004); binary formula after Blackwelder (Control Clin Trials 1982), normal approximation with unpooled variance. If lower values are better, swap the sign of the expected difference. Confirm the final sample size and margin justification with a statistician.

The design

What a non-inferiority trial is testing

In a superiority trial the null hypothesis is "no difference" and you hope to reject it. In a non-inferiority trial the null hypothesis is that the new treatment is worse than the active control by at least the margin: with higher values better, H0 is (experimental minus control) ≤ -M. Rejecting it shows the new treatment is not unacceptably worse. It does not show the two are equal, and it does not show the new treatment is better.

Because the question is one-directional, alpha is one-sided. A one-sided alpha of 0.025 is the usual choice, and it is the same as requiring the lower limit of a two-sided 95% confidence interval for the difference to sit above -M. Using a one-sided 0.05 halves the evidence standard, which regulators generally do not accept for a confirmatory trial.

The design only makes sense with an active control of established effect. FDA's guidance "Non-Inferiority Clinical Trials to Establish Effectiveness" (final, November 2016) describes M1, the effect of the active control over placebo that can be assumed in the new trial, and M2, the largest loss of that effect that is clinically acceptable. M2 is usually the margin you test. In the EU, the "Guideline on the choice of the non-inferiority margin" (EMEA/CPMP/EWP/2158/99, effective January 2006) still applies; EMA published a draft replacement, "Non-inferiority and equivalence comparisons in clinical trials" (EMA/301654/2025), whose consultation closed on 31 May 2026. Check its status before you finalise a protocol. This page is not regulatory advice.

The formulas

Worked examples for means and proportions

Continuous outcome. With σ = 10, M = 4, an expected true difference Δ = 0, one-sided alpha 0.025 (z = 1.960) and 90% power (z = 1.282), the sum of the z values squared is 10.51. n = 2 x 100 x 10.51 / 4² = 131.3, so 132 evaluable participants per group, 264 in total. This follows Julious (Statistics in Medicine, 2004). At 80% power the same inputs need 99 per group.

The expected true difference matters as much as the margin. If you expect the new treatment to be slightly better (Δ = +1), the denominator becomes 5² and n falls to 85 per group. If you expect it to be slightly worse (Δ = -1), the denominator is 3² and n rises to 234. Assuming "no difference" when the honest expectation is a small deficit is one of the commonest ways to underpower a non-inferiority trial.

Binary outcome. With success in 85% of both arms, M = 10 percentage points, one-sided alpha 0.025 and 90% power: n = 10.51 x (0.85 x 0.15 + 0.85 x 0.15) / 0.10² = 267.9, so 268 per group. This is the normal-approximation formula with unpooled variances, as in Blackwelder (Controlled Clinical Trials, 1982). If the experimental arm is expected to reach only 82%, n rises to 590 per group; with a 5-point margin and equal rates, it is 1,072.

Dropout

The formulas give evaluable participants. To get enrolment, divide by (1 - dropout) and round up: 268 evaluable at 10% dropout means 298 enrolled per group. The dropout-adjusted calculator explains why dividing is correct and adding a percentage is not.

Sensitivity

Binary outcome: per-group sample size by margin and true rates

Control success 85%, one-sided alpha 0.025, 90% power, evaluable participants per group, rounded up.

Experimental successMargin 15 pointsMargin 10 pointsMargin 5 points
87% (slightly better)88176516
85% (equal)1202681,072
82% (slightly worse)2015907,227

Illustrative values from the formula above. Use the calculator for your own inputs.

Interpretation

Pitfalls specific to non-inferiority

Sloppy conduct biases a non-inferiority trial toward success. Missing data, poor adherence, misclassified outcomes and protocol deviations all tend to make the two arms look alike, and looking alike is what a non-inferiority trial is trying to show. That is the opposite of a superiority trial, where the same problems usually hide an effect. Regulators therefore look at both the full analysis set and the per-protocol set, and expect consistent conclusions.

The margin must be justified from historical evidence and clinical judgement before unblinding, never chosen to fit the sample size you can afford. The trial also relies on assay sensitivity and the constancy assumption: the active control must work in your trial as well as it did in the historical placebo-controlled trials. If standards of care have changed, that assumption weakens.

Limits of this calculator

It covers a single comparison of two arms with 1:1 allocation and a normal approximation. It does not handle:

  • Ratio margins (risk ratio, odds ratio, hazard ratio) or time-to-event outcomes.
  • Unequal allocation, interim analyses or more than two arms.
  • Exact or score-based methods, which matter when proportions are near 0% or 100%.
  • Equivalence designs, which test two one-sided hypotheses.

Protect a non-inferiority trial from messy data

Build the eCRFs, edit checks and randomisation in the free sandbox and see the audit trail. No credit card. You pay only when you go live.

Build your study free

Running the trial

Data quality is part of the sample size

Because poor conduct pushes a non-inferiority result toward success, the data system is part of the design. In Capture, edit checks with range high, range low or custom rules raise a query automatically when a site enters a value that breaks a rule, and the field-level audit trail records the old value, new value, user, time and reason for every change. Source data verification can be set per field, so monitors focus on the primary endpoint and the variables that define the per-protocol set. Protocol deviation tracking describes how teams log the deviations that decide who is in that set.

Randomisation runs in the same system, blinded roles never receive treatment-arm values, and at database lock you can export CSV or Excel with a data dictionary, or SDTM datasets as SAS XPT files with Define-XML, for both analysis sets. Phase 3 confirmatory trials are a normal use case; see EDC for Phase 3 clinical trials. For a superiority comparison of two proportions, use the sample size calculator instead.

Before the protocol is final

Non-inferiority sample size checklist

Margin justified

M1 from historical trials, M2 from clinical judgement, written down before the trial starts.

Direction defined

Whether higher or lower values are better, and the difference as experimental minus control.

Realistic true difference

Do not assume zero if a small deficit is plausible.

One-sided alpha stated

Usually 0.025, equivalent to a two-sided 95% CI.

Both analysis sets planned

Full analysis set and per-protocol set, with rules for each.

Dropout inflation

Enrolment = evaluable / (1 - dropout).

FAQ

Questions teams ask before they switch

Something not covered here? Ask us directly.

What is the sample size formula for a non-inferiority trial with a continuous outcome?

n per group = 2σ²(z₁₋α + z₁₋β)² / (Δ + M)², with σ the standard deviation, M the margin as a positive number and Δ the expected true difference, experimental minus control, when higher values are better.

Why is alpha one-sided in a non-inferiority trial?

The hypothesis is directional: you only need to rule out that the new treatment is worse by M or more. A one-sided 0.025 is the convention and matches a two-sided 95% confidence interval.

How do I choose the non-inferiority margin?

From the historical effect of the active control over placebo (M1) and a clinical judgement of how much of that effect may be lost (M2). FDA's 2016 guidance and the EMA guideline describe the approach. Do not choose it to fit a budget.

Why does a smaller margin need so many more participants?

The margin is squared in the denominator. Halving it, with an expected difference of zero, multiplies the sample size by about four.

Does this work for hazard ratios or risk ratios?

No. It handles a difference in means or a difference in proportions. Ratio margins and time-to-event outcomes need other formulas or simulation.

Is this calculator validated?

No. It is a free planning aid. Have a statistician confirm the sample size, the margin justification and the analysis method before the protocol is submitted.

Run the trial the margin assumes

Free sandbox with every feature. No credit card. You pay only when you go live.

Build your study free