Free & unlimited

A/B Test Sample Size Calculator

How many visitors does your A/B test need? Plan the sample size and test duration before you launch.

Visitors per variation
31,234
Total visitors (A + B)
62,468
Estimated duration
—

To detect a move from 5.00% to 5.50% at 95% confidence and 80% power. Add your daily visitors to estimate how long the test needs to run.

What this calculator does

Before you launch an A/B test, you need to know how many visitors each version has to receive. Stop too early and you may act on noise; run it far longer than needed and you waste traffic and time. This calculator gives you the sample size per variation for a test on a conversion rate, based on your current conversion rate, the smallest improvement you care about, and how sure you want to be.

It is the planning step that comes before the test. When the test is done, use the A/B test significance calculator to check whether the result is real.

How to use it

1Enter your baseline conversion rate: the current rate of the page or ad you are testing, as a percentage.
2Enter the minimum detectable effect, the smallest lift worth detecting. Choose relative lift (5% → 5.5% is a 10% relative lift) or absolute points (5% → 5.5% is 0.5 points).
3Pick a confidence level (95% is standard) and a statistical power (80% is standard).
4Optionally enter your daily visitors to get an estimated test duration.
5Read the visitors needed for each variation. The total is for both versions together.

The inputs, explained

  • Baseline conversion rate. What the control converts at today. Use a recent, stable figure from your analytics.
  • Minimum detectable effect (MDE). The smallest change you would act on. A smaller MDE needs many more visitors, so pick the lift that would be worth shipping, not the lift you hope for.
  • Confidence level. The chance of avoiding a false positive. At 95%, there is a 5% risk of declaring a winner when there is no real difference.
  • Statistical power. The chance of catching a real effect of at least your MDE. At 80%, you will miss a real effect of that size about one time in five.

The formula

For two groups with conversion rates p1 (control) and p2 (variant), the visitors needed in each group are:

n = (Zα/2 · √(2·p̄·(1−p̄)) + Zβ · √(p1·(1−p1) + p2·(1−p2)))² ÷ (p2 − p1)²

Here p̄ is the average of p1 and p2, Zα/2 comes from your confidence level (1.96 for 95%), and Zβ comes from your power (0.8416 for 80%). The result is rounded up. This is the standard two-sided test for comparing two proportions, so it assumes you will look at the result once, when the sample is reached.

Examples at 95% confidence and 80% power

BaselineEffect to detectPer variationTakeaway
2%10% relative (2.0% → 2.2%)80,683Small lift on a low rate: needs a lot of traffic
2%20% relative (2.0% → 2.4%)21,109Doubling the lift cuts traffic by about 4×
5%10% relative (5.0% → 5.5%)31,234A typical landing page test
5%20% relative (5.0% → 6.0%)8,158A bigger effect is much cheaper to detect
10%10% relative (10.0% → 11.0%)14,751Higher baselines need fewer visitors
10%20% relative (10.0% → 12.0%)3,841Large effect on a high-converting page

Take the 5% baseline with a 10% relative lift. You need about 31,234 visitors in each version, 62,468 in total. With 2,000 visitors a day to the test, that is 32 days. Raising the confidence to 99% lifts the requirement to about 46,474 per variation, and raising power to 90% lifts it to about 41,815, so tightening either setting has a real cost.

Tips for running the test

  • Decide the sample size first and stick to it. Peeking at the results every day and stopping when it looks significant inflates false positives well above your stated 5%.
  • Run for whole weeks. Behaviour differs between weekdays and weekends, so round the duration up to complete 7-day cycles.
  • Test one meaningful change at a time. Bigger, bolder changes produce bigger effects, which need far fewer visitors to detect.
  • If the number is too big, change the plan, not the maths. Test a higher-traffic page, aim for a larger effect, or measure a metric earlier in the funnel that converts more often.

FAQ

How many visitors do I need for an A/B test?
It depends on your baseline conversion rate and the effect you want to detect. A 5% baseline testing for a 10% relative lift needs about 31,000 visitors per variation at 95% confidence and 80% power. Lower baselines and smaller effects need more.
What is a good minimum detectable effect?
Use the smallest change that would justify shipping the variant. Many teams plan for a 5–20% relative lift. Choosing a very small MDE makes the required sample size grow very quickly.
Is 95% confidence and 80% power always right?
They are the common defaults, not rules. Use higher confidence when a wrong decision is expensive, and higher power when missing a real win would cost you. Both raise the sample size you need.
Is the sample size per variation or in total?
Per variation. A standard A/B test has two variations, so the total is double the figure shown. The calculator shows both.
What if I have an A/B/C test with more than two versions?
This calculator plans a two-version test. For more variations, you generally need the per-variation sample size for each, plus a stricter significance threshold to account for multiple comparisons.
Can I use it for metrics other than conversion rate?
It is built for yes/no outcomes such as purchase, signup or click, which is a proportion. Metrics like revenue per visitor need a different calculation based on the metric's variance.

Sources

Last reviewed: October 2026