Sample Size and Power Calculator.
Size a two arm randomised trial for a continuous, binary or time to event outcome, or check the power of a planned sample.
Uses the exact t test, the pooled z test and Schoenfeld’s events, inflates for dropout the right way and writes the sample size text for your protocol. Everything is calculated in your browser.
How to Use the Sample Size Calculator
- Choose the type of primary outcome. Continuous for a mean on a scale, binary for the proportion with an outcome such as cure or relapse, and time to event for a hazard ratio.
- Choose what to find. The sample size for a target power, or the power of a planned number of participants. For continuous and binary outcomes, choose superiority or noninferiority.
- Enter the effect. The difference to detect and the standard deviation, the expected proportion in each group, or the hazard ratio and the share of participants expected to have the event.
- Set alpha, sidedness, power, allocation ratio and dropout. The defaults reproduce the CONSORT 2010 example: a difference of 3 days, an SD of 5, 80% power and 10% dropout give 50 participants per group[1].
- Read the total to enrol, open “How this was calculated” to see the working, and copy the text for your protocol. Replace the [source] placeholders with where each assumption came from.
The sample size is one of the first decisions in planning a randomised controlled trial. The number you enrol then sets the targets for recruitment and for retention.
What Alpha, Power and Effect Size Mean
Alpha
The probability of wrongly rejecting the null hypothesis, a type I error. It is conventionally set at 5% or less, and lower when multiple comparisons require it[2].
Power
One minus beta, where beta is the probability of failing to reject the null hypothesis when the alternative is true. Beta is conventionally set at 10% to 20%, so power is usually 80% to 90%[2]. Raising power from 80% to 90% takes the default example from 45 to 60 participants per group with outcome data.
Effect size and standard deviation
For a continuous outcome the effect is the difference in means on the natural scale of the outcome, and the standard deviation (SD) describes how much the outcome varies between participants. Report both, with the standardised effect: the difference divided by the SD[3][4]. As a rough check, Lehr’s formula gives about 16 divided by the squared standardised effect per group for 80% power at a two sided 5% level[5], which is 64 per group for a standardised effect of 0.5.
One or two sided
One sided tests need a justification stated in advance. In regulatory settings ICH E9 prefers a one sided alpha at half the conventional two sided level[2], so a one sided test at 2.5% gives the same sample size as a two sided test at 5%.
Choosing the Target Difference
The target difference should be one that one or more key stakeholder groups consider important or realistic. It does not have to be the minimum important value if a larger difference is realistic or would be needed to change practice[4]. When an important difference is not established, the DELTA2 guidance favours anchor and opinion seeking methods, says the distribution method should not be used, and treats a standardised effect size on its own as a last resort[4].
Where a minimal clinically important difference (MCID) has been established for the instrument, it is a natural starting point. The MCID was introduced to interpret changes in quality of life scores against patients’ own global ratings of change[6]. The MCID and MDC calculator in the related tools below helps tell meaningful change apart from measurement error.
Smaller differences need disproportionately larger samples[3]: halving the difference in the default example takes it from 45 to 176 per group. Target differences also tend to be optimistic. In 107 UK Health Technology Assessment trials with continuous outcomes, the median standardised target effect was 0.30 but the median observed effect was 0.11[7]. For outcomes measured with wearables or apps, our guide to digital endpoints in clinical trials covers how those endpoints are chosen.
The Formulas Used Here
Continuous outcomes
The normal approximation gives the number in the control group for an allocation ratio k, intervention to control[8]:
n = (1 + 1/k) × SD² × (z(1 − α/2) + z(1 − β))² ÷ Δ²
The headline uses the exact power of the two sample t test, from the noncentral t distribution with n₁ + n₂ − 2 degrees of freedom and noncentrality λ = Δ ÷ (SD × √(1/n₁ + 1/n₂)). The calculator searches for the smallest whole group size whose power reaches the target, as Stata and PASS do[8][9].
Binary outcomes
The pooled z test, equivalent to Pearson’s chi squared test, uses the pooled proportion p̄ under the null hypothesis[10]:
n = [z(1 − α/2) × √((1 + 1/k) p̄q̄) + z(1 − β) × √(p₁q₁ + p₂q₂/k)]² ÷ Δ²
The calculator then searches for the smallest group size with enough power. The optional continuity correction of Fleiss, Tytun and Ury adds participants[11]. PASS advises against it with large sample approximations because it reduces the power and the actual alpha[12], but it matches published tables that include it.
Time to event outcomes
Power depends on the number of events, not the number of participants[13]. Schoenfeld’s formula gives the events[14]:
E = (z(1 − α/2) + z(1 − β))² × (1 + k)² ÷ (k × (ln HR)²)
The participants needed are the events divided by the overall probability of an event. The intervention group’s probability comes from the control group’s under proportional hazards, 1 − (1 − p₁)^HR[13]. Freedman’s formula, shown in the working, usually gives more events[15][13].
Why Calculators Give Different Answers
Most differences between tools and textbooks come from the method and the rounding, not from errors. State the method in your protocol so others can repeat the calculation.
Exact t test or normal approximation
In our checks across standardised effects from 0.05 to 3, the exact t test needed zero to two more participants per group than the normal approximation. The CONSORT 2010 example of 50 per group reproduces only with the t test, and a CONSORT 2025 example of 214 in total only with the normal approximation[1][3].
Continuity correction
The Fleiss correction adds participants: 128 rather than 118 per group for 55% against 75% at 90% power. Fleiss rounds to the nearest whole number in his worked examples, so a tool that always rounds up can show one more[12].
Dropout: Divide, Do Not Multiply
If a share d of randomised participants will give no primary outcome data, enrol n ÷ (1 − d) in each group, rounded up[13][9]. With 10% dropout, 90 participants with outcome data need 90 ÷ 0.9 = 100 at enrolment.
Multiplying by (1 + d) falls short, because n × (1 + d) participants leave n × (1 + d) × (1 − d) = n × (1 − d²) with outcome data on average. Enrolling 90 × 1.1 = 99 leaves 89.1. The gap grows with dropout: multiplying leaves 96% of the participants you need at 20% dropout and 91% at 30%.
Inflation restores precision, not protection from bias. A larger sample does not account for bias when the missing outcomes differ from the observed ones[17], and both equal and unequal dropout between groups can bias the estimate[18]. Keeping participants in the study is the better lever, and our guide to patient retention in clinical trials covers practical ways to do it.
Expected dropout varies. The median share of participants with valid primary outcome data was 89% (interquartile range 79% to 97%) in 151 UK Health Technology Assessment trials[19], and the median loss to follow up was 6% (interquartile range 2% to 14%) in 235 trials in five general medical journals[20].
Common Mistakes to Avoid
- An optimistic target difference. Planned effects in one review were almost three times the observed effects[7].
- A pilot SD taken at face value. Observed SDs were larger than predicted for 80% of endpoints in trials in four major journals[21]. Using an upper confidence limit of the pilot SD gives enough participants to reach the planned power more often[22], and pilot studies used to guide power calculations tend to underpower the studies that go ahead[23]. A 20% larger SD, 6 instead of 5, raises the default example from 45 to 64 per group.
- Unequal allocation the calculation ignores. In a review of 65 trials with unequal randomisation, only 22% appeared to take the ratio into account[24]. A 2:1 ratio needs about 12.5% more participants in total than 1:1.
- Power calculated after the trial. Power should play no role once the data are in[25]. Confidence intervals show what a trial could and could not rule out[1][26]. For a two sided z test at alpha 0.05, a result with p = 0.05 always has an observed power of about 50%.
- A one sided test chosen without a reason stated in advance[2].
Reporting the Sample Size Calculation
CONSORT 2010 item 7a asks how the sample size was determined[27]. CONSORT 2025 item 16a asks the same, including all assumptions supporting the calculation[28]. For protocols, SPIRIT 2013 item 14 asks for the estimated number of participants and how it was determined[29], and SPIRIT 2025 item 19 asks how the sample size was determined, including all assumptions[30].
The DELTA2 core items are the primary outcome, the significance level and power, the target difference for the outcome type, the allocation ratio, the resulting sample size, any adjustment such as loss to follow up with its justification and, for a time to event outcome, the number of events[4][3]. Name the formula or software used[3]. The text for your protocol from the calculator covers these items, with placeholders for the sources.
Reporting is often incomplete. In 215 trials published in six high impact general medical journals, 43% did not report all the required parameters[31].
Noninferiority Designs
A noninferiority trial asks whether the intervention is not worse than the control by more than a margin. The calculator takes the margin as a positive number on the outcome scale, with the direction of benefit, and defaults to a one sided alpha of 0.025, as ICH E9 prefers in regulatory settings[2]. FDA guidance describes the usual margin as a clinically relevant part of the effect the control treatment showed in past trials[32].
For binary outcomes the calculator uses the unpooled variance, which reproduces the tables of Julious and Campbell[33][34]. Assessing power at a true difference of zero underestimates the sample size if the intervention is in fact slightly worse than the control[2]. Report the margin and its rationale with the CONSORT extension for noninferiority trials[35].
Limitations of This Calculator
- Two parallel groups only. Cluster randomised trials need a design effect, and crossover, paired, factorial and multi arm designs need other methods[36]. Equivalence designs and interim analyses are not covered.
- A common SD for continuous outcomes. With a baseline correlation ρ, an analysis adjusted for baseline (ANCOVA) on (1 − ρ²) × n per group has the power of a t test on n per group[37]. The calculator does not apply this saving.
- Proportional hazards for time to event outcomes. With long recruitment, use the event rate at the average follow up time, because using the minimum follow up overestimates the sample size[13].
- Large sample methods. For a binary outcome with fewer than 5 expected events in a group, an exact method may be needed[10].
- Dropout only. Participants who stay but do not adhere dilute the intention to treat effect, which may call for a smaller target difference[2]. The calculator does not model it.
Once the numbers are set, see how WeGuide supports clinical trials from consent to follow up.
Planning a randomised trial?
WeGuide randomises participants with configurable allocation ratios, sends automated reminders and tracks dropout as it happens, to help keep participants in the study until the primary outcome.
Frequently Asked Questions
Answers about sample size, power and dropout when planning a randomised trial.
Have another question?How do I calculate the sample size for a randomised controlled trial?
You need the primary outcome, the difference you want to detect, how variable the outcome is, the significance level and the power. For a continuous outcome that means a difference in means and a standard deviation. For a binary outcome it means the expected proportion in each group, and for a time to event outcome a hazard ratio and an event rate. Add the allocation ratio and the expected dropout to get the number to enrol.
What do alpha and power mean?
Alpha is the chance of concluding there is a difference when there is none, conventionally 5% or less. Power is the chance of detecting a real difference of the size you specified, conventionally 80% or 90%. A lower alpha or a higher power both increase the sample size. In the default example, raising power from 80% to 90% takes the number with outcome data from 45 to 60 per group.
How do I choose the difference to detect?
Choose a difference that patients, clinicians or other key stakeholders would consider important, or one that is realistic based on evidence, and state where it came from. Where a minimal clinically important difference has been established for the outcome, it is a natural starting point. Be cautious about optimism: in one review of UK trials, the median target effect was almost three times the median effect the trials observed.
Where should the standard deviation come from?
Take it from previous trials in a similar population where possible. A small pilot study gives an imprecise SD, so consider using the upper confidence limit of the pilot SD, and check how the sample size changes if the SD is larger than expected. Underestimated SDs are a common reason trials end up underpowered. A 20% larger SD raises the default example from 45 to 64 per group.
How do I adjust the sample size for dropout?
Divide the number you need with outcome data by the proportion you expect to keep, in each group. With 10% dropout, 90 participants with outcome data need 90 ÷ 0.9 = 100 at enrolment. Multiplying by 1.1 gives 99, which leaves fewer than 90 with outcome data on average. Inflation protects precision only. It does not remove bias if those who drop out differ from those who stay.
Should I use a one sided or a two sided test?
Use a two sided test unless a one sided test is justified before the trial starts. In regulatory settings a one sided test is usually run at half the two sided alpha, 2.5%, which gives the same sample size as a two sided test at 5%. Noninferiority trials use a one sided test because their question has one direction: is the intervention not worse than the control by more than the margin?
Why is my result slightly different from another calculator or a textbook?
Small differences come from the method and the rounding. For continuous outcomes this tool uses the exact t test, which usually needs zero to two more participants per group than the normal approximation. For binary outcomes a continuity correction adds participants. For time to event outcomes, Freedman’s method usually gives more events than Schoenfeld’s. Some sources round to the nearest whole number instead of up, and some inflate for dropout before rounding.
How many events do I need for a time to event outcome?
Power depends on the number of events, so the calculator first finds the events needed for your hazard ratio, alpha and power with Schoenfeld’s formula. It then divides by the share of participants expected to have the event during follow up to get the number of participants. State both the number of events and the number of participants in the protocol and in the report.
Can I calculate the power of my study after it has finished?
It is not recommended. Power is a planning tool and should play no role once the data are in. Observed power is a fixed function of the p value: for a two sided z test, a result with p = 0.05 always has an observed power of about 50%. Report the confidence interval instead, which shows what the trial could and could not rule out.
What should I report about the sample size in my protocol and paper?
SPIRIT 2025 item 19 and CONSORT 2025 item 16a ask how the sample size was determined, including all assumptions. Give the primary outcome, the target difference and its source, the SD or control group rate, alpha, power, the allocation ratio, the dropout allowance, the resulting numbers and the method or software used. The text for your protocol that the calculator writes covers these items.
Related Research Tools
Free tools for planning and running clinical research, built on published methods.
References
- Moher D, Hopewell S, Schulz KF, et al. CONSORT 2010 explanation and elaboration: updated guidelines for reporting parallel group randomised trials. BMJ. 2010;340:c869. PubMed 20332511
- International Council for Harmonisation. E9 Statistical Principles for Clinical Trials. Step 4, 5 February 1998. ICH E9 guideline (PDF)
- Hopewell S, Chan AW, Collins GS, et al. CONSORT 2025 explanation and elaboration: updated guideline for reporting randomised trials. BMJ. 2025;389:e081124. PubMed 40228832
- Cook JA, Julious SA, Sones W, et al. DELTA2 guidance on choosing the target difference and undertaking and reporting the sample size calculation for a randomised controlled trial. BMJ. 2018;363:k3750. PubMed 30560792
- Lehr R. Sixteen S-squared over D-squared: a relation for crude sample size estimates. Stat Med. 1992;11:1099-102. PubMed 1496197
- Jaeschke R, Singer J, Guyatt GH. Measurement of health status. Ascertaining the minimal clinically important difference. Control Clin Trials. 1989;10:407-15. PubMed 2691207
- Rothwell JC, Julious SA, Cooper CL. A study of target effect sizes in randomised controlled trials published in the Health Technology Assessment journal. Trials. 2018;19:544. PubMed 30305146
- StataCorp. Stata 19 Power, Precision, and Sample-Size Reference Manual: power twomeans. Stata manual (PDF)
- NCSS. PASS Sample Size Software, chapter 422: Two-Sample T-Tests Assuming Equal Variance. PASS documentation (PDF)
- StataCorp. Stata 19 Power, Precision, and Sample-Size Reference Manual: power twoproportions. Stata manual (PDF)
- Fleiss JL, Tytun A, Ury HK. A simple approximation for calculating sample sizes for comparing independent proportions. Biometrics. 1980;36:343-6. PubMed 26625475
- NCSS. PASS Sample Size Software, chapter 200: Tests for Two Proportions. PASS documentation (PDF)
- StataCorp. Stata 19 Power, Precision, and Sample-Size Reference Manual: power logrank. Stata manual (PDF)
- Schoenfeld DA. Sample-size formula for the proportional-hazards regression model. Biometrics. 1983;39:499-503. PubMed 6354290
- Freedman LS. Tables of the number of patients required in clinical trials using the logrank test. Stat Med. 1982;1:121-9. PubMed 7187087
- Hsieh FY. Comparing sample size formulae for trials with unbalanced allocation using the logrank test. Stat Med. 1992;11:1091-8. PubMed 1496196
- Little RJ, D'Agostino R, Cohen ML, et al. The prevention and treatment of missing data in clinical trials. N Engl J Med. 2012;367:1355-60. PubMed 23034025
- Bell ML, Kenward MG, Fairclough DL, Horton NJ. Differential dropout and bias in randomised controlled trials: when it matters and when it may not. BMJ. 2013;346:e8668. PubMed 23338004
- Walters SJ, Bonacho dos Anjos Henriques-Cadby I, Bortolami O, et al. Recruitment and retention of participants in randomised controlled trials: a review of trials funded and published by the United Kingdom Health Technology Assessment Programme. BMJ Open. 2017;7:e015276. PubMed 28320800
- Akl EA, Briel M, You JJ, et al. Potential impact on estimated treatment effects of information lost to follow-up in randomised controlled trials (LOST-IT): systematic review. BMJ. 2012;344:e2809. PubMed 22611167
- Vickers AJ. Underpowering in randomized trials reporting a sample size calculation. J Clin Epidemiol. 2003;56:717-20. PubMed 12954462
- Browne RH. On the use of a pilot sample for sample size determination. Stat Med. 1995;14:1933-40. PubMed 8532986
- Kraemer HC, Mintz J, Noda A, Tinklenberg J, Yesavage JA. Caution regarding the use of pilot studies to guide power calculations for study proposals. Arch Gen Psychiatry. 2006;63:484-9. PubMed 16651505
- Dumville JC, Hahn S, Miles JN, Torgerson DJ. The use of unequal randomisation ratios in clinical trials: a review. Contemp Clin Trials. 2006;27:1-12. PubMed 16236557
- Goodman SN, Berlin JA. The use of predicted confidence intervals when planning experiments and the misuse of power when interpreting results. Ann Intern Med. 1994;121:200-6. PubMed 8017747
- Levine M, Ensom MH. Post hoc power analysis: an idea whose time has passed? Pharmacotherapy. 2001;21:405-9. PubMed 11310512
- Schulz KF, Altman DG, Moher D; CONSORT Group. CONSORT 2010 statement: updated guidelines for reporting parallel group randomised trials. BMJ. 2010;340:c332. PubMed 20332509
- Hopewell S, Chan AW, Collins GS, et al. CONSORT 2025 statement: updated guideline for reporting randomised trials. BMJ. 2025;389:e081123. PubMed 40228833
- Chan AW, Tetzlaff JM, Gøtzsche PC, et al. SPIRIT 2013 explanation and elaboration: guidance for protocols of clinical trials. BMJ. 2013;346:e7586. PubMed 23303884
- Chan AW, Boutron I, Hopewell S, et al. SPIRIT 2025 statement: updated guideline for protocols of randomised trials. BMJ. 2025;389:e081477. PubMed 40294953
- Charles P, Giraudeau B, Dechartres A, Baron G, Ravaud P. Reporting of sample size calculation in randomised controlled trials: review. BMJ. 2009;338:b1732. PubMed 19435763
- US Food and Drug Administration. Non-Inferiority Clinical Trials to Establish Effectiveness: Guidance for Industry. November 2016. FDA guidance (PDF)
- Julious SA, Campbell MJ. Tutorial in biostatistics: sample sizes for parallel group clinical trials with binary data. Stat Med. 2012;31:2904-36. PubMed 22714646
- NCSS. PASS Sample Size Software, chapter 210: Non-Inferiority Tests for the Difference Between Two Proportions. PASS documentation (PDF)
- Piaggio G, Elbourne DR, Pocock SJ, Evans SJ, Altman DG; CONSORT Group. Reporting of noninferiority and equivalence randomized trials: extension of the CONSORT 2010 statement. JAMA. 2012;308:2594-604. PubMed 23268518
- Wang X, Ji X. Sample size estimation in clinical research: from randomized controlled trials to observational studies. Chest. 2020;158(1S):S12-S20. PubMed 32658647
- Borm GF, Fransen J, Lemmens WA. A simple sample size formula for analysis of covariance in randomized clinical trials. J Clin Epidemiol. 2007;60:1234-8. PubMed 17998077
Formulas checked on 20 October 2026 by the WeGuide editorial team against 96 test vectors built from the Stata and PASS documentation and published worked examples, including the CONSORT explanation papers. This tool is for research planning and education. It is not a medical device and does not give medical advice. A statistician should review the sample size for any protocol.

