Skip to main content

A/B Test Sample Size Calculator

Calculate the sample size and estimated test duration needed for a valid A/B test, from your baseline conversion rate, minimum detectable effect, statistical power and significance level — before you start collecting data.

Input

Your current conversion rate before running the test.

The smallest change worth detecting. Relative: 20 means a 20% lift over baseline (5% → 6%). Absolute: 20 means +20 percentage points — use a small value like 1 or 2 for realistic pp effects.

2 = classic A/B test. 3+ variants apply a Bonferroni correction to the significance level, since each treatment is compared against the control.

Average daily traffic across all variants combined, to estimate how long the test will run.

Output

Breakdown
MetricValue
No data yet
Formula used
 
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/ab-test-sample-size-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "baselineRate": "5",
    "mdeType": "relative",
    "minimumDetectableEffect": "20",
    "testSides": "two",
    "power": "80",
    "significanceLevel": "0.05",
    "variants": "2",
    "dailyVisitors": ""
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `ab-test-sample-size-calculator` tool (A/B Test Sample Size Calculator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/ab-test-sample-size-calculator/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="A/B Test Sample Size Calculator — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

What does this calculator do?

Before you launch an A/B test, this tool tells you how many visitors you need per variant to reliably detect the improvement you care about. Enter your baseline conversion rate, the minimum detectable effect (the smallest lift worth catching), your target statistical power and significance level, and it runs the standard two-proportion sample-size formula to give you an exact number — plus an estimated test duration if you enter your daily traffic.

This is the calculation to run before a test starts. Once a test has finished, use the A/B Test Significance Calculator to evaluate the results you actually collected.

How to use it

  1. Enter your baseline conversion rate — the rate you're getting today.
  2. Enter the minimum detectable effect — how big a change is worth catching. Choose Relative (a % lift over baseline, e.g. 20 means 5% → 6%) or Absolute (a flat percentage-point change, e.g. 2 means 5% → 7%).
  3. Pick two-sided (the variant could be better or worse) or one-sided (you only care if it's better).
  4. Pick your statistical power (80% is the common default) and significance level (0.05 is standard).
  5. Set the number of variants, including control — 2 for a classic A/B test, more for an A/B/n test.
  6. Optionally enter your daily visitors to get an estimated test duration.

Why does the sample size change with more variants?

With 3 or more variants, each treatment gets compared against the control, so testing more variants means running more hypothesis tests at once. Left uncorrected, that inflates your overall false-positive rate — the more comparisons you run, the more likely one of them looks "significant" purely by chance. This calculator applies a Bonferroni correction, dividing your significance level by the number of comparisons, so the true error rate across the whole experiment stays at what you set.

What's the difference between relative and absolute MDE?

Relative MDE scales with your baseline — a 20% relative lift on a 5% baseline targets 6%, but the same 20% lift on a 40% baseline targets 48%. Absolute MDE is a fixed percentage-point change regardless of baseline — entering 2 always adds 2 percentage points, whether your baseline is 5% or 40%. Relative MDE is the more common convention for conversion-rate tests since it scales sensibly across pages with very different baseline rates.

Why does a smaller effect need so many more visitors?

Sample size grows roughly with the inverse square of the effect you're trying to detect — halving the minimum detectable effect roughly quadruples the required sample. That's why chasing very small lifts (1–2% relative) on low-traffic pages can require sample sizes in the hundreds of thousands, while a large expected effect on a high-converting page needs far fewer visitors.

Privacy

All calculations run locally in your browser — your numbers are never sent to a server.

statistical powerminimum detectable effectmdeconversion rate optimizationcropower analysistwo-proportion z-testexperiment designtest durationsignificance level

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.