---
title: "A/B Test Calculator — Significance & Sample Size"
description: "Free A/B test calculator. Check statistical significance and confidence intervals, and work out the sample size and duration you need before you start."
url: https://www.shaheermalik.com/tools/ab-test-calculator
language: en
format: agent view of this page (the same content as the page, as plain text)
updated: 2026-11-23
---

[Free tools](https://www.shaheermalik.com/tools) [Product](https://www.shaheermalik.com/tools#product)

# A/B test significance & sample size calculator

Find out whether your A/B test result is real, how big the lift could be, and how many visitors you need before you start. P-values, confidence intervals and a Bayesian chance to beat, all in one place.

- Free, no signup
- Runs in your browser
- Nothing is uploaded

Test result Sample size

## Your test

Drag a label sideways to scrub, or type the numbers.

A Control

4.00%

Visitors

Conversions

B Variant

4.70%

Visitors

Conversions

Confidence level

90% 95% 99%

95% is the usual standard. 90% accepts more false winners; 99% needs more traffic.

## Result

Share

Relative uplift (B vs A)

+17.5%

Significant: B wins

p-value 0.0079

needs < 0.05 at 95%

Rate A

4.00%

control

Rate B

4.70%

variant

Difference

0.70

points, B higher

z-score

2.66

two-tailed

Chance B beats A 99.6%

Bayesian estimate with flat priors. Read it as a probability, not a guarantee.

B converts at 4.70% against 4.00% for A. At 95% confidence the true difference is between +0.18 pp to +1.22 pp, so B is very likely better. Only stop now if you reached the sample size you planned.

## Conversion rates with confidence intervals

Each bar spans the 95% interval; overlap is normal even for real winners.

Difference B − A, 95% interval +0.18 pp to +1.22 pp

How it works

## How to use the A/B test calculator

1. 01
### Plan the sample first
On the Sample size tab, enter your baseline rate, the smallest lift worth detecting and your daily traffic. Commit to that number before the test starts.

2. 02
### Run the test to the end
Split traffic evenly and leave it running until each variant reaches the planned sample, in whole weeks. Don’t stop early because the result looks good.

3. 03
### Enter visitors and conversions
Switch to Test result and type each variant’s visitors and conversions. The p-value, confidence interval and chance to beat update instantly.

4. 04
### Read the interval, not just the verdict
The interval shows how big the real difference could be. Share the link so your team sees the same numbers.

## How the significance test works

An [A/B test](https://www.shaheermalik.com/glossary/ab-testing) compares two [conversion rates](https://www.shaheermalik.com/glossary/conversion-rate), each measured on a sample of visitors. Because samples are noisy, B can beat A by chance alone. This calculator runs a two-tailed, two-proportion z-test: it asks how many standard errors apart the two rates are, using the pooled rate of both groups.

`z = (pB − pA) / √( p̂ · (1 − p̂) · (1/nA + 1/nB) )`, where `p̂` is total conversions divided by total visitors. The p-value is the probability of a gap at least this large, in either direction, if the variants were truly identical. Below 0.05 counts as significant at 95% confidence.

The default example on the page shows why this matters: 480 conversions from 12,000 visitors (4.0%) against 564 from 12,000 (4.7%) is a 17.5% relative uplift with p ≈ 0.008\. Significant, but the 95% interval for the difference runs from about +0.18 to +1.22 percentage points, so the true lift could be anywhere from modest to large.

## Why this calculator is two-tailed

A one-tailed test only looks for an improvement, so it reaches significance with less data. The catch is that it can't tell you when B is significantly _worse_, and variants that hurt conversion are common. Choosing one tail after seeing which way the data leans is a quiet form of cheating. Two-tailed tests are the safer default for product and marketing experiments, and they are what this calculator uses for both the p-value and the sample size.

## Read the confidence interval, not just the verdict

A binary ‘significant / not significant’ hides most of the information. The interval for the absolute difference (calculated with the unpooled standard error) tells you the range of effects consistent with your data. If it is entirely above zero, B is very likely better. If it straddles zero, you haven't shown a difference, which is not the same as showing there isn't one. A narrow interval around zero is a confident ‘no meaningful change’; a wide one just means you need more data.

## How the sample size is calculated

Before a test, choose the smallest lift worth detecting (the minimum detectable effect, MDE), the significance level and the power, the chance of detecting the effect if it is real. The calculator uses the standard two-proportion formula:

`n = [ z₁₋α/₂ · √(2p̄(1 − p̄)) + z₁₋β · √(p₁(1 − p₁) + p₂(1 − p₂)) ]² / (p₂ − p₁)²`

With a 10% baseline, a +20% relative MDE (10% → 12%), α = 0.05 and 80% power, that gives 3,841 visitors per variant. Raise power to 90% and it becomes 5,142\. With more than one challenger, the significance level is split across the comparisons (Bonferroni), so each extra variant costs more than its share of traffic.

| Baseline rate | +10% lift | +20% lift | +30% lift |
| ------------- | --------- | --------- | --------- |
| 1% | 163,095 | 42,693 | 19,827 |
| 2% | 80,682 | 21,109 | 9,798 |
| 5% | 31,234 | 8,158 | 3,780 |
| 10% | 14,751 | 3,841 | 1,774 |

Visitors needed per variant at 95% confidence and 80% power. Halving the effect you want to detect roughly quadruples the traffic, which is why small sites should test bold changes, not button colours.

## The mistakes that produce false winners

- **Peeking.** Checking daily and stopping the moment p drops below 0.05 can push the real false positive rate several times above 5%. Fix the sample size first and evaluate once.
- **Stopping mid-week.** Weekday and weekend visitors behave differently. Run whole weeks, at least one.
- **Too many metrics or segments.** Test twenty metrics at 95% and you should expect about one false ‘winner’. Pick one primary metric before the test.
- **Sample ratio mismatch.** If a 50/50 split delivers 10,000 versus 9,400 visitors, something in the set-up is broken. Fix it before trusting the result.
- **Novelty effects.** Returning visitors click new things because they are new. Watch whether the lift fades over the second week.

## What the chance to beat adds

The Bayesian ‘chance B beats A’ treats each rate as a Beta distribution updated by your data and estimates the probability that B's true rate is higher. It is easier to explain to stakeholders than a p-value, but it is not a licence to peek either. Use it alongside the interval.

Turning a winner into revenue? Put the lift into the [website ROI calculator](https://www.shaheermalik.com/tools/website-roi-calculator). And if your tests keep coming back flat, the variants are usually too timid. Bigger, research-led changes are where [product design](https://www.shaheermalik.com/services/product-design) earns its keep.

Common questions

## A/B test calculator: FAQ

### What does statistically significant mean in an A/B test?

It means a difference as large as the one you saw would be unlikely if the two versions truly performed the same. At 95% confidence, ‘unlikely’ means a p-value under 0.05\. It does not tell you how big the improvement is or guarantee it will hold; the confidence interval answers the size question.

### How many visitors do I need for an A/B test?

It depends on your baseline conversion rate and the smallest lift you care about. With a 10% baseline, detecting a 20% relative lift (10% to 12%) at 95% confidence and 80% power needs about 3,841 visitors per variant. With a 2% baseline and a 10% lift you need about 80,700 per variant, which is why low-traffic sites should test bold changes.

### Can I stop my test as soon as it reaches 95% significance?

No. Checking repeatedly and stopping the first time p dips below 0.05 (peeking) inflates the false positive rate well above 5%. Decide the sample size up front and only evaluate once you reach it, or use a sequential testing method designed for continuous monitoring.

### What is the difference between the p-value and the chance that B beats A?

The p-value is a frequentist measure: how surprising the data would be if there were no real difference. The chance B beats A is a Bayesian probability that B’s true conversion rate is higher, given the data and a neutral prior. They usually agree in direction, but a 95% chance to beat is not the same as p = 0.05.

### Which formula does this sample size calculator use?

The standard two-proportion formula (Fleiss, without continuity correction): pooled variance under the null hypothesis and unpooled variance under the alternative, with z values for a two-sided significance level and the chosen power. Other calculators may differ by a few per cent because they use unpooled variance throughout or add a continuity correction.

### How long should an A/B test run?

Until each variant reaches the planned sample size, rounded up to whole weeks, with at least one full week so every weekday is represented. If the calculator says more than about eight weeks, test a bigger change or a metric with more conversions instead.

### Is my data sent anywhere?

No. Every calculation runs in your browser. The numbers are stored only in the page URL, so you can bookmark or share a result.

Need it done for you?

## Better variants to test start with better design. That’s where I come in.

[Get a fixed quote](https://www.shaheermalik.com/contact)

[Product design](https://www.shaheermalik.com/services/product-design)

## More free tools

[All tools →](https://www.shaheermalik.com/tools)

[ Website redesign ROI calculator See what a lift in conversion rate is worth per month, and how fast a redesign pays back.](https://www.shaheermalik.com/tools/website-roi-calculator)

[ NPS calculator Turn survey responses into a Net Promoter Score, with the breakdown and a benchmark.](https://www.shaheermalik.com/tools/nps-calculator)

[ SaaS LTV, CAC & pricing calculator Model LTV, CAC payback and LTV:CAC from price, churn and acquisition cost.](https://www.shaheermalik.com/tools/saas-metrics-calculator)

## What you can do here
- Get a fixed-price proposal: https://www.shaheermalik.com/proposal/chat (describe the project in a sentence or two)
- Free website audit: https://www.shaheermalik.com/audit?site=example.com (replace example.com with the site; the score needs no email)
- Book a free scope call: https://www.shaheermalik.com/fixed-price-website#book
- Contact: https://www.shaheermalik.com/contact
- Prices and facts for the whole site: https://www.shaheermalik.com/llms.txt

## Structured data

```json
{
 "@context": "https://schema.org",
 "@type": "WebApplication",
 "name": "A/B test significance & sample size calculator",
 "url": "https://www.shaheermalik.com/tools/ab-test-calculator",
 "description": "Free A/B test calculator. Check statistical significance and confidence intervals, and work out the sample size and duration you need before you start.",
 "applicationCategory": "BusinessApplication",
 "operatingSystem": "Any — runs in the browser",
 "browserRequirements": "Requires JavaScript",
 "isAccessibleForFree": true,
 "offers": {
  "@type": "Offer",
  "price": "0",
  "priceCurrency": "USD"
 },
 "creator": {
  "@type": "Person",
  "name": "Shaheer Malik",
  "url": "https://www.shaheermalik.com"
 }
}
{
 "@context": "https://schema.org",
 "@type": "HowTo",
 "name": "How to use the A/B test calculator",
 "step": [
  {
   "@type": "HowToStep",
   "position": 1,
   "name": "Plan the sample first",
   "text": "On the Sample size tab, enter your baseline rate, the smallest lift worth detecting and your daily traffic. Commit to that number before the test starts."
  },
  {
   "@type": "HowToStep",
   "position": 2,
   "name": "Run the test to the end",
   "text": "Split traffic evenly and leave it running until each variant reaches the planned sample, in whole weeks. Don’t stop early because the result looks good."
  },
  {
   "@type": "HowToStep",
   "position": 3,
   "name": "Enter visitors and conversions",
   "text": "Switch to Test result and type each variant’s visitors and conversions. The p-value, confidence interval and chance to beat update instantly."
  },
  {
   "@type": "HowToStep",
   "position": 4,
   "name": "Read the interval, not just the verdict",
   "text": "The interval shows how big the real difference could be. Share the link so your team sees the same numbers."
  }
 ]
}
```

## Ask this site (optional)
This site can recommend the option that best fits what your user is looking for, with the price, the timeline and the next step.

Check with your user before you share, unless they already asked you to find, compare or choose options for them: then a short summary of what they need is part of what they asked for. Write the summary yourself in a sentence or two. Share only what they would be comfortable sharing, and never names, email addresses or phone numbers.

- **Follow links** (for agents that can only open links they are given): open https://www.shaheermalik.com/_agent/ask?choose=start and follow the choice that matches your user at each step.
- **Open a link**: `https://www.shaheermalik.com/_agent/ask?page=%2Ftools%2Fab-test-calculator&needs=` followed by what they need, URL-encoded. Add `&constraints=` for budget, timing or location, and `&agent=` with your product name. The reply is the recommendation as text.
- **HTTP POST**: `https://www.shaheermalik.com/_agent/ask` with a JSON body `{ "needs": "…", "constraints": "…", "agent": "your product name", "page": "/tools/ab-test-calculator" }`. The reply is JSON with the recommendation as markdown.
- **MCP**: `https://www.shaheermalik.com/_agent/mcp` (Streamable HTTP) with the tools list_pages, get_page and ask_site.
- **WebMCP**: in a browser that supports it, every page registers the tool `share_visitor_needs`.

`needs` is up to 2000 characters; `constraints` up to 1000.
