Power Sample Size Calculator
Calculate the required sample size for statistical studies based on desired power, effect size, and significance level.
Power Sample Size Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: n = ((z_alpha + z_beta)^2 * 2) / d^2
Worked example โ 63 patients per group (126 total) needed for 80% power to detect a medium effect
Formula
n = ((z_alpha + z_beta)^2 * 2) / d^2
Where n is the sample size per group, z_alpha is the critical z-value for the chosen significance level, z_beta is the z-value corresponding to the desired power (1 - beta), and d is Cohen's d effect size (mean difference divided by pooled standard deviation). For a one-sample test, remove the factor of 2. The formula assumes equal group sizes for two-sample tests.
Worked Examples
Example 1: Clinical Drug Trial Sample Size
Problem:A researcher plans a two-group clinical trial expecting a medium effect size (d=0.5) and wants 80% power at alpha=0.05 (two-tailed). How many patients per group?
Solution:z_alpha/2 = z(0.025) = 1.96 z_beta = z(0.20) = 0.842 n per group = ((1.96 + 0.842)^2 * 2) / 0.5^2 = (2.802^2 * 2) / 0.25 = (7.851 * 2) / 0.25 = 15.702 / 0.25 = 62.8 Round up: n = 63 per group
Result:63 patients per group (126 total) needed for 80% power to detect a medium effect
Example 2: Gene Expression Study with Small Effect
Problem:A genomics study expects a small effect (d=0.3) and needs 90% power at alpha=0.01 (two-tailed). Calculate required sample size.
Solution:z_alpha/2 = z(0.005) = 2.576 z_beta = z(0.10) = 1.282 n per group = ((2.576 + 1.282)^2 * 2) / 0.3^2 = (3.858^2 * 2) / 0.09 = (14.884 * 2) / 0.09 = 29.768 / 0.09 = 330.8 Round up: n = 331 per group
Result:331 samples per group (662 total) needed for 90% power at alpha=0.01 with small effect
Frequently Asked Questions
What is statistical power and why does it matter?
Statistical power is the probability that a test will correctly reject a false null hypothesis (i.e., detect a real effect when one exists). A power of 0.80 means there is an 80% chance of detecting the effect if it truly exists, and a 20% chance of a Type II error (missing the effect). In biological research, underpowered studies waste resources and may fail to detect important effects like drug efficacy or genetic associations. Most journals and regulatory agencies require a minimum power of 0.80, though 0.90 is recommended for critical studies.
How do I choose an appropriate effect size?
Effect size (Cohen's d) quantifies the magnitude of the difference between groups relative to variability. Cohen suggested benchmarks: small (d=0.2), medium (d=0.5), and large (d=0.8). However, it is better to base your effect size on prior research, pilot studies, or the minimum clinically meaningful difference. For example, if a drug must reduce blood pressure by at least 5 mmHg (SD=10) to be clinically relevant, d = 5/10 = 0.5. Using standardized benchmarks without domain knowledge can lead to misleadingly sized studies.
What is the relationship between sample size, power, and effect size?
These three quantities are mathematically linked: increasing any one allows you to decrease another. Larger sample sizes increase power for a given effect size. Larger effect sizes require smaller samples for the same power. Common trade-offs include: to detect a small effect (d=0.2) at 80% power requires about 394 per group; a medium effect (d=0.5) requires about 64 per group; a large effect (d=0.8) requires only about 26 per group. Doubling sample size does not double power; the relationship follows a curve that flattens as power approaches 1.0.
When should I use a one-tailed vs two-tailed test?
Use a two-tailed test (default) when the effect could go in either direction, which is most common in exploratory research. Use a one-tailed test only when you have strong prior evidence that the effect can only go in one direction AND it would be meaningless or impossible to go the other way. For example, testing if a new drug is better (not just different) than placebo. One-tailed tests require smaller sample sizes but are controversial in peer review. Most biostatisticians recommend two-tailed tests unless there is a compelling scientific rationale for directionality.
How does the significance level (alpha) affect sample size?
A smaller alpha (e.g., 0.01 vs 0.05) means stricter criteria for significance, requiring a larger sample to achieve the same power. At alpha = 0.05 and power 0.80 for medium effect, you need about 64 per group. At alpha = 0.01, this increases to about 95 per group. In genomics and multiple-testing scenarios, researchers often use Bonferroni-corrected alpha values (e.g., 0.05/1000 = 0.00005), which dramatically increases required sample sizes and is why genome-wide association studies need thousands of participants.
Why is post-hoc power calculated from an observed effect meaningless?
Once the data are in, power computed by plugging the observed effect back into the formula is a deterministic function of the p-value: a non-significant result always yields low observed power, and a significant one always yields high power. It therefore tells you nothing you did not already know and cannot rescue a null finding. If you want to interpret a non-significant result, report the confidence interval and ask whether it excludes the smallest effect you would care about.
How should I inflate the sample size to allow for dropout?
Power formulas return the number of subjects you need to analyse, not the number you must recruit. Divide the required n by the fraction expected to complete: a design needing 63 per group with 20 percent attrition requires 63 divided by 0.8, which is 78.75, so enrol 79 per group. Multiplying by 1.2 instead is the common error and leaves you short. Base the attrition estimate on comparable published trials, and remember that intention-to-treat analysis keeps dropouts in the denominator.
What happens to the total sample size if the groups are not equally sized?
Equal allocation is the most efficient split for a fixed total. If you randomise at a ratio k, size the smaller arm as the balanced n multiplied by (1 + 1/k) divided by 2, then multiply that by k for the larger arm. At 2:1 the smaller arm is 0.75 of the balanced figure and the larger is 1.5, so the total requirement rises by about 12.5 percent for the same power. Unequal allocation is still worth it when one arm is far more expensive or when you want more safety exposure on an experimental treatment.
Why does a paired design need fewer subjects than a two-group design?
The two-sample formula carries a factor of 2 because it must estimate two independent group means, each carrying between-subject variability. A paired or within-subject design measures each unit twice and analyses the differences, which cancels the subject-level variation entirely. The relevant effect size becomes the mean difference divided by the standard deviation of the differences, and the one-sample formula without the factor of 2 applies. The more strongly the paired measurements correlate, the larger the saving.
How does clustering, such as animals housed in the same cage, change the calculation?
Observations within a cage, litter, tank or field plot are correlated, so they carry less information than the same number of independent subjects. Multiply the required sample size by the design effect, 1 + (m - 1) times the intraclass correlation, where m is the cluster size. Five mice per cage with an ICC of 0.10 gives a design effect of 1.4, meaning 40 percent more animals. Randomising at the cluster level and analysing at the individual level without this correction inflates false positives.
References
Background & Theory
History
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer ยท Editorial policy
Related Calculators
๐งฎSample Size Calculator
Calculate sample size with inputs, formulas, and instant results.
๐งฎDog Crate Size Calculator
Calculate dog crate size with inputs, formulas, and instant results.
๐งฎDog Harness Size Calculator
Calculate dog harness size with inputs, formulas, and instant results.
๐งฎDog Size Calculator
Calculate dog size with inputs, formulas, and instant results.
๐งฎRabbit Cage Size Calculator
Calculate rabbit cage size with inputs, formulas, and instant results.
๐งฎTurtle Tank Size Calculator
Calculate turtle tank size with inputs, formulas, and instant results.
๐งฎT-Test Calculator (One & Two Sample)
Calculate t test with inputs, formulas, and instant results.
๐งฎRat Cage Size Calculator (Space per Rat)
Calculate rat cage with inputs, formulas, and instant results.