CALCULATOR · SAMPLE SIZE & POWER
Non-Inferiority Sample Size Calculator with Margin Justification
Enter the non-inferiority margin, the expected difference, the variability or the expected proportions, the one-sided alpha, the power and the allocation ratio. The size of the control and treatment groups, with the margin notes, update as you type. Nothing you enter leaves your browser.
Runs in your browser. No data is sent or stored.
Method reviewed by an in-house statistician · Last checked November 2026
In Short
A non-inferiority sample size calculator finds the number of participants needed to show that a new treatment is not worse than a control by more than a prespecified margin. Two tabs cover a continuous outcome and a binary outcome. The calculation is one-sided, with a default alpha of 0.025, and it returns the control group size and the treatment group size separately, each rounded up. The margin is a clinical judgment that has to be justified before the calculation. The sample size is only as defensible as that margin.
How It Is Calculated
For a continuous outcome, the effective non-inferiority distance D combines the margin M, the largest acceptable inferiority, with the expected true difference Δ = μ_T − μ_C. When a higher outcome is better, D = M + Δ. When a lower outcome is better, D = M − Δ. The anticipated effect must lie on the non-inferior side of the margin, so D must be above zero. The normal-approximation formula is:
σ = common standard deviation · α = one-sided significance level · 1 − β = power · r = allocation ratio n_T : n_C · z = standard normal quantile.
The result shown is slightly more exact than the formula: the calculator increases n_C one participant at a time, sets n_T to the next whole number at or above r · n_C, and checks the power of the one-sided t-test with the noncentral t distribution until it reaches 1 − β. The achieved power is shown. A dropout inflation applies to both groups.
For a binary outcome, p_C and p_T are the expected proportions with the favorable outcome. D = p_T − p_C + M when higher is better, and D = p_C − p_T + M when lower is better (p is then the proportion with the unfavorable event). D must be above zero. The control group size uses the unpooled variance (Chow et al., 2017, section 4.2.3):
Each size is rounded up. “Per group” is used only when r = 1. Both tabs show the margin note, the analysis-population note (intention-to-treat and per-protocol) and a missing-data line.
Assumptions and When Not to Use It
- A margin justified before the calculation. The margin M is a clinical judgment, not a result of the calculation, and it is argued and fixed before the sample size is computed. See Randomized Controlled Trial Design.
- One-sided alpha. The default is 0.025. A two-sided test of a difference in either direction is a superiority design; use the Sample Size Calculator for Research Studies.
- A direction that matches the outcome. The switch for “higher is better” or “lower is better” changes D. A wrong direction changes the answer substantially.
- An expected difference on the right side. If D is zero or negative, the calculator returns a message, not a number.
- Independent groups without clustering. The calculator assumes independent participants. For clustered designs, adjust with the Design Effect Calculator.
- Inputs that carry uncertainty. The SD or the control proportion comes from a source; if it is optimistic, the study is underpowered. A sensitivity analysis shows the risk.
Worked Example (Hypothetical Values)
A trial compares a new regimen with standard care on a symptom score, where a higher score is better. The team accepts a margin of 5 points, expects no true difference, uses an SD of 12 from a previous study and plans 80% power at a one-sided alpha of 0.025 with 1 : 1 allocation.
| Input or result | Value |
|---|---|
| Margin M | 5 points |
| Expected difference Δ | 0 |
| Standard deviation σ | 12 points |
| Alpha, one-sided | 0.025 |
| Power | 0.80 |
| Allocation r (n_T : n_C) | 1 |
| Normal formula | 91 per group |
| t-based search (shown) | 92 per group, achieved power 0.8026 |
Before any dropout inflation, the trial needs 92 participants in each group. Press “Load the worked example” under the calculator and these values fill the fields. HYPOTHETICAL VALUES.
What the Result Still Needs
- 1
A justified margin. The margin has a clinical argument that a reviewer can follow, and it is stated in the protocol before the data are seen.
- 2
A source for the SD or the control proportion. From a published trial in a comparable population, with the citation in the protocol.
- 3
An analysis population plan. The protocol states whether non-inferiority is judged in the intention-to-treat population, the per-protocol population or both.
- 4
Dropout and missing data. The sample size is inflated for expected dropout, and the number to recruit is reported next to the number to analyze.
- 5
A justification paragraph. The margin, the inputs with their sources and the final group sizes are written for the protocol, the grant or the ethics form.
A statistician checks your margin and your inputs against the sources, reruns the calculation for your exact design and writes the justification paragraph for your protocol.
Research Planning & Study DesignIndependent Statistical Review confirms a sample size calculation prepared by you, a colleague or an AI tool before it goes to a committee.
Independent Statistical ReviewFrequently Asked Questions
Why is alpha one-sided at 0.025?
A non-inferiority test asks one question: is the new treatment worse than the control by more than the margin? That is a one-sided hypothesis, and 0.025 one-sided keeps the same critical value as a two-sided 0.05. Report the one-sided level and the margin together.
Why do the control and treatment groups have different sizes?
The calculator returns the control group size and the treatment group size separately because allocation can be unequal. With r = 2 in the continuous test case, the control group needs 69 and the treatment group 138. “Per group” is used only for 1 : 1 allocation.
What does the direction switch do?
It decides which side of the margin is non-inferior. When a higher outcome is better, D = M + Δ, and when a lower outcome is better, D = M − Δ. Check it first: the wrong direction changes the answer.
What if my expected difference is already beyond the margin?
Then D is zero or negative, and no sample size can show non-inferiority, so the calculator shows a message. Revisit the expected effect, the margin or the design.
How is a binary outcome handled?
Enter the expected proportions with the favorable outcome in each group and the margin as an absolute difference. For p_C = 0.80, p_T = 0.80, a margin of 0.10 and 80% power with 1 : 1 allocation, the test case gives 252 per group. For a binary outcome where lower is better, enter the proportion with the unfavorable event.
References
- Chow, S. C., Shao, J., Wang, H., & Lokhnygina, Y. (2017). Sample size calculations in clinical research (3rd ed.). Chapman and Hall/CRC.
- Julious, S. A. (2010). Sample sizes for clinical trials. Chapman and Hall/CRC.
- Piaggio, G., Elbourne, D. R., Pocock, S. J., Evans, S. J. W., Altman, D. G., & CONSORT Group. (2012). Reporting of noninferiority and equivalence randomized trials: Extension of the CONSORT 2010 statement. JAMA, 308(24), 2594-2604. https://doi.org/10.1001/jama.2012.87802
Method reviewed by an in-house statistician · Last checked November 2026 · Test cases and boundary cases verified before release
Found an error or have a suggestion? Write to info@onlinespss.com with the calculator name and the inputs you used. Every report is checked by a statistician.
Have a Statistician Confirm Your Non-Inferiority Sample Size
Share the study aim, the outcome, the margin and the sources for your SD or proportions. A statistically trained Research Coordinator reviews the request, and the scope and one fixed project fee are confirmed before work begins.
No Commitment Required
Strictly Confidential
Fixed Project Fee
In-House PhD-Level Statisticians
Same-Day Response