Sample Size Calculator (A/B Test and Survey)

This sample size calculator tells you how many visitors or respondents you need before you start. For an A/B test, enter the baseline conversion rate, the smallest lift worth detecting, the significance level and power, and it gives the sample per variant, the total and how many days your traffic needs, with a table comparing effect sizes. For a survey, enter the margin of error and confidence level (and population size if it's small). It also sizes a comparison of two averages. Paste a list of planned tests to size them all. It runs in your browser.

A/B test at a 5% baseline (α 5%, power 80%)

Relative liftVariant ratePer variant
5%5.25%122,124
10%5.5%31,234
20%6.0%8,158
30%6.5%3,780
50%7.5%1,471

When to use it

  1. Plan how long an A/B test must run.
  2. Decide whether a page has enough traffic to test.
  3. Size a customer survey for a ±5% margin.
  4. Compare the cost of detecting smaller effects.
  5. Size a study comparing two group averages.

How to Use

  1. Choose A/B test, survey or two means.
  2. Enter rates, effect, significance and power.
  3. Read the sample per group and duration.
  4. Compare effect sizes or batch tests.

Features

  1. A/B test sample size
  2. Survey margin of error
  3. Two-mean comparison
  4. Test duration from traffic
  5. Effect size comparison
  6. 100% client-side

FAQs

How many visitors do I need for an A/B test?

It depends mostly on the baseline rate and the effect. At a 10% baseline, detecting a lift to 12% at 95% significance and 80% power needs about 3,841 visitors per variant.

What is minimum detectable effect?

The smallest change you want the test to reliably detect. Halving it roughly quadruples the sample size.

How many survey responses do I need?

About 385 for ±5% at 95% confidence in a large population; fewer if the population itself is small.

Can I stop the test early if it's significant?

No. Peeking and stopping early inflates false positives; run to the planned sample size.

Is anything uploaded?

No. Everything runs in your browser.

Technical Details

For an A/B test of two proportions, n per variant = (z₁₋α/₂ √(2p̄(1 − p̄)) + z₁₋β √(p₁(1 − p₁) + p₂(1 − p₂)))² ÷ (p₁ − p₂)², where p₂ is the baseline plus the minimum detectable effect (relative or absolute). For a survey, n = z²p(1 − p) ÷ e², with the finite population correction n ÷ (1 + (n − 1)/N). For two means, n per group = 2(zα + zβ)²σ² ÷ δ². Duration = total sample ÷ daily traffic. A comparison table shows n for several effect sizes.

Business & Legal Tools

Business & Legal Tools

  • Ad Metrics Calculator (CPM, CPC, CTR, CPA, ROAS)
  • Email Signature Generator
  • Kitchen Par Level Calculator
  • Hotel Occupancy, ADR and RevPAR Calculator
  • Tailor Measurement Sheet
  • Cleaning Job Quote Calculator
  • Event Seating Plan Maker
  • Invoice and Receipt Field Extractor