A/B Test Calculator: Significance and Sample Size
Find out if your A/B test has a real winner, or how many visitors you need before you start. Enter visitors and conversions for each version and we’ll run a significance test, show the lift with a confidence range, and check that your traffic split is healthy. Planning a test? Switch to sample size to see how long it needs to run. It’s free and runs in your browser.
A (control)
B (variant)
Optional. 50 means a 50/50 split.
Enter visitors and conversions for both versions to see the result.
Decide your sample size before you start, then read the result once. Checking every day and stopping the first time it turns significant makes false winners much more likely. Why peeking fools you.
How to use the A/B test calculator
- Pull visitors and conversions for each version from your testing tool or GA4. In GA4, an exploration broken down by the dimension that stores your variant name works well. If your key events aren’t set up yet, start with conversion tracking in GA4.
- Enter them in the Test results tab and pick your confidence level. 95% is the usual choice.
- Read the verdict, then the range. A winner whose range barely clears zero is a small win, so don’t bank the top number.
- If the split warning shows, fix the setup before you trust anything else.
Tracking your test in GA4? Tag each version with its own utm_content or variant parameter so the numbers come out clean. Our UTM tracking guide shows how.
How many visitors does an A/B test need?
The sample size tab is an ab test sample size calculator built on four inputs. Each one changes the answer, so it helps to know what they mean.
- Baseline conversion rate. What the control converts at today. Lower rates need more visitors, because each conversion is rarer.
- Minimum detectable effect (MDE). The smallest lift you’d act on. Use relative for “10% better” and absolute for “half a point higher”. Halving the MDE roughly quadruples the ab test sample size.
- Confidence. How sure you want to be before calling a winner. 95% means you accept a 5% chance of calling a winner that isn’t one.
- Power. The chance you’ll catch a real lift of the MDE size. 80% is standard. More power means more visitors.
Here’s a worked example from our own numbers. At a 5% baseline, detecting a 10% relative lift (5% → 5.5%) at 95% confidence and 80% power needs about 31,234 visitors per variant, or 62,468 in total. At 2,000 visitors a day, that’s 62,468 ÷ 2,000 = 32 days. Round that up to five full weeks.
Statistical significance for A/B tests, in plain English
A statistical significance calculator answers one narrow question: if A and B really converted at the same rate, how often would a gap this big show up by chance? That’s the p-value. A p-value of 0.02 means about 2% of the time. It does not mean there’s a 2% chance B is no better. And “95% confidence” is not a 95% chance that B wins. It just means we’ve set the bar at p below 0.05.
The single lift number is the least useful part of the result. A 25% lift with a range from 4% to 50% means the true lift could be small. Plan on the low end, not the headline. When you report the test, the range is one of the KPIs worth reporting, because it tells your client how much to trust the win.
Don’t peek: why stopping early fools you
Every time you check a running test, you give chance another shot at crossing the line. Check daily for a month and the real false-positive rate climbs far above the 5% you planned for. The fix is simple. Set the sample size up front, run full weeks, and read the result once. Sequential testing methods exist for teams that need to look early, but we don’t use them here.
Sample ratio mismatch: the check many calculators skip
A sample ratio mismatch (SRM) means the number of visitors in each version doesn’t match the split you set. If you asked for 50/50 and got 10,000 to 10,600, something is wrong with the test, not the page. Common causes are redirect variants that lose visitors, bots hitting one version, a tag that fires on one version only, and broken assignment logic. We run a chi-square test on the split and flag it when p is below 0.01. That threshold is a convention, not a law, but it catches the setups you shouldn’t trust.
How the math works
- Significance: a two-proportion z-test with the pooled standard error. Two-sided by default, with a one-sided option that only checks if B beats A.
- Difference range: a Wald confidence interval for the absolute difference, using the unpooled standard error.
- Lift range: a delta-method interval on the log of the rate ratio. It’s a different interval from the z-test, so on a borderline result it can touch zero while the test says significant. We show both and tell you when that happens.
- Observed power: computed from your own difference and standard error at the chosen alpha. It follows directly from the p-value, so it isn’t evidence for or against an effect.
- Sample size: the normal-approximation formula without continuity correction, the same closed form as R’s power.prop.test. Other calculators can show slightly smaller numbers because they estimate the variance differently. Ours matches R’s power.prop.test. For a 20% baseline and a 5-point lift at 80% power, Evan Miller’s calculator gives about 1,030 per variant and ours gives 1,094.
- Sample ratio mismatch: a Pearson chi-square goodness-of-fit test with one degree of freedom, flagged at p below 0.01.
FAQ
What does statistically significant mean in an A/B test?
If there were really no difference, a gap as big as yours would be rare (less than 5% of the time at 95% confidence). It doesn't tell you how big the win is. The range does.
What confidence level should I use?
95% for most tests. 90% is fine for low-risk changes. 99% when a wrong call is expensive.
What's a good minimum detectable effect?
The smallest lift worth shipping. Smaller MDEs need far more traffic, and halving the MDE roughly quadruples the sample.
One-sided or two-sided?
Two-sided unless you'd never act on B being worse. One-sided needs fewer visitors, but it can't tell you when B hurts.
How long should an A/B test run?
Until it reaches the sample size you planned, and at least one full week. Use the duration estimate in the sample size tab.
Can I use GA4 numbers in this calculator?
Yes. Use users or sessions as visitors and a key event as the conversion. Pick one and stick with it for both versions.
Does this tool store my data?
No. Everything runs in your browser.
Measure your test results in GA4, minus the maze
Your A/B test is only as good as the numbers behind it. Helpful Analytics puts your GA4 traffic, key events and conversions in one simple dashboard, so you can see how each page is performing without digging through GA4 menus.
Try Helpful Analytics free →