Skip to content
CalcSpectrum

Sample Size Calculator

Calculate the minimum sample size needed for a survey or study using Cochran's formula, with an optional finite population correction.

Free to use · Instant results
Loading calculator…

How It's Calculated

Formula

n_0 = \frac{z^2 \times p(1-p)}{e^2} \qquad n = \frac{n_0}{1 + \frac{n_0 - 1}{N}}

Sample size calculation (Cochran's formula) estimates how many respondents you need for a survey to be statistically reliable within your chosen margin of error and confidence level. The uncorrected sample size (n0) is the z critical value squared, times the expected proportion p times (1 - p), divided by the margin of error squared. When you know the total population size (N), a finite population correction is applied to shrink the required sample — smaller populations need proportionally fewer respondents than the uncorrected formula suggests. Leaving population size at 0 skips this correction entirely, appropriate when the population is unknown or very large. The population proportion should reflect your best estimate of the outcome you're measuring; using 0.5 when you have no prior estimate is the standard conservative choice, since it produces the largest (safest) required sample size. The final result is always rounded up to the next whole respondent.

Worked Examples

Unbounded population: 95% confidence, +/- 5% margin, p = 0.5

  1. n0 = 1.96² x 0.5 x 0.5 / 0.05² = 3.8416 x 0.25 / 0.0025 = 384.16
  2. No population size given, so n = n0
  3. Round up: 385 respondents needed

Finite population of 1,000, same confidence and margin

  1. n0 = 384.16 (same as above)
  2. n = 384.16 / (1 + (384.16 - 1) / 1000) = 384.16 / 1.38316 ≈ 277.72
  3. Round up: 278 respondents needed

Frequently Asked Questions

What's the difference between margin of error and confidence level?

Margin of error is how much your sample results might differ from the true population value (e.g. +/- 5%). Confidence level is how sure you want to be that the true value falls within that margin across repeated samples (e.g. 95%). Tightening either one — a smaller margin or a higher confidence level — increases the required sample size.

Why use 0.5 for population proportion when it's unknown?

The term p(1-p) in the formula is maximized when p = 0.5, which produces the largest possible required sample size for a given margin of error and confidence level. Using 0.5 as a default guarantees your sample is large enough regardless of the true proportion.

When does the finite population correction matter?

It matters when your population is relatively small (a few thousand or less) relative to the uncorrected sample size. For very large or unknown populations, the correction has almost no effect, which is why leaving population size at 0 (skipping it) is a safe default.

Why is the result always rounded up?

You can't survey a fractional respondent — if the formula computes 277.72, you need at least 278 complete responses to meet your target margin of error and confidence level, so the result is always rounded up rather than to the nearest whole number.