1. Why you calculate sample size before the test
Imagine you have a landing page that converts at 3%, and you have a new headline you are sure will do better. You split your traffic, wait a few days, and the new version is ahead by 15%. Do you ship it? That depends on a question most teams never ask before launching: how many visitors did we need in order to trust a result like this?
If you do not answer that question up front, you will answer it by feel, and feel is unreliable. A dashboard that flashes a green "winner" badge after two days is not telling you the test is finished. It is telling you that, at this moment, the numbers are far enough apart to look interesting. Random variation can produce that gap on its own, especially while the sample is small. A sample size calculation replaces gut feel with a number: the amount of traffic each variant needs so that a real improvement of a given size would be detected reliably, and a non-improvement would rarely be mistaken for one.
This is the planning half of A/B testing, and it is the half most marketers skip. The other half, judging the result once the test is over, is covered in our guide to A/B testing statistical significance. Think of them as a pair. Sample size comes first and tells you how long to run the test. Significance comes last and tells you what the finished test means. If you only do the second one, you are grading an exam that was never designed properly.
The good news is that the planning step takes about thirty seconds with the free A/B Test Sample Size & Duration Calculator. The rest of this guide explains what the calculator is doing, so you can choose its inputs sensibly instead of just typing in defaults.
2. The four inputs behind every sample size
Every sample size calculator for a conversion test, no matter which brand it comes from, is solving the same equation. As Statsig's walkthrough of sample size calculation lays out, the main ingredients are a significance level, statistical power, the minimum detectable effect, and a measure of how variable the metric is. For a conversion rate, variability is set by the baseline rate itself, so in practice you supply four things.
Baseline conversion rate. This is the rate your current page, email or ad achieves today. Use a recent, representative period, and match the exact audience and goal of the test. If you are testing the checkout button, the baseline is the share of cart visitors who complete the purchase, not the share of all site visitors who buy. A wrongly chosen baseline quietly shifts every number that follows.
Minimum detectable effect (MDE). The smallest improvement you would still care about. We will spend a whole section on this one, because it drives the answer more than anything else.
Significance level, or alpha. The false-positive rate you are willing to tolerate: the chance of declaring a winner when the two versions are actually identical. Most teams use 5%, which is the same as running at 95% confidence. Statsig notes that 0.05 is the conventional choice.
Statistical power. The chance that your test catches a real effect of the MDE size when it genuinely exists. The common default is 80%, which the Statsig article also uses as its standard example. It means that if your page really is better by the MDE, you will detect it four times out of five, and miss it one time in five.
Notice what is not on this list: the number of days. Duration is a consequence, not an input. Once you know how many visitors you need in total, and how many visitors per day you can send into the test, the schedule follows from simple division.
3. Minimum detectable effect: the input that matters most
The MDE is where statistics meets business judgment. It is the smallest change in conversion rate that would be worth acting on. If a new headline lifts conversions by 1% relative, will you rewrite the page, brief the designer, and retest on mobile? Probably not, because the gain is too small to matter. If it lifts conversions by 15%, you definitely would. Somewhere between those two sits your MDE.
There are two ways to express it. A relative MDE is a percentage of the baseline: a 10% relative lift on a 3% baseline moves you from 3.00% to 3.30%. An absolute MDE is measured in percentage points: 0.3 points on a 3% baseline gives the same 3.30% target. They describe the same move, but people confuse them constantly. When a colleague says "we want to detect a 10% lift," always check whether they mean 10% of the current rate or 10 percentage points. On a 3% baseline those differ by a factor of more than thirty.
The reason the MDE dominates the calculation is that required traffic scales with the inverse square of the effect size. Halve the MDE and you need roughly four times as many visitors. Evan Miller's well-known article How Not To Run an A/B Test gives a rule of thumb that captures this directly: for a 5% significance level and 80% power, the sample size per variation is about 16 times the variance divided by the square of the difference you want to detect. The difference is squared in the denominator, so small effects blow up the requirement very quickly.
A practical way to choose your MDE is to work backwards from money. Take the number of conversions you get per month, multiply by your value per conversion, and ask what percentage lift would pay for the effort of building and maintaining the change. That percentage is your MDE. If it turns out to be 3% and your traffic cannot support detecting 3%, the honest conclusion is that this particular test is not worth running, and you should test something bolder.
Plan your test in seconds
Enter your baseline rate, the lift you want to detect and your daily traffic. Get visitors per variant, total traffic and a realistic run time. Free, no signup.
4. Worked examples with real numbers
Numbers make this concrete. All of the figures below use a two-sided test at 95% confidence and 80% power, which are the defaults in our calculator, and are the visitors needed per variant.
Start with a page that converts at 3%. To detect a 50% relative lift (3.00% to 4.50%), you need about 2,500 visitors per variant. Detect a 30% lift and the requirement rises to roughly 6,500. At a 20% lift it is about 13,900, at 15% about 24,200, and at 10% about 53,200. Push down to a 5% relative lift and you need more than 200,000 visitors in each group. The effect gets halved, the traffic goes up about four times, and the progression above shows it again and again.
That 10% case lines up with published figures. CXL's article on stopping A/B tests works through an example with a 3% baseline and a 10% uplift and arrives at roughly 51,000 visitors per variation, and Miller's rule of thumb gives about 51,700 for the same scenario. Our calculator returns about 53,200 because it uses the full two-proportion formula rather than the shortcut. Different tools differ by a few percent depending on whether they use pooled variance, a continuity correction, or a one-sided test, which is why you should treat any sample size as a planning target rather than an exact threshold.
Now see what the baseline does. Hold the lift at 10% relative and change only the starting conversion rate. A 1% baseline needs about 163,000 visitors per variant. A 2% baseline needs about 80,700. A 5% baseline needs about 31,200, a 10% baseline about 14,800, and a 20% baseline about 6,500. Lower-converting pages need far more traffic to detect the same proportional improvement, because each visitor carries less information: with a rare outcome you need many more visitors to see enough conversions.
The same logic explains why teams that test email subject lines on a 20,000-person list can often detect modest lifts in open rate, where the baseline is relatively high, but struggle to detect lifts in purchase conversion on the same list, where the baseline might be well under 1%. Pick a metric that is both meaningful and frequent enough to measure. If you are testing a subject line, our Email Subject Line Tester can help you shortlist candidates before you spend traffic on them.
One more example, using absolute units. Suppose your checkout converts at 4% and a redesign is only worthwhile if it reaches 5%, a full percentage point. That is a 25% relative lift. With a one-sided test, 95% confidence and 80% power, Wingify's sample size guide reports about 5,300 visitors per group for that exact scenario, and the two-sided version in our calculator returns about 6,700. The gap between the two is the price of being able to detect a drop as well as a rise, which brings us to the statistical settings.
5. Confidence and power: what you trade away
Confidence level and power are not free quality dials. Each increase costs traffic, so it helps to know what you are buying.
Raising confidence from 95% to 99% lowers the false-positive rate from about one in twenty to about one in a hundred. On the 3% baseline with a 10% relative lift, it also raises the requirement from roughly 53,200 to roughly 79,200 per variant, an increase of about half. Dropping to 90% confidence cuts it to about 41,900. The right choice depends on the cost of being wrong. If the change is a button colour you can reverse tomorrow, 90% is defensible. If the change alters pricing or touches a checkout you cannot easily roll back, pay for 99%.
Raising power from 80% to 90% means you miss fewer genuine winners, from one in five to one in ten, and moves the same example from about 53,200 to about 71,200 per variant. Power is the setting that gets forgotten. A test with low power can run to completion and report "no significant difference" even though the new version really is better, simply because the sample was too small to see it. That outcome is a false negative, and it is just as costly as a false positive, because the idea you abandon might have been a good one.
Then there is the choice between a one-sided and a two-sided test. A one-sided test asks only whether the variant is better and needs less traffic. A two-sided test asks whether it is different in either direction, so it can also tell you the variant is hurting. For most marketing work, the two-sided version is the safer default, because shipping a change that quietly lowers conversion is the outcome you most want to catch. Use one-sided only when a decrease and "no change" would lead you to the same decision, and decide before the test starts, not after you see the data.
6. Turning visitors into a test schedule
Once you have the total sample, duration is division. If the 10% lift example needs about 53,200 visitors per variant, a two-variant test needs about 106,400 visitors in total. With 2,000 eligible visitors per day, that is 54 days. If only half of your traffic is eligible for the experiment, the same test takes about 107 days. This is the moment many teams discover that the small tweak they planned is not realistic on their traffic, which is exactly why you do this arithmetic first rather than after weeks of waiting.
Two rules help you round the answer. First, run for whole weeks. Visitors on a Tuesday morning behave differently from visitors on a Saturday night, so a test that covers only some days of the week can be biased even if it reaches its sample size. CXL recommends running tests for at least one, and preferably two, full business cycles so that every day of the week, traffic source and external event is represented, and the author notes he usually runs tests for at least four weeks. Second, be wary of unusual traffic. A big email send or a burst of paid traffic in the middle of a test can change who your visitors are, and the result may not represent your normal audience.
CXL also cautions against using a fixed conversion count as a shortcut. The article states that the popular "100 conversions per variation" rule is not a safe stopping point, and says its author typically disregards results with fewer than roughly 250 to 350 conversions per variation, because early wins in smaller samples tend to shrink as more data arrives. Treat conversion counts as a sanity check on top of the calculated sample size, never a replacement for it.
7. Why stopping early wrecks the math
A sample size is a promise you make to yourself before the test: I will collect this much data, and only then will I decide. The statistics behind the significance test assume you keep that promise. Break it, and the error rates you thought you had no longer apply.
Miller states the problem bluntly: repeated significance testing always increases the rate of false positives. In his simulation, a test where the change does nothing at all produced a false positive rate of 26.1% when the experimenter stopped at the first sign of 5% significance, within a 150-observation window and peeking after every observation. He also shows that if you peek ten times, a reported 1% significance level really corresponds to about 5% in practice. The numbers look reasonable at each individual check, but across many checks the chances of at least one false alarm add up.
CXL reports a similarly striking experiment. In a set of 1,000 A/A tests, where both versions were identical, 531 reached 95% significance at some point during the test. When the sample size was fixed in advance and the result read only at the end, just 51 were significant at 95%, in line with the expected five percent. Half of the identical-page tests looked like winners at some moment. That is why "it hit significance on Thursday" is not evidence of anything.
The fix is discipline, or a different method. Commit to the sample size and end date now, and look at the result only then. If you genuinely need to monitor a test as it runs, use a sequential or Bayesian method that is built for continuous monitoring, which Miller points to as the alternatives. A standard fixed-sample calculator, including ours, assumes a single look at the end.
8. Testing more than two variants
It is tempting to test the control against three or four challengers in one go, since traffic is traffic. The cost is hidden in the statistics. Each extra variant adds another comparison against the control, and every comparison is another chance for a false winner. If you run three comparisons at a 5% false-positive rate each, the chance that at least one shows a spurious win is closer to 14% than 5%.
The conservative correction, called Bonferroni, divides your alpha by the number of comparisons. Our calculator applies it automatically when you pick three or more variants. With the 3% baseline and 10% relative lift, a three-variant test needs roughly 64,400 visitors per variant, or about 193,000 in total, compared with about 106,000 for a plain two-variant test. Four variants need about 284,000 in total. Adding variants multiplies the traffic bill faster than most people expect.
For smaller sites, this usually argues for fewer, bolder variants. One strong challenger tested properly tells you more than four weak ones tested on far too little traffic. When you do have enough traffic for multiple variants, use them to test genuinely different ideas, such as different value propositions, rather than minor wording changes. Our Headline & CTA Generator is a quick way to produce truly distinct options to test.
9. What to do when you do not have the traffic
Many small businesses run the numbers and discover that a proper test would take six months. That is not a failure of the method. It is useful information, and you have several honest options.
The first is to test bigger changes. The traffic requirement falls steeply as the effect grows, so a radically different offer, layout or headline that might lift conversion by 40% is far more testable than a tweak expected to lift it by 4%. Save the small-tweak testing for when your traffic has grown.
The second is to move to a higher-traffic page or an earlier metric. Testing the pricing page conversion may be impractical, while testing click-through to the pricing page from the homepage might be feasible within a few weeks. Just be sure the earlier metric actually correlates with the outcome you care about. A lot of clicks that lead nowhere are not a win.
The third is to stop pretending a test is the only way to learn. For low-traffic pages, qualitative research such as session recordings, customer interviews and surveys can tell you what to change, and you can then make the change with confidence from other evidence and monitor the result over time. The fourth is to pool the test across a longer window, with the weekly-cycle rule in mind, accepting that a slower experiment is still better than a fast, misleading one.
Whatever you do, avoid the temptation to lower the bar until the test "works." Setting the MDE to a larger number than you would actually care about, just so the calculator returns a number you can reach, makes the test succeed only if the effect is huge. That is acceptable as long as you understand the trade-off and do not treat a null result as proof that nothing changed.
10. Frequently asked questions
Can I use the same sample size for every test? No. The sample size depends on the baseline rate and the effect size, so it changes for every page and metric. Recalculate each time.
Do I need equal traffic in each variant? Equal splits are the most efficient and are what standard calculators assume. Statsig's article points out that unequal splits, such as a cautious 90/10 rollout, are possible but require more total traffic for the same power.
Is the sample size per variant or total? Per variant. Multiply by the number of variants, including the control, for the total traffic you need.
What if I reach the sample size and the result is not significant? Then you have learned that any true effect is probably smaller than your MDE. That is a legitimate answer. Do not extend the test just to chase significance, because that reintroduces the peeking problem.
What if I already ran the test and need to check it? Use the A/B Test Significance Calculator to get the p-value and confidence interval, and read the A/B Testing Significance Guide for how to interpret edge cases.
Does this apply to ads and emails too? Yes. Any test that compares two conversion-style rates, such as click-through rate, open rate or purchase rate, uses the same math. If you are testing ad variations, a CPC, CPM & ROAS Calculator will help you decide whether a statistically detectable lift is also an economically meaningful one.
11. A pre-launch checklist
Before you start any A/B test, run through these steps. First, write down the single primary metric and pull its baseline from a recent, normal period. Second, decide your MDE in business terms: the smallest lift that would change your decision. Third, choose confidence and power, with 95% and 80% as sensible defaults, and a two-sided test unless you have a strong reason otherwise. Fourth, calculate the sample size per variant, then the total, and divide by your daily eligible traffic to get a duration, rounded up to whole weeks.
Fifth, if the duration is unrealistic, change the test rather than the math: bigger change, higher-traffic page, fewer variants. Sixth, write down your end date and sample size somewhere other people can see, and agree not to call the test early. Finally, when the test ends, evaluate it once, with a significance test, and record what you learned whether it won or not.
Sample size planning is the least glamorous part of experimentation, and the part that most separates reliable testing programs from expensive guessing. Spend the thirty seconds up front. Open the A/B Test Sample Size & Duration Calculator, plug in your baseline and the lift that would matter, and read the full sample size guide for how each input behaves. Then let the test run to the end, and trust the number you committed to.