ToolSphere

Sample Size Calculator

Computer science

Calculate the minimum sample size needed to estimate a proportion within a chosen margin of error and confidence level.

Sample size calculator

Computes the minimum sample size needed to estimate a proportion within a given margin of error, at a chosen confidence level.

Use 50% if unknown — it's the most conservative (largest) assumption.

Z-score
1.9600
Required sample size (infinite population)
385

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

About Sample Size Calculator

Sample Size Calculator

Computes the minimum sample size needed to estimate a population proportion within a specified margin of error, at a chosen confidence level, using the standard formula n = z²p(1-p)/e². If a finite population size is provided, applies the finite population correction to reduce the required sample size accordingly.

Choosing a sample size before running a survey or experiment is a common statistics task — too small a sample and your results are too noisy to trust; too large and you waste time and budget collecting unnecessary data. This calculator applies the standard formula used in survey methodology and A/B testing so you don't have to derive it by hand.

Typical use cases: sizing a customer survey before fielding it, planning a poll with a target margin of error, or determining how many users an A/B test needs per variant.

Adjust confidence level, margin of error, and estimated proportion to see how each affects the required sample size in real time.

Guides and tutorials

Frequently asked questions

Why use 50% for the estimated proportion if I don't know it?

50% maximizes p(1-p), which is the term driving sample size in the formula — using it when the true proportion is unknown gives the most conservative (largest, safest) sample size estimate.

Does population size matter for very large populations?

Only marginally — the finite population correction reduces the required sample size, but that reduction becomes negligible once the population is much larger than the calculated sample size, which is why it's often omitted for large or unknown populations.

What confidence level should I choose?

95% is the standard default for most surveys and research. 99% gives a tighter guarantee but requires a larger sample; 90% requires a smaller sample but a looser guarantee — the right choice depends on how costly a wrong conclusion would be.

Have a suggestion for Sample Size Calculator?Share your feedback ↗