Find how many people you need to survey — or how many measurements to take — to hit your target margin of error at a chosen confidence level.
How to use the sample size calculator
Choose whether you are estimating a proportion — the typical survey question, such as "what percentage of customers would recommend us?" — or a mean, such as average spend or average blood pressure. Pick a confidence level, enter the margin of error you can accept, and (optionally) the size of the population you are studying. The calculator returns the number of completed responses you need, shows the effect of the finite population correction, and builds a quick-reference table for other margins of error and confidence levels.
Sample size formulas
For a proportion, the standard approach is Cochran's formula, followed by a correction when the population is small:
For a mean, the formula uses the expected standard deviation instead:
- z — the critical value for your confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%)
- p — the expected proportion as a decimal; σ — the expected standard deviation
- E — the margin of error (as a decimal for proportions, in the original units for means)
- N — the population size
Worked example
You want to estimate the share of customers who are satisfied, to within ±5 percentage points at 95% confidence, and you have no idea what the answer will be, so you use p = 50%. Then n₀ = 1.96² × 0.5 × 0.5 ÷ 0.05² = 3.8416 × 0.25 ÷ 0.0025 = 384.16, which rounds up to 385 responses. This is the famous "about 385" figure behind many polls.
If your entire customer base is only 2,000 people, the finite population correction gives 384.16 ÷ (1 + 383.16 ÷ 2000) ≈ 322.4, so 323 responses are enough. For a mean, if past data suggests a standard deviation of 15 and you want ±3 units at 95%, n = (1.96 × 15 ÷ 3)² ≈ 96.04, so you need 97 measurements.
Why 50% is the safe default
The term p(1 − p) is largest when p = 0.5, so assuming 50% gives the biggest — most conservative — sample size. If you have good evidence that the true value is near 10% or 90%, you can use that and need fewer responses: at p = 10%, the same ±5% at 95% needs only 139 people. But if your guess is wrong, your margin of error will be wider than planned.
How population size affects the answer
Surprisingly, population size barely matters once it is large. A ±5% survey at 95% confidence needs about 385 responses whether the population is 100,000 or 300 million. Population only makes a real difference when your sample would be more than roughly 5% of it — for example, surveying employees of a 500-person company, where 218 responses are enough. That is why national polls of around 1,000 people can describe whole countries.
Practical tips for planning a study
- Plan for subgroups. If you want to compare regions or age groups, each subgroup needs its own adequate sample. Four regions at ±5% each means roughly 4 × 385 responses.
- Precision is expensive. Halving the margin of error requires four times the sample: ±2.5% at 95% needs 1,537 responses.
- Representative beats large. A big sample from a biased source (only your most loyal customers, say) is less useful than a smaller random one.
- Experiments differ. Comparing two groups in an A/B test requires a power calculation, which typically needs more participants than a simple estimate.
Once your data is in, use the confidence interval calculator to report the actual margin of error, and the standard deviation calculator to summarise numeric responses. Results here are planning estimates; complex survey designs such as clustered or stratified samples may need a statistician's input.
Cite or link to this page
Using this sample size calculator in an article, report or homework? Copy a citation or a ready-made link:
Calcivia. (2026). Sample Size Calculator. Retrieved October 31, 2026, from https://www.calcivia.com/sample-size-calculator/"Sample Size Calculator." Calcivia, 2026, https://www.calcivia.com/sample-size-calculator/. Accessed 31 Oct. 2026.<a href="https://www.calcivia.com/sample-size-calculator/">Sample Size Calculator</a> by Calcivia