About the Sample Size Calculator
How many survey responses or A/B test users you need for a given confidence level, margin of error and population.
Also known as: survey sample size, ab test sample size, statistical sample size, margin of error sample size.
How to use this calculator
- Enter confidence level, margin of error, expected proportion, population size (optional).
- The result updates instantly as you type — press Calculate (or Enter) at any time.
- Review the breakdown shown under the main result.
- Use Copy result or Share to save the answer or send a link with your inputs.
Formula
n₀ = z²·p(1 − p)/e² · n = n₀ / (1 + (n₀ − 1)/N)
Worked example
Using the values pre-filled in the calculator above:
- Confidence level: 95%
- Margin of error = 5 %
- Expected proportion = 50 %
- Population size (optional) = 20,000
the calculator returns:
- Sample size: 377
- Without population correction: 385
- z-score: 1.96