Sample Size and Power Analysis Calculator
Calculate the sample size for your study or run a power analysis online, free and directly in the browser. Switch between confidence-interval planning (estimation) and power calculations for hypothesis tests in one place, whether you need to estimate a mean, a proportion, or a rate, or compare groups with t-tests and rate tests.
- Power analysis calculator
- Sample size for mean estimates
- Sample size for proportions
- Sample size for rates
- Two-sample t-test sample size
- One-sample t-test sample size
- Paired t-test sample size
- One-sample proportion test sample size
- Two-sample proportion test sample size
- One-sample Poisson test sample size
- Two-sample Poisson test sample size
Sample size calculation vs. power analysis
The sample size is the number of observations you need so that your study can answer its question with the precision or certainty you require. There are two ways to plan it, and the calculator covers both:
Use the Estimation mode when you want to estimate a value, such as a mean or a proportion, with a given precision. You set the confidence level and the margin of error you can accept, and the calculator returns the number of observations needed to reach it.
Use the Hypothesis Tests mode when you want to detect an effect, such as a difference between two groups. A power analysis determines the sample size you need to detect an effect of a given size with a chosen significance level and statistical power. It can also be run the other way around: enter your available sample size and the calculator returns the power your test will achieve.
Which formulas does the calculator use?
The calculator states its methods openly so you can report and defend them. For proportions you choose the confidence interval method yourself:
| Method | Used for | Property |
| Normal approximation (Wald) | Proportions (selectable) | Classic textbook formula n = z2·p(1−p)/E2; matches most online calculators |
| Wilson | Proportions (selectable) | Coverage closest to the nominal confidence level |
| Exact (Clopper-Pearson) | Proportions (default) | Guarantees at least the stated confidence level; slightly larger n |
| t distribution | Means | Accounts for estimating the standard deviation from the sample |
| Normal, continuity-corrected, or exact | Hypothesis tests | Selectable per test; exact methods use binomial or Poisson distributions |
| Finite population correction | Means and proportions | Applied automatically when you enter a population size |
Because different tools use different interval methods, required sample sizes can differ by a few units between calculators; the method selector lets you reproduce each convention.
Why plan sample size up front?
A clear sample size plan protects your study from being underpowered or too costly. The calculator keeps alpha, power, effect sizes, allocation ratios, and exposure in sync, so you can defend your design with transparent assumptions. If you are new to the topic, the sample size tutorial walks through a simple example step by step.
Frequently asked questions
What is a good statistical power?
Statistical power is the probability that a test detects an effect that truly exists. A power of 80% (0.8) is the most common target; higher-stakes studies often plan for 90%. Below 80%, real effects are likely to be missed.
What margin of error should I choose?
The margin of error is half the width of the confidence interval, i.e. how far your estimate may reasonably deviate from the true value. Surveys commonly use 5 percentage points; use a smaller margin when decisions depend on fine differences, and expect the required sample size to grow quickly as the margin shrinks.
Why does this calculator give a slightly different sample size than others?
Most online calculators use the normal approximation (Wald) formula. By default, this calculator uses the exact Clopper-Pearson interval for proportions, which guarantees the stated confidence level and therefore recommends a slightly larger sample. Select "Normal approximation (Wald)" as the method to match the classic textbook result.