Sample Size Calculator for Surveys & Experiments
Calculate the sample size you need for a statistically valid survey or experiment, based on confidence level, margin of error, and population size.
How this calculator sizes a survey using the Cochran formula and finite population correction
Before you run a survey, you need to know how many responses actually make the results trustworthy. Ask too few people and your margin of error balloons; ask far more than necessary and you have wasted time and budget. This tool answers that question using the Cochran formula, a standard piece of sampling theory published by statistician William G. Cochran, combined with an optional correction for when your total population is small enough that it matters.
The calculation is pure arithmetic and runs entirely in your browser as you adjust the confidence level, margin of error, expected proportion, and optional population size.
The Cochran formula, piece by piece
The final sample size is always rounded up with Math.ceil, never to the nearest whole number and never down. A required sample size of 384.2 people means you need 385, not 384, since a partial respondent does not exist and rounding down would leave your confidence and margin of error slightly worse than what you asked for.
| Confidence level | Z-score | Common use |
|---|---|---|
| 90% | 1.645 | Lower-stakes internal surveys |
| 95% | 1.96 | Standard for most published research |
| 99% | 2.576 | High-stakes or regulatory studies |
| 99.9% | 3.291 | Rare, very high precision needs |
Why 50% is the safe default
p(1−p) peaks at p=0.5 and shrinks as p moves toward 0 or 1. Using 50% when you are unsure guarantees your sample size is never too small, only possibly larger than strictly necessary.
Margin of error is not accuracy
A 5% margin of error means your survey result could differ from the true population value by up to 5 percentage points, at the stated confidence level, not that the survey is “95% accurate” in some looser sense.
- Sample size determination covers Cochran’s formula and the surrounding statistical theory in depth.
- Standard score (Z-score) explains where the confidence level constants like 1.96 come from.
- Margin of error defines the precision term used as e in the formula above.
Studies this sizes
Planning how many responses a customer satisfaction survey needs before launch, sizing a market research study for a defined target population, working out an A/B test’s minimum respondent count for a simple proportion based question, and justifying a sample size in an academic methods section where reviewers expect the underlying formula shown. Any project that needs a defensible, non arbitrary answer to how many people do I need to survey starts with this calculation.
FAQ: Sample Size Calculator
95% is the most widely used standard in survey research and academic publishing, striking a reasonable balance between certainty and practical sample size. Use 99% for higher-stakes decisions where being wrong is costly, or 90% when a rougher estimate is acceptable and you want a smaller, cheaper sample.
Margin of error describes the range around your sample result that likely contains the true population value, a result of ‘60% ± 5%’ at 95% confidence means you’re 95% confident the true population value falls between 55% and 65%. Smaller margins of error require larger sample sizes, since you’re demanding more precision.
The term p(1−p) in the sample size formula is maximized when p = 0.5 (50%), which produces the largest, most conservative required sample size. Using 50% when you don’t have a solid prior estimate protects you from under-sampling, since any other true proportion would actually require a smaller sample than what you calculated.
Finite population correction adjusts the required sample size downward when you’re sampling from a known, limited population rather than an effectively infinite one, since a smaller total group needs proportionally fewer respondents to represent it well. Use it whenever you know your total population size and it’s relatively small, for example, surveying employees at a specific company rather than the general public.
A commonly cited reference figure is about 385 respondents for 95% confidence, a 5% margin of error, and the conservative 50% proportion assumption, applied to an effectively unlimited population. This number appears frequently in research methodology guides precisely because those are such common default assumptions.
No, and this is a common misconception, once a population is reasonably large (several thousand or more), the required sample size levels off and barely increases further, because the finite population correction’s effect diminishes as population size grows large relative to the sample. A survey of 100,000 people and a survey of 10,000,000 people often need nearly the same sample size for the same confidence level and margin of error.
From the blog
Number theory, lightly
Base systems, primes and the statistics people get wrong.