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.

What are you estimating?
For a proportion, use a value such as 0.05 for ±5 percentage points.
Use 0.5 if you are unsure; it gives the largest sample size.

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

Why does p = 0.5 give the largest sample size?

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.

What is a finite population correction?

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).

Should I use the z or the t version for a mean?

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.

Is this the same as a sample size for 80% power?

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.

Do I always round up?

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.