Sample Size Calculator
This sample size calculator tells you how many observations you need to estimate a population proportion or a population mean with a chosen margin of error and confidence level. If the population is not large, you can enter the population size N to apply a finite population correction, which reduces the required sample.
Sample size calculator
Find the sample size needed to estimate a proportion or a mean with a chosen margin of error. You can apply a finite population correction when the population is not large.
Working
Calculator loading… If the form does not return a result, wait a moment and try again.
Sample size formulas
Proportion: n₀ = zα/2² p (1 − p) / E². If you do not have a planning value for p, use 0.5, which maximizes n₀.
Mean: n₀ = (zα/2 σ / E)². If σ is estimated from a sample, the calculator can replace z with tα/2, n−1 and iterate until n is consistent with the degrees of freedom.
Finite population correction: n = n₀ N / (n₀ + N − 1), then round up to the next whole person or unit.
These formulas are for a confidence interval with margin of error E. They are not power calculations for a hypothesis test, which also require an effect size and a target power.
Worked example
You want a 95% confidence interval for a proportion with a margin of error of 0.05, and you have no planning value for p, so you use p = 0.5.
z0.025 ≈ 1.960. Then n₀ = 1.960² × 0.5 × 0.5 / 0.05² ≈ 384.15, which rounds up to 385. If the population had only 1,000 members, the finite population correction would reduce this to 278.
Related calculators and guides
Frequently asked questions
The product p(1 − p) is largest when p = 0.5. That is the most conservative planning choice when you do not already have a good estimate of the proportion.
When you sample a noticeable fraction of a finite population, observations are not independent in the usual infinite-population sense, and you need fewer observations to reach the same margin of error. The calculator applies the standard correction n = n₀ N / (n₀ + N − 1).
The textbook formula uses z and a known planning value of σ. If σ itself will be estimated from the sample, checking the t-iteration box is more accurate, because the critical value is then a t quantile whose degrees of freedom depend on n.
No. This calculator sizes a confidence interval for a given margin of error. A power analysis for a test also needs an effect size and a target power, and it usually produces a different n.
Yes. A fractional sample size is not usable, and rounding down would miss the stated margin of error. The calculator always rounds up to the next whole number.