Business & E-commerce
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.
Why surveys default to a 50% assumption
The margin-of-error formula is most conservative — meaning it demands the largest sample — when the true proportion is near 50%, so using p = 0.5 guarantees the sample size is large enough no matter what the real answer turns out to be. If you already know the answer clusters near 10% or 90%, the true required sample is smaller than this calculator's survey mode assumes.
Worked example: Sample Size Calculator
For a survey targeting ±5% margin of error at 95% confidence with a very large population, the calculator returns 385 required responses — a widely cited number because it's the ceiling for any population size once it's reasonably large. Tightening the margin to ±3% (closer to what national polls use) pushes that up to 1,068 responses; the sample size grows with the square of how tight the margin is, so halving the margin roughly quadruples the required sample. Capping the population at 1,000 instead of treating it as unlimited drops the requirement to 278, since a finite-population correction kicks in.
A/B test sample size grows fast for small baseline rates
Detecting a 20% relative lift on a 10% baseline conversion rate requires about 3,841 visitors per variant (roughly 7,700 total) at 95% confidence and 80% power. Because the formula is driven by the absolute gap between the two rates, the same 20% relative lift on a 3% baseline (a smaller absolute gap) requires a substantially larger sample — low-baseline tests need much more traffic to reach the same statistical confidence as high-baseline ones.
How much tighter confidence and power actually cost in required traffic
Holding the same 10% baseline and 20% lift, raising confidence from 95% to 99% increases the required sample from about 3,841 to roughly 5,716 per variant — a 49% increase in traffic for the stricter confidence level. Raising statistical power from 80% to 90% instead (keeping 95% confidence) pushes the requirement to about 5,142 per variant, a 34% increase. Both settings are worth choosing deliberately rather than defaulting to the highest values available, since each one trades directly against how long the test needs to run to collect enough traffic.
Related tools
- A/B Test Significance Calculator
Check whether an A/B test result is statistically significant — conversion rates, relative uplift, p-value and confidence using a two-proportion z-test.
- Pricing Page A/B Test Idea Generator
Get proven pricing-page experiments for your business and goal — plan layout, anchoring, annual billing, trials, social proof and more — each with the reason it works and the metric to track.
- EU OSS VAT Calculator (E-commerce Distance Sales)
Check if your EU cross-border B2C sales exceed the €10,000 threshold and calculate the VAT due in each customer's country for your One-Stop-Shop (OSS) return, using current standard rates.
- Amazon FBA Profit Calculator
Work out profit, margin and ROI for a product sold through Fulfillment by Amazon — referral fee, FBA fulfillment fee, monthly storage, inbound shipping, product cost and ads — per unit and per month.
- Air Conditioner Size (BTU) & Heating Calculator
Find the right air conditioner size in BTU for a room using the ENERGY STAR chart, with adjustments for sun, occupants and kitchens — plus a heating BTU estimate by climate.
- Solar Panel Size & Payback Calculator
Estimate how many solar panels and what system size (kW) you need to cover your electricity use, the yearly savings and the payback period.