Reference
Method and formulas
Every number the calculator shows traces back to one of the expressions below. If a figure disagrees with another tool, this page is the place to find out why — usually it is a different standard error, a one-tailed test, or a rounding of the critical value.
Notation
nc, nv | visitors in control and variant |
xc, xv | conversions in control and variant |
p̂c, p̂v | observed conversion rates, x / n |
α | significance level; 0.05 for a 95% interval |
zq | the standard normal quantile at probability q |
Φ | the standard normal CDF |
1. Significance: pooled two-proportion z-test
The null hypothesis is that both variants share one underlying rate. Under that assumption the
best estimate of the shared rate pools the two groups, which is why the standard error is
computed from p̂ rather than from the two observed rates separately.
SEpool = √( p̂(1 − p̂) · (1/nc + 1/nv) )
z = (p̂v − p̂c) / SEpool
p = 2 · (1 − Φ(|z|))
The test is two-tailed. A one-tailed test halves the p-value on the assumption that the variant cannot be worse, which is an assumption product experiments rarely earn. Reporting a one-tailed p-value without saying so is one of the more common ways a marginal result is made to look decisive.
Normal quantiles come from Acklam's rational approximation (relative error below 1.2 × 10⁻⁹); the CDF uses the Abramowitz–Stegun 7.1.26 error-function approximation (absolute error below 1.5 × 10⁻⁷). Neither contributes visible error at four decimal places.
2. Confidence interval
The interval uses an unpooled standard error. This is deliberate and differs from the test statistic above: the pooled variance is only correct under the null, whereas a confidence interval should stay valid when the rates genuinely differ. The result is slightly wider and slightly more conservative than a pooled interval.
CI = (p̂v − p̂c) ± z1−α/2 · SEdiff
Relative lift is the same interval divided by p̂c. That transformation is
not linear, so the point estimate is not the midpoint of the relative interval — near
significance the two can look notably asymmetric. Read the absolute interval when the two rates
are close.
3. Minimum detectable effect
With the sample you already have, the smallest true difference detectable at power
1 − β solves:
Because pv depends on δ, the expression is solved by fixed-point
iteration — it converges in a handful of steps. The calculator reports it at 80% power: if the
true effect equals this value, the test will reach significance about four times in five.
This is the number that turns “not significant” into an actionable sentence. If the MDE is bigger than the effect you would have shipped on, the experiment could not have answered your question, and more traffic — not a different metric — is what you need.
4. Sample size for planning
For unequal allocation with k = n2/n1 and
p̄ = (p1 + k·p2)/(1 + k):
At k = 1 this reduces to the familiar equal-allocation formula. Two sanity checks
worth remembering: detectable effect scales with 1/√n, so halving the effect you
want to catch quadruples the traffic; and a low baseline rate costs more than a high one,
because variance is largest near p = 0.5 and the same absolute lift is a bigger
relative move at a small baseline.
5. Bayesian probability
With a uniform Beta(1, 1) prior, each group has posterior
Beta(1 + x, 1 + n − x). The reported figure is
P(pv > pc), estimated from 20,000 draws using a fixed-seed
PRNG, so the same inputs always give the same answer. Monte Carlo standard error at 20,000 draws
is under 0.35 percentage points.
The uniform prior is a choice, not a neutral default. It encodes “any conversion rate between 0 and 1 is equally plausible before seeing data”, which is wrong for most real funnels — you usually have a strong prior that the rate is near its historical value. A prior centred on the baseline pulls the probability towards 50%, especially in small samples. Use the number as a second reading, not a replacement for the interval.
6. Multiple looks
If a test is inspected k times and stopped at the first significant reading, the
family-wise error rate under independent looks is:
The calculator applies a Bonferroni correction, α′ = α/k and
p′ = min(1, k·p). Bonferroni controls the error rate without assuming independence,
which is why it is used here; the cost is that it is conservative when looks are positively
correlated, as they are in practice. A result that survives Bonferroni is strong evidence. A
result that does not is not thereby refuted — it means the data cannot distinguish the two.
Bonferroni is a patch, not a design. The correct fix is a fixed sample size agreed in advance, or a sequential procedure built for continuous monitoring (group sequential boundaries, always-valid inference). A fixed-horizon z-test watched continuously is neither.
7. Assumptions, and where they break
- Independent observations. The unit of randomisation must be the unit of analysis. Randomising users but analysing sessions understates variance and overstates significance. Cluster-randomised experiments need a different variance estimate entirely.
- Large-sample approximation. The normal approximation to the binomial is reasonable when each group has at least about 5 successes and 5 failures; below roughly 300 conversions per group, prefer Fisher's exact test or a Bayesian Beta-Binomial model.
- One metric, one look. Testing five metrics and reporting the one that wins is the same error as peeking five times, and needs the same correction.
- No variance reduction. CUPED, stratification and regression adjustment all shrink the standard error and therefore the MDE. This calculator does not model them, so it will overstate the sample size for a well-instrumented experiment.
- Fixed horizon. The p-value is only valid at the pre-planned sample size. Every interim look without correction inflates it.
8. Why these choices, briefly
| Decision | Alternative | Why this one |
|---|---|---|
| Pooled SE for the test | Unpooled | Correct under the null, and it is the standard formulation |
| Unpooled SE for the interval | Pooled | Remains valid when the rates differ; slightly wider, so more conservative |
| Two-tailed | One-tailed | No assumption that the variant cannot hurt |
| Bonferroni for peeking | Šidák, alpha-spending | No independence assumption; deliberately conservative |
| Uniform prior | Empirical or sceptical prior | Does not smuggle in an assumption the data should supply |
Corrections, counter-examples and concrete disagreement are welcome — see the about page for how to reach us.