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.
Free sandbox · No credit card · 21 CFR Part 11 aligned
Margin
10 points
Evaluable per group
268
Enrol per group (10% dropout)
298
Total enrolment
596
120 per group
268 per group
1,072 per group
What this calculator does
Free tool
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.
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
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
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.
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
Control success 85%, one-sided alpha 0.025, 90% power, evaluable participants per group, rounded up.
| Experimental success | Margin 15 points | Margin 10 points | Margin 5 points |
|---|---|---|---|
| 87% (slightly better) | 88 | 176 | 516 |
| 85% (equal) | 120 | 268 | 1,072 |
| 82% (slightly worse) | 201 | 590 | 7,227 |
Illustrative values from the formula above. Use the calculator for your own inputs.
Interpretation
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.
It covers a single comparison of two arms with 1:1 allocation and a normal approximation. It does not handle:
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.
Running the trial
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
M1 from historical trials, M2 from clinical judgement, written down before the trial starts.
Whether higher or lower values are better, and the difference as experimental minus control.
Do not assume zero if a small deficit is plausible.
Usually 0.025, equivalent to a two-sided 95% CI.
Full analysis set and per-protocol set, with rules for each.
Enrolment = evaluable / (1 - dropout).
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.
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.
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.
The margin is squared in the denominator. Halving it, with an expected difference of zero, multiplies the sample size by about four.
No. It handles a difference in means or a difference in proportions. Ratio margins and time-to-event outcomes need other formulas or simulation.
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.
Keep exploring
Clinical trial sample size calculator
Superiority comparison of two proportions.
Dropout-adjusted sample size calculator
Turn evaluable numbers into enrolment.
Survival sample size calculator
Events needed for a log-rank test.
Number needed to treat calculator
Absolute effect sizes from event rates.
Sample size calculation
The concepts behind the formulas.
Bayesian clinical trial design guide
Alternatives to fixed frequentist designs.
Free sandbox with every feature. No credit card. You pay only when you go live.