Home/Free tools/Sample size calculator
Sample size calculator
Pubrica’s free sample size calculator estimates how many participants a two-group study needs to detect a difference in means, a difference in proportions or a hazard ratio. Enter the effect you want to detect, the significance level, power, allocation ratio and expected loss to follow-up to see the total number to randomise and the number per group.
The tool runs in your browser. No registration, email address or file upload is required, and the formula, reference or assessment criteria used are shown with the result.
- Runs in your browser
- Nothing uploaded or stored
- No email asked for
- Method shown with the answer
- Sources dated
The Tool
Calculate the Sample Size for a Two-Group Comparison
Estimates the number of participants a two-group comparison needs for a difference in means, a difference in proportions or a hazard ratio.
01
Estimates the number of participants a two-group comparison needs for a difference in means, a difference in proportions or a hazard ratio.
Means · proportions · time to event211
Group 1, allowing for loss
211
Group 2, allowing for loss
Difference of 4.00 with a standard deviation of 12.00 (standardised effect 0.33). Anything smaller than this will probably not reach significance in a trial of this size, and that is the number a reviewer will ask you to justify clinically — not statistically.
Method. Two independent means, normal approximation: n₁ = (1 + 1/k)(z1−α/2 + z1−β)²σ² / Δ². This is the textbook closed-form answer. A cluster design, an interim look, a non-inferiority margin, a repeated measure or a competing risk all change it, and none of them can be added by adjusting this number afterwards.
Limitations
What This Tool Does Not Cover
Use the result as a starting point. These are the situations in which it needs specialist review.
The calculators
Limitations of the calculators
The sample size calculator gives the closed-form answer for two independent groups. Cluster randomisation, interim analyses, a non-inferiority margin, repeated measures and competing risks each change the number materially, and none of them can be handled by inflating the answer afterwards. The same applies to the test chooser: it cannot know that your observations are clustered within clinics, and clustering overrides almost everything else it would tell you.
Method
Methods and Sources
The calculation or reference set behind this tool. The result panel also shows the formula or criteria used.
Sample size
Closed form
Normal-approximation formulas for two means and two proportions, with the pooled variance under the null; Schoenfeld’s requirement for the log-rank test. The inverse normal is Acklam’s rational approximation, accurate to about one part in 10⁹.
Related Services
Related Pubrica Services
When your project needs more than an estimate, these services provide specialist support.
More Free Tools
Other Free Research Tools
All Pubrica tools run in your browser and show the method used with each result.
Discuss Your Study Design and Sample Size
Send us your study design, manuscript or deadline. A subject specialist will review it and provide a quote within two business days, at no cost and with no obligation.