Enter your baseline conversion rate and the smallest lift worth shipping, and get the number of users each arm needs before you launch. When the test finishes, the second tab turns four raw counts into a lift, a p-value and a confidence interval on the difference. A metric that is a measurement rather than a rate wants [the two-sample t-test](/calculators/two-sample-t-test).
What the control converts at today. Take it from your own data over a window long enough to cover a full weekly cycle rather than from a good day: the sample size moves with this number, and an optimistic baseline quietly understates the traffic the test needs.
A proportion, so 0.04 is 4%.
The smallest lift the test needs to be able to see. It is a floor on the design's sensitivity, not a forecast — set it to the smallest improvement that would change what you do, because a true lift below it will usually come back as “no significant difference”.
On the baseline's scale: 0.005 is half a point.
Absolute reads the effect on the baseline's own scale, so 0.005 against a 4% baseline means 4.5%. Relative reads it as a multiple, so 0.005 means 4.02%. Teams usually mean relative and type absolute, which asks for a test hundreds of times larger than intended.
n₂ ÷ n₁ — how the sample is divided between the two groups. An even split (1) buys the most power per observation. A larger ratio puts more in the second group, which is worth doing when one arm is cheaper or riskier to fill, and needs a bigger total for the same power.
n₂ ÷ n₁. 1 is an even split.
The false-positive rate you agree to run. At α = 0.05 a comparison of two identical things still comes out significant one time in twenty, so lower it when acting on a wrong result is expensive, and split it across comparisons if you are going to run several. The 0.05 is a convention, not a property of your data.
The chance the test finds the effect if the effect is really there. At 0.80 you miss a real one in one study out of five; 0.90 is the usual choice when a miss is the expensive outcome, and costs roughly a third more data. Power is a property of the design — it cannot be recovered after the data is in.
Two-sided asks whether the two differ at all. One-sided asks only whether one beats the other: more sensitive for the same sample, but blind to the opposite result even when it is large. Choose it before the data, for a reason you could have written down in advance — switching afterwards halves the p-value you were about to report.
Which standard error the power calculation assumes under the null. Pooled estimates one rate from both arms, which is what the z-test itself does and what R's power.prop.test uses. Unpooled is the Fleiss convention and asks for a couple of percent less traffic — a real disagreement between tools, and small.
Pooled matches the test you will run.
The observed difference is discrete — it moves one visitor at a time — and the correction makes the test clear an extra half-step, which is conservative and costs a few percent more sample. Turn it on only if the analysis will apply it too; a design and an analysis that disagree is the mismatch that matters.
On adds a few percent to the sample.
Required sample size per arm
Per variant
25,551
Second arm
25,551
Total
51,102
Achieved powerAt the whole-number sample above.
80.0%
Baseline rate
4.00%
Rate it can detect
4.50%
Relative lift it can detectAs a share of the baseline rate.
12.5%
Give each variant 25,551 visitors — 51,102 across the experiment, not 25,551 in total — and the test will detect a move from 4.00% to 4.50% 80.0% of the time, if a lift that large is really there. That is a floor on what the design can see, not a forecast of what you will get: the minimum detectable effect should be the smallest lift that would change what you do, not the lift you are hoping for. Against a true lift half this size the same sample has about 29.5% power, so the likeliest outcome there is a non-significant result that reads as "no impact" when it was really "no ability to tell".
Without the continuity correction this is the smaller of the two standard answers. Applying the correction adds a few percent to the sample and matches an analysis that also applies it.
Drag the dashed line — or focus it and use the arrow keys — to change the target power and resize the study.
Show these numbers as a table
Power at each sample size per variant
Power
Sample size
2.6%
1
20.7%
4,261
36.6%
8,521
50.9%
12,781
62.9%
17,041
72.5%
21,301
80.0%
25,561
85.7%
29,821
89.9%
34,081
92.9%
38,341
95.1%
42,601
96.7%
46,861
Drag the dashed line — or focus it and use the arrow keys — to change minimum detectable effect.
Show these numbers as a table
Required visitors per variant against minimum detectable effect
Minimum detectable effect
Required visitors per variant
0.20%
154,304
0.59%
18,552
0.98%
7,016
1.37%
3,738
1.76%
2,354
2.15%
1,637
2.54%
1,215
2.93%
945
3.32%
761
3.71%
629
How many control visitors converted — a count of people, never a percentage. If all you have is the rate, multiply it back out and round to whole visitors.
Everyone who entered the control arm, converted or not, counted the same way the experiment assigned them. Counting sessions where the split was by visitor inflates n and narrows every interval on this page.
The same count for the variant, over the same window. A variant that was live for longer than the control is a confound the arithmetic here cannot see.
Everyone who entered the variant arm. It does not have to match the control — an uneven split is fine and the test accounts for it — but a large unplanned imbalance is usually a bug in the assignment rather than chance.
The false-positive rate you agree to run. At α = 0.05 a comparison of two identical things still comes out significant one time in twenty, so lower it when acting on a wrong result is expensive, and split it across comparisons if you are going to run several. The 0.05 is a convention, not a property of your data.
Two-sided asks whether the two differ at all. One-sided asks only whether one beats the other: more sensitive for the same sample, but blind to the opposite result even when it is large. Choose it before the data, for a reason you could have written down in advance — switching afterwards halves the p-value you were about to report.
Pooled estimates a single rate from both arms, which is what this test's null hypothesis says and therefore what the test is. Unpooled is offered for comparison with tools that report it — it is a different test, and on the same counts it gives a slightly different p.
Pooled unless you have a reason.
Shrinks the observed difference by half a discrete step before dividing by the standard error, which makes the p-value larger. It is Yates' correction for a 2 × 2 table. Say whether you applied it: on a borderline result it can move p across your threshold.
Two-proportion test result
p-value
0.0019
z
3.106
Control rate
4.00%
Variant rate
4.55%
Relative liftAs a share of the control rate. Undefined when the control converted nobody.
13.9%
95% interval on the relative liftKatz's log interval, always two-sided. Undefined when either arm converted nobody.
[4.9%, 23.7%]
Standard error
0.001790
The observed lift of 13.9% is larger than sampling noise comfortably explains (p 0.0019). The data is consistent with the variant being anywhere from 4.9% to 23.7% different in relative terms — 0.00205 to 0.00907 on the absolute rate. Ship on the low end of that range, not the point estimate: a winner is likelier to have been helped by noise than hurt by it, which is why measured lifts usually shrink after rollout.
Show these numbers as a table
The relative lift and its interval
Relative lift
Estimate
Interval
Relative lift
14%
5% to 24%
When to use it
Use this when the outcome is binary — converted or not, signed up or not, still active on day 7 — and two independent groups were formed by random assignment. That is most of what gets called an A/B test. The sample-size tab answers the question worth asking before launch, which is not "how long shall we run it?" but "how small a lift must we be able to see, and what does that cost?"
Neighbouring situations need a different instrument. One group measured against a fixed target — an SLA, a contractual floor — is a one-proportion z-test. Counts small enough that a cell holds single digits belong in Fisher's exact test, where the p-value is computed rather than approximated. Three or more variants is a chi-square test for the overall question, then targeted pairwise comparisons with a correction — running every pair unguarded is how a four-arm test manufactures a winner, as the problem of multiple comparisons sets out. Same people measured twice is paired data, and wants McNemar's test.
The other mismatch is the question itself. This test detects a difference; it cannot demonstrate the absence of one. To show a cheaper vendor or a simplified flow performs no worse, use an equivalence test or, when one direction worries you, a non-inferiority test. And if what matters is how long users take to convert rather than whether they do, the binary summary discards timing that the log-rank test keeps.
Assumptions
Five things have to hold. The first two are load-bearing; the rest are usually satisfied by any competently run experiment.
Random assignment, with one observation per randomised unit. If assignment leaked, no amount of statistics repairs it. Check the split against the ratio you intended before you look at the metric: sample ratio mismatch is the cheapest bug detector you have, and the basics of randomisation repay a re-read before launch.
The unit of analysis matches the unit of randomisation. Bucket by user but count sessions and the same user contributes several correlated rows, so the standard error is understated and the p-value too small. Aggregate first, or model the clustering.
The sample size was fixed in advance. Checking daily and stopping at the first p below 0.05 pushes the real false-positive rate far above 5%. To keep the option of stopping early, adopt a sequential design that budgets for the looks.
The normal approximation is adequate — comfortably so once each of the four cells expects ten or more. Below that its p-values are untrustworthy at the third decimal; switch to the exact test. This is the assumption most calculators fail silently on, since they will happily return a p-value for a 3-versus-1 table.
One primary metric, nominated in advance. Five metrics at 5% each gives roughly a one-in-four chance of a false positive somewhere — see multiple comparison corrections.
How the calculation works
Sample size uses the normal approximation to the binomial: there is no exact closed form for two proportions, and the approximation is good to within about a percent at the sizes a conversion test needs. You choose whether its variance is pooled under the null — matching the test you will run, and the default here — or computed under the alternative, which is slightly more conservative and is what several textbooks print. You also choose whether to apply a continuity correction, which acknowledges that the binomial is discrete and the normal is not. On the analysis side the p-value is a pooled z-test; the interval is not. If the answer exceeds the traffic you have, [four ways to improve statistical power](/post/four-ways-to-improve-statistical-power-in-a-b-testing-without-increasing-test-duration-duh) beats quietly lowering the target.
A 1:1 split minimises the total. Moving to 2:1 costs about an eighth more traffic and 4:1 half as much again — worth paying to limit exposure to a risky change, never worth paying by accident.
Continuity correction
n′ = (n/4)·[ 1 + √(1 + 4/(n·|p₂ − p₁|)) ]²
Inflates n to hold the true type-I error at or below the nominal level. The effect shrinks as n grows: on a test of tens of thousands it adds a percent or two, on one of a few hundred, a fifth.
Pooling is right here: the statistic is evaluated under the null that both arms share one rate. Squaring this z gives exactly the Pearson chi-square statistic for the same 2×2 table, so the two never disagree.
Built from each arm's Wilson limits (lᵢ, uᵢ) rather than one Wald standard error. It stays inside [−1, 1], holds close to nominal coverage at low conversion rates, and does not collapse to zero width when an arm records no events — all three of which Wald gets wrong where conversion tests live.
Sizing is driven by the absolute difference. A 10% relative lift on a 40% baseline is four percentage points and cheap to detect; the same relative lift on a 2% baseline is two-tenths of a point and costs roughly thirty times as many users.
Worked example
Your checkout converts at 4.0%. Product will not ship for less than half a percentage point, so 4.5% is the smallest result worth detecting. You want 80% power at the conventional 5% two-sided level, an even split, and roughly 6,000 eligible visitors reach the page each day.
Baseline conversion rate
4.0%
Minimum detectable effect
+0.5 percentage points (4.5%)
Significance level (α)
0.05, two-sided
Power (1 − β)
0.80
Allocation
1:1
Variance
Pooled, no continuity correction
25,551 visitors per arm, 51,102 in total — about nine days at 6,000 visitors a day. Turning on the continuity correction raises it to 25,950 per arm.
Nine days buys a four-in-five chance of detecting a lift of half a point, if that lift is really there. It buys much less against a smaller true effect: at a real lift of a quarter of a point this design has about 30% power, so the likeliest outcome is a non-significant result written up as "no impact" when it was really "no ability to tell". Sizing for that quarter-point needs just under 100,000 per arm — four times the traffic for half the sensitivity, which is the trade every experiment roadmap is really negotiating.
Interpreting the output
Start with the confidence interval on the difference, not the p-value. Both settle the yes/no question — the interval excludes zero exactly when p is below α — but only the interval says which lifts the data is consistent with. An observed +0.6 points with an interval of [+0.05, +1.15] is significant and almost uninformative; +0.1 points with an interval of [−0.15, +0.35] is not significant and genuinely useful, because it rules out anything you would have acted on. That is the core recommendation in reporting A/B test results properly.
The p-value is the probability of a difference at least this large if both variants truly converted at the same rate. It is not the probability that the variant is better, not the probability the result replicates, and 0.049 and 0.051 are the same evidence.
Be careful with relative lift, which is what stakeholders remember. Its interval is asymmetric and wider than the point estimate suggests, and the estimate is biased upward among tests that reached significance — a winner is likelier to have been helped by noise than hurt by it. That is much of why the uplift in an A/B test often differs from what shows up after rollout.
For a bound on one arm's rate rather than the gap between two, the proportion confidence interval calculator does that properly. And if the interval is too wide to support a decision, the honest conclusion is that the test was underpowered, not that the change does nothing — we design experiments where that is settled before launch.
Frequently asked questions
How long should I run an A/B test?
Long enough to reach the sample size you calculated, and never fewer than one full business cycle — usually seven or fourteen days. Traffic composition swings hard by day of week, and a test that starts on a Tuesday and stops on a Friday has measured Tuesday-to-Friday users, not your users. If the required sample arrives in three days, keep running to a whole number of weeks anyway. If it will take four months, the test is not worth running as designed: raise the detectable effect, pick a metric closer to the change, or reduce variance rather than quietly lowering the power target.
What minimum detectable effect should I put in?
The smallest lift that would change what you do, not the lift you are hoping for. If a quarter of a point would not survive the engineering cost of shipping the change, do not pay for the traffic to detect it. Work backwards: estimate what a one-point lift is worth annually, compare that against the cost of the build and the opportunity cost of the traffic, and let the break-even number be your MDE. Choosing it from the answer you want is how tests end up sized for effects nobody would act on.
Can I stop the test early if it is already significant?
Not with a fixed-horizon design. Checking daily and stopping at the first p below 0.05 pushes the real false-positive rate to somewhere between 20% and 40%, depending on how often you look. Early crossings are common and mostly noise: the estimate is at its most volatile when the sample is smallest, and it is precisely the runs that overshoot that cross first. If you need the option to stop early, use a sequential or group-sequential design that spends the error budget across the looks, and fix that before launch rather than after the first promising day.
Should I use a one-sided test to save traffic?
It cuts the required sample by around 20%, but only honestly if you would take exactly the same action for a large negative result as for no result at all. In product work that is rarely true — a variant that hurts conversion by two points is information you very much want. The bigger risk is procedural: switching to one-sided after a two-tailed test lands at p = 0.07 is not a statistical choice, it is a way of getting the answer you wanted. Decide before launch, write it down, and default to two-sided.
Does a 90/10 split cost me anything?
Yes, and much more than the intuition suggests. A 1:1 split extracts the most information per user. A 9:1 split needs close to three times the total traffic for the same power, because the power is governed by the smaller arm. Skewed splits are legitimate when you are limiting blast radius on a risky release or reusing a large existing control, but they should be a deliberate purchase, not a leftover from a cautious ramp that nobody rebalanced.
Pooled or unpooled variance — does the choice matter?
For the sample size, almost never: the two formulas typically differ by well under one percent, and that difference is smaller than the error in your baseline rate estimate. For the test statistic it matters more in principle, and pooled is correct, because the statistic is computed under the null hypothesis that both arms share a single rate. The pooled z is also exactly equivalent to the Pearson chi-square test on the same table, which is why those two never disagree. Use pooled unless you have a specific reason not to.
We size, run and read experiments where the metric, the sample size and the decision rule are agreed before anyone looks at the data. A/B Testing
References
Fleiss, J. L., Levin, B., & Paik, M. C. (2003). Statistical Methods for Rates and Proportions (3rd ed.). Wiley.
Newcombe, R. G. (1998). Interval estimation for the difference between independent proportions: comparison of eleven methods. Statistics in Medicine, 17(8), 873-890.
Kohavi, R., Tang, D., & Xu, Y. (2020). Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing. Cambridge University Press.