Sample Size Calculator

Work out how many respondents you need for a survey or study.

How this is calculated

This uses Cochran's formula for sample size determination, assuming the most conservative 50/50 split when the true proportion is unknown. If you provide a population size, a finite population correction is applied, which reduces the required sample when the population itself is relatively small.

This same formula underlies A/B testing for conversion rate experiments — deciding how many visitors each variant needs before you can trust the result. The catch is that conversion rate differences are often small in absolute terms: going from a 2% to a 2.2% conversion rate is a genuinely meaningful 10% relative improvement for a business, but detecting that small an absolute difference reliably can require tens of thousands of visitors per variant — far more than intuition suggests. This is why many A/B tests run for weeks and still end inconclusive: the traffic simply wasn't sufficient to detect the effect size actually present. For calculating how confident you can be in a specific observed result given prior expectations, see the Bayes' Theorem calculator.

Frequently asked questions

How is this calculated?
This uses Cochran's formula: n = z²·p·(1-p) / e², assuming the most conservative case (p = 0.5, maximum variance) since the true proportion you're measuring is usually unknown in advance. If you provide a population size, a finite population correction reduces the required sample accordingly.
What if I leave population size blank?
It's treated as effectively infinite — appropriate when your population is very large (e.g. all adults in a country) or unknown. The required sample size barely changes once a population is much larger than a few thousand.
Why does a smaller margin of error need a much bigger sample?
Margin of error appears squared in the denominator of the formula, so halving your margin of error roughly quadruples the required sample size — tighter precision gets expensive fast.
Can I use this in my own app?
Yes — every calculator on Stupidly Clever has a matching REST API and MCP tool that runs the same underlying logic.
What is statistical power?
Statistical power is the probability that a test correctly detects a real effect when one actually exists — commonly targeted at 80% or higher. Low power means a study is likely to miss a genuine effect even when it's there (a false negative), which is why underpowered studies (too small a sample) are a common source of unreliable results.
What is the difference between Type I and Type II errors?
A Type I error is a false positive — concluding there's an effect when there actually isn't one. A Type II error is a false negative — missing a real effect that does exist. Confidence level controls the Type I error rate; statistical power controls the Type II error rate. The two involve a trade-off: all else equal, reducing one type of error tends to require a larger sample.
How does effect size affect the required sample size?
Smaller effect sizes require larger samples to detect reliably, since a subtle difference is easier to lose in random noise than a large, obvious one. This is why detecting a 1% difference in conversion rate requires a far larger sample than detecting a 20% difference.
What confidence level should I use?
95% is the standard default across most research and business contexts, balancing reliability against practical sample size requirements. Use 99% when the cost of being wrong is high (e.g. medical or safety-critical decisions); 90% can be acceptable for lower-stakes, exploratory research where a larger sample isn't feasible.

Related calculators