Power Analysis Calculator
Calculate the required sample size for a study given the effect size, significance level, and desired statistical power.
About this calculator
This calculator computes the sample size a study needs using the standard power-analysis formula: baseSampleSize = ((Z-Alpha + Z-Beta) / Effect Size)² (line 18), where Z-Alpha comes purely from Significance Level (α) (line 14) and Z-Beta comes purely from Statistical Power (line 15) — each is a one-input calculation, unaffected by anything else on the page. Statistical Power and Effect Size are the two strongest drivers of Required Sample Size, moving it in opposite directions: raising Power (demanding a stronger detection guarantee) increases the sample size needed, while raising Effect Size (an easier-to-detect difference) decreases it. Test Type changes how that base number becomes Required Sample Size and Total Subjects Needed: Two-sample (Test Type 2) multiplies the per-group requirement by 2 and then doubles it again for the total (lines 25-26), roughly quadrupling total subjects versus a one-sample design at the same settings.
Test Type 3 (Paired) and the One-sample default, despite being offered as separate dropdown options, run through literally identical code (lines 29-30 and 33-34) and always produce the same number. This calculator does not account for unequal group sizes or unequal variances between groups in the two-sample case — it applies a flat ×2 adjustment assuming both groups are the same size with comparable variance, an assumption real unbalanced study designs often violate.
Inputs
Results
Required Sample Size (per group)
32
Total Subjects Needed
32
How to Use This Calculator
- Enter Effect Size (Cohen, Significance Level (α), and Statistical Power (1-β).
- Select the Test Type from the dropdown: One-Sample, Two-Sample (per group), or Paired.
- Review Required Sample Size (per group) and Total Subjects Needed.
- Use Z-Alpha (two-tailed) and Z-Beta to inform your decision.
- Use the chart to visualize the results and explore different scenarios by adjusting inputs.
How the result changes with Statistical Power (1-β)
| Statistical Power (1-β) | Required Sample Size (per group) | Total Subjects Needed |
|---|---|---|
| 0.5 | 16 | 16 |
| 0.6 | 20 | 20 |
| 1 | 103 | 103 |
What each input means
- Effect Size (Cohen's d)
- Expected standardized effect size. Small=0.2, Medium=0.5, Large=0.8.
- Significance Level (α)
- Probability of rejecting a true null hypothesis (Type I error rate). Common: 0.05.
- Statistical Power (1-β)
- Probability of detecting an effect when it exists. Common: 0.80 or 0.90.
- Test Type
- Determines how the base sample size becomes the required and total subject counts.
How this is calculated
Worked example, using the default values
- Identify Input Parameters4 parametersEffect Size (Cohen's d) = 0.5, Significance Level (α) = 0.05, Statistical Power (1-β) = 0.8, Test Type (1=one-sample, 2=two-sample, 3=paired) = 1 = 4 input(s) provided
- Calculate Required Sample Size32 = 32
- Calculate Total Subjects Needed32 = 32
- Calculate Z-AlphaZ-Alpha1.9604 = 1.9604
- Calculate Z-BetaZ-Beta0.8415 = 0.8415
Engine last updated . Checked against 2 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.
Frequently Asked Questions
Does switching Test Type from One-sample to Paired change the required sample size?
No — Test Type 3 (paired) and the One-sample default use the exact same formula (requiredN = ceil(baseSampleSize), lines 29-30 and 33-34 are identical code), so despite being presented as separate options, this calculator computes an identical sample size for both. Only Test Type 2 (two-sample) actually behaves differently.
How much does switching to a Two-sample test change the required sample size?
Test Type 2 multiplies the base one-sample formula by 2 for the per-group requirement (line 25) and then doubles that again to get Total Subjects Needed (line 26) — so a two-sample design needs roughly four times as many total subjects as an equivalent one-sample test at the same effect size, significance level, and power.
Why doesn't Significance Level or Statistical Power move the Effect Size Used output?
Effect Size Used is simply the Effect Size input clamped to a minimum of 0.01 and echoed back (line 8, line 48) — it never reads Significance Level or Statistical Power, so neither field has any way to change it.
What single input does Z-Alpha depend on, and what does Z-Beta depend on?
Z-Alpha is computed purely from Significance Level (α) (line 14) and Z-Beta purely from Statistical Power (line 15) — each is a one-input formula, so Effect Size and Test Type have zero effect on either value no matter how far you move them.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Effect Size Calculator
Calculate Cohen's d, Hedges' g, and Glass's delta to measure the practical significance of differences between two groups.
StatisticsT-Test Calculator
Calculate the t-statistic, degrees of freedom, and approximate p-value for a one-sample t-test.
StatisticsSample Size Calculator
Determine the required sample size for your survey or study. Calculate how many responses you need for statistically significant results.
Education & AcademicsStudy Schedule Calculator
Create a study schedule based on total hours needed and days available. Plan your study sessions effectively.
More in Math & Statistics.