probability calculators

Sample Size Calculator

Determine the minimum sample size needed for a survey or experiment given your confidence level, margin of error, and population size. Prevents under-powered studies and over-budgeted data collection.

About this calculator

The required sample size for estimating a population proportion is derived from the margin of error formula. For an infinite population: n₀ = z² × p × (1−p) / e², where z is the z-score for the chosen confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%), p is the expected response distribution (use 0.5 for maximum variability), and e is the desired margin of error as a decimal. For a finite population of size N, apply the finite population correction: n = n₀ / (1 + (n₀ − 1) / N). The result is always rounded up to the nearest whole number. Using p = 0.5 gives the most conservative (largest) sample size estimate, ensuring adequate precision regardless of the true proportion.

How to use

You want to survey a city of 20,000 residents with 95% confidence and a 5% margin of error, expecting 50% response distribution. Enter Population = 20,000, Confidence Level = 95%, Margin of Error = 5%, Response Distribution = 50%. The calculator uses z = 1.96: n₀ = 1.96² × 0.5 × 0.5 / 0.05² = 3.8416 × 0.25 / 0.0025 = 384.16. Applying finite correction: n = 384.16 / (1 + 383.16 / 20,000) ≈ 377. You need at least 377 responses.

Frequently asked questions

How does confidence level affect the required sample size in a survey?

A higher confidence level requires a larger z-score, which directly increases the sample size. Moving from 90% to 95% confidence raises z from 1.645 to 1.96, increasing n₀ by about 42% when other inputs are held constant. Moving to 99% confidence (z = 2.576) roughly doubles the sample needed compared to 90%. The tradeoff is between certainty and cost — most surveys use 95% confidence as a practical balance between reliability and feasibility.

What response distribution should I use in a sample size calculator?

Response distribution (p) represents your best estimate of the true proportion in the population for the key survey question. If you have prior research or a pilot study, use that estimate — for example, p = 0.3 if you expect 30% of respondents to say yes. If you have no prior data, use p = 0.5, which maximizes p × (1−p) and therefore produces the largest, most conservative sample size estimate. Using a well-informed p value can significantly reduce your required sample size.

When does population size significantly affect the required sample size?

Population size only matters substantially when your calculated infinite-population sample size (n₀) represents a large fraction of the total population — typically more than 5%. For a population of 500, even small surveys noticeably reduce the required n after the finite correction. However, for populations over 100,000, the finite correction has minimal effect, and the infinite-population formula gives nearly identical results. This is why national polls of millions can achieve ±3% margins with only ~1,000 respondents.