Did variant B really convert better, or is the lift noise? Run a two-proportion, one-proportion or known-sigma mean z-test and get z, p, the interval, Cohen's h and the traffic needed.
Z-Test Calculator - A/B Test, One Proportion and Mean
Did variant B really convert better, or is the lift noise? Run a two-proportion, one-proportion or known-sigma mean z-test and get z, p, the interval, Cohen's h and the traffic needed.
Parameters
Enter data for calculations
💡 Fill in all required fields to unlock the calculate button
Z-test for an A/B split, a single rate or a mean with known sigma
Two thousand visitors saw version A and 200 of them bought. Another two thousand saw version B and 250 bought. Is a jump from 10% to 12.5% real? This z-test calculator answers with z = 2.502 and a two-sided p = 0.0124, then goes further than most A/B tools: it prints the continuity-corrected p that R's prop.test shows by default (0.0142), a 95% interval for the lift, Cohen's h and the group size you would need for 80% power at the same gap, 2,507 per arm. The same form runs a one-proportion test against a benchmark, with an exact binomial p beside the normal one, and a z-test for a mean when the population standard deviation is known from outside the sample.
A dashboard reading versus a tested difference
Reading the rates by eye
- a +25% lift on 1,000 visitors per arm looks like a win, yet p is 0.0769
- the test gets stopped the first day the dashboard turns green
- 3 successes out of 10 get judged with a formula built for large samples
- nobody knows how much traffic the next test needs
What the z-test adds
- z, the p-value and the critical z for the alpha you picked
- the continuity-corrected p, and a warning when it falls on the other side of alpha
- an exact binomial p for one proportion, which matters below about 10 expected successes
- the sample size for 80% power at the gap you observed
What to type for each of the three tests
- Kind of z-test - two proportions for an A/B test, one proportion against a benchmark rate, or one mean with a known population standard deviation. Only the boxes for that test appear.
- Group sizes and successes - for A/B, visitors (or users, or emails sent) and conversions in each group, as whole numbers. Write 1000, not 1,000: a comma is refused rather than guessed.
- Benchmark rate - for one proportion, the rate you compare with, in percent, strictly between 0 and 100, for example 50 for a coin or 3.5 for last year's conversion rate.
- Sample mean, population sigma, n and reference mean - for the mean test. Sigma has to come from outside these measurements, such as a machine specification or long-run records.
- Alternative hypothesis - two-sided for any difference, or one-sided when the direction was fixed before the data came in (B above A, or the sample below the reference).
- Significance level - 0.05, 0.01 or 0.10. It also sets the confidence level of the interval.
- Read the result: z and the verdict first, then the tiles, the step table and any note about small counts or a one-sided test pointing the wrong way.
How the z statistic is built, three cases by hand
one proportion: z = (p - p0) / sqrt(p0(1 - p0) / n)
one mean: z = (mean - mu0) / (sigma / sqrt(n))
The same 10% versus 12.5%, at five amounts of traffic
Rates fixed, only the visitors per arm change. The lift is identical in every row, and the verdict flips somewhere between 1,200 and 2,000 per arm. The last column is what you gain or lose by stopping at that point.
| Visitors per arm | z | p, two-sided | 95% interval for B - A | Verdict at 0.05 |
|---|---|---|---|---|
| 800 | 1.582 | 0.1136 | -0.59% to 5.59% | not significant |
| 1,200 | 1.938 | 0.0526 | -0.03% to 5.03% | not significant, by a hair |
| 2,000 | 2.502 | 0.0124 | 0.54% to 4.46% | significant |
| 2,600 | 2.853 | 0.0043 | 0.78% to 4.22% | significant |
| 4,000 | 3.538 | 0.0004 | 1.12% to 3.88% | significant |
| Planned in advance | 2,507 per arm gives an 80% chance of catching this gap | decided before launch | ||
The 1,200 row is the trap. A p of 0.0526 invites one more day of traffic "to get it over the line", and repeated peeking like that inflates the false positive rate well above the 5% you think you are running at. Fix the sample size first, then test once.
Critical z values worth memorizing
| Alpha | Two-sided | One-sided | Confidence level |
|---|---|---|---|
| 0.10 | 1.645 | 1.282 | 90% |
| 0.05 | 1.960 | 1.645 | 95% |
| 0.01 | 2.576 | 2.326 | 99% |
For any other cutoff, or for t, chi-square and F statistics, the p-value calculator returns the critical value for an alpha of your choice.
Short answers before you ship variant B
Related tools
Chi-Square Calculator
The same two-group comparison as a 2 x 2 table, plus tables with more rows and columns - See calculator
Sample Size Calculator
How many visitors each variant needs before the test starts, with dropout and power - See calculator
P-Value Calculator
Turns a z, t, chi-square or F statistic into a p-value and gives critical values for any alpha - See calculator
Z-Score Calculator
Standardizes a single value, finds its percentile and spots outliers in a list - See calculator
Fisher's Exact Test Calculator
The exact alternative for a 2x2 table when some counts are small - See calculator
One-Sample T-Test Calculator
Tests a mean against a target when the standard deviation comes from the sample itself - See calculator
Two-Sample T-Test Calculator
Compares the means of two groups with Welch, Student or a paired test - See calculator