A sample size calculator: how many visitors each group needs for the test to detect the effect. For conversion and average order value, unequal groups, up to five variants, CUPED, a sensitivity table, the formula and Python and R code.
Your numbers stay in the browser and are never sent anywhere
p₁ = 0.0200, p₂ = 0.0230, k = 1, z = 1.960 and 0.842 → n = 36,693
z₁₋α/s is the critical value for α and the test direction, z₁₋β the one for power, k how many times group B is larger than A. The result is rounded up for each group: falling short by even one visitor drops power below the target.
You need four numbers: the control’s baseline conversion, the effect you want to catch, the significance level α and the power. The calculator uses the formula of R’s power.prop.test and rounds up for each group. Example: 2% conversion, an expected +15% uplift, α = 0.05 and 80% power need 36,693 visitors per group, 73,386 in total. A one-sided test needs 28,903 per group.
Power is the probability that the test notices an effect if it really exists. At 80% power one real effect in five goes unnoticed: the test says “not significant” although the change helped. Higher power means a larger sample: for 2% conversion and a +15% uplift, 80% power needs 36,693 visitors per group and 90% power already 49,121. Most teams choose 80%.
The one that makes the change worth shipping, not the one you hope for. Pick it before launch: if a smaller uplift would not pay for the work, there is no point catching it. It can be relative, say +15% on a 2% conversion, or absolute, +0.3 percentage points — the same thing. The sensitivity table beside it shows the sample for effects from +5% to +30%.
The sample grows with the inverse square of the effect: half the effect needs roughly four times the visitors. A small difference is harder to tell from random noise, and only volume averages the noise out. At 2% conversion a +15% uplift needs 36,693 visitors per group, +10% needs 80,682 and +5% already 315,206. That is why small sites test bold changes rather than a button shade.
Choose the 20 / 80 split: the calculator sizes each group separately with a factor k, how many times group B is larger than A. For 2% conversion and a +15% uplift you need 23,300 visitors in the smaller group and 93,197 in the larger one — 116,497 in total against 73,386 for an equal split. An unequal split limits the risk if the new version is worse, but the test runs longer.
CUPED adjusts the metric for the same user’s behaviour before the test, such as last month’s average order. It removes part of the noise, and the sample shrinks by a factor of 1 − ρ², where ρ is the correlation of the metric before and during the test. At ρ = 0.5 you need a quarter fewer visitors: for an order value of 3,000 with a deviation of 1,500 and a +90 effect, 3,271 instead of 4,361 per group.