A power calculator for sample size estimates the minimum number of participants you need in a study to detect a true effect, given your chosen significance level, desired power, and expected effect size. You enter those four values (or three, if you solve for power instead), and it returns the sample size per group or in total, depending on your design. This article explains the math, how to choose inputs, common mistakes, and how to interpret the result.
Formula
The most common formula for comparing two independent group means (a two-sample t-test) is:
n = 2 * ((Zα/2 + Zβ) / d)²
Where:
- n = sample size per group (each group gets this many participants)
- Zα/2 = the z-score that corresponds to your significance level (α) divided by 2. For α = 0.05, Zα/2 = 1.96
- Zβ = the z-score that corresponds to your desired power (1-β). For power = 0.80, Zβ = 0.84
- d = Cohen’s d, the standardized effect size = (mean difference) / (standard deviation)
The formula assumes equal group sizes and a two-tailed test. For a one-tailed test, use Zα instead of Zα/2 (e.g., 1.645 for α=0.05). For paired designs or proportions, the formula changes slightly, but the logic is the same.
Worked Example
Let’s use the default values from the calculator: α = 0.05, power = 0.80, d = 0.5.
Step 1: Find the z-scores.
- Zα/2 = Z0.025 = 1.96 (from standard normal tables)
- Zβ = Z0.20 = 0.84 (because power = 0.80, so β = 0.20)
Step 2: Add them: 1.96 + 0.84 = 2.80
Step 3: Divide by the effect size: 2.80 / 0.5 = 5.60
Step 4: Square it: 5.60² = 31.36
Step 5: Multiply by 2: 31.36 * 2 = 62.72
Step 6: Round up to the next whole number: 63 participants per group (126 total).
The calculator rounds up because you can’t have a fraction of a participant. The output shows 63 (rounded from 62.72).
Why Sample Size Matters
Running a study with too few participants means you might miss a real effect (low power). Running with too many wastes time and money and can make tiny, meaningless differences appear statistically significant. Power analysis helps you find the sweet spot.
Power is the probability that your test will reject the null hypothesis when it is false. In plain terms, it’s the chance your study will detect an effect if one truly exists. A common target is 0.80, meaning you accept a 20% chance of a false negative (Type II error).
The significance level (α) is the probability of a false positive (Type I error) – claiming an effect when there isn’t one. The conventional default is 0.05.
How to Choose Your Inputs
Selecting the right inputs is the hardest part. Here’s what to consider for each:
- Significance level (α): Usually 0.05. Use 0.01 if you need stronger evidence before rejecting the null. The calculator allows 0.001 to 0.1.
- Power (1-β): Commonly 0.80. For confirmatory studies (like drug trials), many use 0.90 or 0.95. The calculator allows 0.5 to 0.99.
- Effect size (d): This is the crux. You can get it from:
- Previous studies in the same field
- A pilot study
- The smallest effect you consider practically meaningful (MCID – minimal clinically important difference)
- Conventions: 0.2 = small, 0.5 = medium, 0.8 = large (Cohen’s benchmarks)
If you’re unsure, run the calculator with a range of effect sizes. For example, if you expect d between 0.3 and 0.6, compute n for both and plan for the larger sample size (which corresponds to the smaller effect).
Common Mistakes and Misconceptions
- Using the wrong effect size metric: Cohen’s d is for means. For proportions, you need a different formula (often based on the difference in proportions). For correlations, it’s a different formula again. Make sure you’re using the right type of effect size for your test.
- Forgetting to adjust for unequal groups: The formula above assumes equal group sizes. If you plan a 2:1 ratio, the total sample size increases. For a 2:1 ratio, multiply the per-group n by 2.25 (roughly) to get the total, then split accordingly.
- Ignoring dropouts: The calculated n is the number needed for analysis. If you expect 20% attrition, inflate your recruitment: divide n by (1 – dropout rate). For 20% dropout, divide by 0.80.
- Thinking power analysis is only for planning: It’s also useful for interpreting null results. If your study had low power, a non-significant result doesn’t mean no effect – it means you couldn’t detect it.
- Confusing one-tailed and two-tailed tests: One-tailed tests require fewer participants but are only appropriate when you have a strong directional hypothesis. Most fields use two-tailed as the default.
What the Result Tells You (and What It Doesn’t)
The result is the minimum sample size per group to achieve your target power, assuming your effect size estimate is correct. If the true effect is smaller than you estimated, your actual power will be lower than 0.80. If it’s larger, your power will be higher.
It does not guarantee you’ll find a significant result. It only means that, if the effect is exactly as you specified, you have an 80% chance of detecting it. The result also assumes your data will meet the test’s assumptions (normality, equal variances, etc.).
For a two-sample t-test, the calculator gives the number per group. For a paired t-test, the required sample size is usually much smaller because each participant serves as their own control. For ANOVA or regression, the calculations are more complex and often require specialized software.
Alternatives and Related Tools
This calculator handles the basic two-group comparison. For other designs, consider:
- Proportions: Use a formula based on the normal approximation to the binomial. For example, n = (Zα/2 + Zβ)² * (p1(1-p1) + p2(1-p2)) / (p1-p2)²
- Paired t-test: n = (Zα/2 + Zβ)² / dz², where dz is the standardized mean difference for paired data.
- ANOVA: Use software like G*Power or R’s pwr package. The effect size is f (Cohen’s f), and the calculation involves the number of groups.
- Regression: Power depends on the number of predictors and the expected R². Software is usually needed.
For a quick check, many online calculators (like this one) are fine for simple designs. For complex designs, consult a statistician.
Frequently Asked Questions
What is a good power level?
0.80 is the most common convention, meaning an 80% chance of detecting a true effect. Some fields require 0.90 or 0.95, especially for confirmatory research or when the cost of missing an effect is high. Higher power requires a larger sample size.
What if I don’t know the effect size?
Use the smallest effect that would be practically meaningful in your field. If you have no idea, use Cohen’s benchmarks: 0.2 (small), 0.5 (medium), 0.8 (large). But these are arbitrary – better to base it on prior research or a pilot study.
Why does my sample size decrease when effect size increases?
Because a larger effect is easier to detect. If the difference between groups is huge, you need fewer participants to see it. Conversely, a tiny effect requires a very large sample to be detected reliably.
Can I use this calculator for a one-tailed test?
Not directly. The formula uses Zα/2 for a two-tailed test. For a one-tailed test, replace Zα/2 with Zα (e.g., 1.645 for α=0.05). This will give a slightly smaller sample size. Only use one-tailed if you have a strong directional hypothesis.
What is the difference between sample size and power?
Sample size is the number of participants. Power is the probability that your study will detect an effect if it exists. Power is determined by sample size, effect size, and significance level. You can calculate any one of these if you know the other three.
Should I always round up the sample size?
Yes. The formula gives a decimal, but you can’t have half a participant. Always round up to the next whole number. If you have two groups, round up each group’s n separately, not the total.
Related
Formula used
in alpha | Significance level (α) | - | 0.05 | 0.001 | 0.1 in power | Desired power (1-β) | - | 0.8 | 0.5 | 0.99 in d | Effect size (Cohen's d) | - | 0.5 | 0.1 | 2 out n_per | Sample size per group | - | ( ( ( z_alpha + z_power ) / d )^2 ) * 2 | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Measuring Light Speed & Wavelength: How It Works
- Draco Race Blox Fruits: How to Get It
- ES File Explorer Tips & Tricks That Actually Work
- Remove Google FRP Lock on Oppo: Step-by-Step
- Forza Horizon 6: Unlock Legend Island & Earn Horizon Legend
- Clean Hair Dryer Filter: Improve Airflow