Sample Size Calculator (Surveys & A/B Tests)
Find the sample size you need for a survey (margin of error) or an A/B test (minimum detectable effect) at your chosen confidence and power.
How to use
- 1Choose survey or A/B test.
- 2Survey: enter population, confidence and margin of error. A/B test: enter baseline conversion, minimum lift to detect, confidence and power.
How it's calculated
Survey: n₀ = z² × p(1 − p) ÷ e², with p = 0.5 (most conservative), then the finite population correction n = n₀ ÷ (1 + (n₀ − 1) ÷ N). A/B test (per group): n = (z₁₋α/₂ √(2p̄(1 − p̄)) + z₁₋β √(p₁(1 − p₁) + p₂(1 − p₂)))² ÷ (p₂ − p₁)².
Frequently asked questions
Why use 50% as the expected proportion?
It gives the largest (safest) sample size. If you know the answer is near 10% or 90%, you'd need fewer responses.
What margin of error is typical?
±5% at 95% confidence is common for surveys — about 385 responses for a large population. National polls often use ±3% (about 1,068).
What is statistical power?
The chance of detecting a real effect of the size you specify. 80% is the usual standard for A/B tests.