An AB test calculator answers two questions: is the gap between version A and version B bigger than chance would produce (statistical significance), and how many visitors does a test need before you can trust it (sample size), which at your daily traffic sets how long to run it. The calculator below does both, with the standard formulas from the NIST/SEMATECH e-Handbook of Statistical Methods.
- Significant is not the same as big. In the example, B converts at 3.50% against 3.00%: a 16.7% lift with a p-value of 0.029, but a 95% range of +1.7% to +31.6%.
- Size the test before you start. At a 3% conversion rate, finding a 10% lift at 95% confidence and 80% power takes 53,211 visitors per version: four weeks at 4,000 visitors a day.
- Half the lift needs about four times the visitors: a 5% lift takes 104 days at the same traffic.
- Stopping on the first significant day turned about 5% false winners into about 27% in our simulation of 20,000 tests with no real difference.
- Platforms differ: Meta A/B tests run up to 30 days, Google Ads experiments report at 80% confidence by default, and GA4 has had no testing tool since Google Optimize closed in 2023.
AB test calculator: significance, sample size and how long to run
Pick a mode. To check a finished test, enter each version’s visitors and conversions (orders, leads or sign-ups, counted the same way for both) and the confidence level. To plan a test, enter the control’s conversion rate, the smallest lift worth detecting, the number of versions and the daily visitors to the page or audience you will change. The figures filled in are examples, not Gulf benchmarks.
A/B test calculator: significance of a finished test, sample size and days to run
Example numbers, not benchmarks: replace them with your own.
Version A (control)
People who saw this version: users or sessions, the same unit for both.
Of those, how many converted (purchases, leads, sign-ups).
Version B (challenger)
The result
- Lift, B against A
- +16.7%
- Conversion rate 3.00% → 3.50%
- p-value
- 0.029
- Two-sided. The chance of a gap at least this big if A and B were really the same.
- Significant at 95%?
- Yes
- Clears 90% and 95%
- Likely lift (95% interval)
- +1.7% to +31.6%
- +0.05 to +0.95 percentage points
- Visitors per version for a lift this size
- 19,743
- At 80% power. This test had 12,000.
Conversion rate
- Version A (control)3.00%
- Version B (challenger)3.50%
Version B wins at 95% confidence (p = 0.029), but the lift could be anywhere from +1.7% to +31.6%, and the test was smaller than a lift this size needs: expect less than +16.7% when you roll it out.
How this is calculated
Finished test: the two-proportion z-test of the NIST/SEMATECH e-Handbook (section 7.3.3). z = (rate B − rate A) ÷ √(p × (1 − p) × (1/visitors A + 1/visitors B)), where p is both versions’ conversions ÷ both versions’ visitors. The p-value is two-sided. The interval is the difference ± z for the confidence level × √(rate A(1 − rate A)/visitors A + rate B(1 − rate B)/visitors B), shown as a lift by dividing by the control’s rate.
Sample size per version: (z for the confidence × √(2 p̄(1 − p̄)) + z for the power × √(p₁(1 − p₁) + p₂(1 − p₂)))² ÷ (p₂ − p₁)², where p₁ is the control’s rate, p₂ the rate with the lift and p̄ their average (the two-sample form of e-Handbook section 7.2.4.2, as in R’s power.prop.test). With more than two versions, the 5% (at 95%) is split between the comparisons with the control (Bonferroni). Days = all versions’ visitors ÷ visitors a day in the test.
Platforms: Meta A/B tests run 1 to 30 days and Meta recommends at least 7. Google Ads experiments show results at 80% confidence by default (you can change it) and suggest about 2 to 3 weeks. Google Analytics 4 doesn’t run A/B tests itself. Checked on 1 November 2026.
How to read an A/B test result
Even identical versions convert at slightly different rates by chance. The two-proportion z-test, as the e-Handbook sets it out, asks whether the gap you see is bigger than chance usually produces:
rate A = conversions A ÷ visitors A rate B = conversions B ÷ visitors B
pooled rate p = (conversions A + conversions B) ÷ (visitors A + visitors B)
z = (rate B − rate A) ÷ √( p × (1 − p) × (1 ÷ visitors A + 1 ÷ visitors B) )
interval = (rate B − rate A) ± z for the confidence level × √( rate A(1 − rate A) ÷ visitors A + rate B(1 − rate B) ÷ visitors B )- p-value: how often a gap at least this big would appear if A and B were really the same. 0.029 is about 3 times in 100; it is not the probability that B is better.
- Confidence level: the bar you set before the test. Significant means a p-value below 0.05 at 95% and below 0.01 at 99%. The test is two-sided, so it also catches a change that hurt.
- Confidence interval: the range of lifts the data fit. Its width is how much you actually learned.
Worked example: is version B really better?
The calculator’s first example: a Saudi store tests its product page, and version B adds a line about cash on delivery and delivery time next to the price (an example change, not a recommendation). Each version got 12,000 visitors.
| Measure | Version A (control) | Version B |
|---|---|---|
| Visitors | 12,000 | 12,000 |
| Conversions | 360 | 420 |
| Conversion rate | 3.00% | 3.50% |
| Lift against A, and z | – | +16.7%, z = 2.18 |
| p-value, two-sided | – | 0.029 |
| Significant at 95%? | – | Yes (not at 99%) |
| 95% range for the lift | – | +1.7% to +31.6% |
| Visitors per version a lift this size needs (80% power) | – | 19,743 |
B wins at 95% confidence, but the range says the true lift is anywhere from about 2% to about 32%. The test was also smaller than the 19,743 visitors per version a 16.7% lift needs, and undersized tests that do clear the bar tend to overstate the lift: roll B out, but forecast with the bottom of the range. At 99% confidence the range runs from −3.0% to +36.3% and includes zero, and with half the visitors (same rates) the p-value is 0.12: the same gap, no conclusion.
Sample size: how many visitors an A/B test needs
Four choices set the size: the control’s baseline conversion rate; the minimum detectable effect (MDE), the smallest relative lift worth finding, so 10% on 3.00% means detecting 3.30%; the confidence level; and the power, the chance of detecting the lift if it is real (80% is usual).
p₁ = baseline rate p₂ = p₁ × (1 + MDE) p̄ = (p₁ + p₂) ÷ 2
visitors per version = ( z₁₋α/₂ × √(2 p̄ (1 − p̄)) + z₁₋β × √(p₁(1 − p₁) + p₂(1 − p₂)) )² ÷ (p₂ − p₁)²
z₁₋α/₂ = 1.96 at 95% confidence z₁₋β = 0.84 at 80% powerThis is the two-sample form of the e-Handbook’s sample-size formula for proportions, the same calculation as R’s power.prop.test. Here is how each choice moves the example’s 53,211 visitors per version:
| Change from the example | Visitors per version | Days at 4,000 a day |
|---|---|---|
| None: 3.00% baseline, 10% lift, 95% confidence, 80% power | 53,211 | 27 |
| Baseline 1.5% instead of 3% | 108,153 | 55 |
| 90% confidence | 41,914 | 21 |
| 99% confidence | 79,177 | 40 |
| 90% power | 71,233 | 36 |
| Three versions instead of two | 64,439 | 49 |
With more than one challenger, the calculator splits the 5% error rate between the comparisons with the control (the e-Handbook’s Bonferroni method), and each extra version takes its own share of traffic.
How long to run an A/B test
Days = all versions’ visitors ÷ visitors a day in the test. Round up to whole weeks so every weekday and the weekend count equally, and never run less than a week. At 4,000 visitors a day, a figure chosen for illustration rather than a benchmark:
| Smallest lift to detect | Rate to detect | Visitors in total | Days at 4,000 a day | Run for |
|---|---|---|---|---|
| 5% | 3.00% → 3.15% | 415,876 | 104 | 15 weeks |
| 10% | 3.00% → 3.30% | 106,422 | 27 | 4 weeks |
| 15% | 3.00% → 3.45% | 48,386 | 13 | 2 weeks |
| 20% | 3.00% → 3.60% | 27,828 | 7 | 1 week |
| 30% | 3.00% → 3.90% | 12,910 | 4 | 1 week |
If the honest answer is 104 days, redesign the test: try a bolder change that could plausibly move conversion by 15 or 20%, or test where there is more traffic.
Don’t stop early: peeking, White Friday and Ramadan
The 95% promise holds only if you read the result once, at the planned end. We simulated 20,000 tests in which A and B were identical (3% each, 2,000 visitors per version a day, 28 days). Read once at the end, 4.7% showed a significant winner, as designed. Read every evening and stopped at the first significant result, 27.3% did, 16.4% within the first week.
Gulf seasons are the second reason. A test that runs into White Friday week mixes sale shoppers with everyday visitors, and one run inside Ramadan, expected to begin around 8 February 2027 (our Ramadan 2027 plan), tells you about Ramadan shoppers. Run tests in ordinary weeks, or across a whole season on purpose, with the 2027 marketing calendar beside you, and never stop one because a sale made the numbers jump.
Arabic and English pages: test each language on its own
Most Gulf sites run Arabic and English versions of the same page, and their visitors often behave differently.
- Count only the traffic the change touches. If 40% of the example’s 4,000 daily visitors use the Arabic page (an example share), a 10% test there takes 67 days instead of 27, or 18 for a 20% lift.
- Read each language separately when the change differs between them, or one language’s gain can hide the other’s loss.
- Test language itself on ads, not pages. Meta’s A/B test splits one audience so nobody sees both versions, which makes an Arabic and an English ad a fair comparison; on a website visitors choose their language, so the split isn’t random.
A/B testing in Meta, Google Ads and GA4
| Tool | How it decides | How long | Watch for |
|---|---|---|---|
| Meta A/B test | One variable changed and the audience split so nobody sees both; the lower cost per result wins, with a confidence percentage | 1 to 30 days; at least 7 recommended | The same budget for both versions |
| Google Ads experiments | A trial on a share of a Search, Display, Video or Hotel campaign’s budget; a confidence interval, and a blue asterisk when significant | About 2 to 3 weeks suggested | 80% confidence by default: switch to 95% |
| Google Analytics 4 | No testing tool of its own since Google Optimize closed on 30 September 2023; Google points to tools such as AB Tasty, Optimizely and VWO | Set by the testing tool | Run this calculator on each version’s visitors and conversions |
At 80% confidence, a test with no real difference still looks significant about one time in five, against one in twenty at 95%. For tests run through ads, tag each version’s link with our UTM builder so GA4 keeps the versions apart.
Common A/B testing mistakes
- Different units for A and B. Count users for both or sessions for both, with the same conversion event.
- A split that isn’t what you set. If a 50/50 split gave one version clearly more visitors, find the cause before trusting the result.
- Many metrics, one winner. Check enough metrics and one wins by chance: pick the deciding one before launch.
- Clicks instead of orders. Judge ad tests on cost per purchase against your break-even ROAS and, for repeat buyers, on CAC and lifetime value.
- Revenue in a conversion test. Order value and revenue per visitor need a different test from this one.
Meta’s A/B test rules, Google Ads’ experiment defaults and the closure of Google Optimize checked on 1 November 2026 in the Meta Business Help Center, Google Ads Help and Optimize Help; formulas from the NIST/SEMATECH e-Handbook of Statistical Methods. We update this page when the platforms change their rules.
Tests that change the plan
We plan and read A/B tests for stores and lead-generation sites in the UAE and Saudi Arabia, from Arabic and English landing pages to Meta and Google Ads experiments, with the sample size and end date agreed before launch. See Strategy and Performance Advertising, or send us a test’s numbers and we’ll tell you what they can and can’t prove.
Questions and answers
How do you calculate A/B test significance?
With the two-proportion z-test: divide the gap between the two conversion rates by its standard error under no difference, then turn z into a two-sided p-value. With 360 of 12,000 against 420 of 12,000, z is 2.18 and the p-value 0.029, significant at 95%.
What sample size do I need for an A/B test?
It depends on your conversion rate, the smallest lift worth detecting, the confidence level and the power. At 3%, a 10% lift, 95% confidence and 80% power need 53,211 visitors per version.
How long should an A/B test run?
Total visitors needed ÷ visitors a day in the test, rounded up to whole weeks and never under one week. The 106,422-visitor example takes 27 days at 4,000 a day, so four weeks.
Can I stop an A/B test early once it is significant?
Not with the standard test used here. In our simulation of 20,000 tests with no real difference, stopping at the first significant day produced a false winner 27.3% of the time, against 4.7% when read once at the end.
Does GA4 have A/B testing?
No. Google Optimize closed on 30 September 2023, and Google points to third-party tools such as AB Tasty, Optimizely and VWO that integrate with Google Analytics.
Sources
- Two proportions: same proportion of defectives?, NIST/SEMATECH e-Handbook of Statistical Methods, section 7.3.3: the two-proportion z-test (checked 1 November 2026)
- Sample sizes required, NIST/SEMATECH e-Handbook, section 7.2.4.2: sample size for proportions from confidence and power (checked 1 November 2026)
- Bonferroni’s method, NIST/SEMATECH e-Handbook, section 7.4.7.3: splitting the error rate between comparisons (checked 1 November 2026)
- About A/B testing, Meta Business Help Center: variables, split audiences, the same budget for both versions (checked 1 November 2026)
- Best practices for A/B testing, Meta Business Help Center: at least 7 days recommended, 30 at most (checked 1 November 2026)
- How winning campaigns are determined, Meta Business Help Center: cost per result and a confidence percentage (checked 1 November 2026)
- Monitor your experiments, Google Ads Help: 80% default confidence, the blue asterisk, 2 to 3 weeks (checked 1 November 2026)
- Set up a custom experiment, Google Ads Help: supported campaign types and the budget split (checked 1 November 2026)
- Google Optimize sunset, Optimize Help: closed on 30 September 2023, third-party testing integrations for Google Analytics (checked 1 November 2026)
- White Friday 2026, Salla seasons calendar: 27 November 2026 (checked 1 November 2026)
If you want a team to plan the budget and run the campaigns, see our paid advertising service in Dubai and Saudi Arabia.



