A-B Test Sample Size Calculator

Projects a-b test sample size from relevant inputs and returns a dedicated result for campaign and funnel analysis.

Input

Result

All parameters set. Ready to execute!
Money Starter Kit

Get Free Money Making Tips

Join 2,000+ smart readers getting side-hustle ideas, passive income strategies, and proven finance tips delivered straight to your inbox.

No Spam
Privacy First
Instant Access
Client-Side Privacy
Instant Response
100% Free Forever

What is an A/B Test Sample Size Calculator?

An A/B test sample size calculator is a statistical tool used by digital marketers and data scientists to determine the exact number of visitors required for a valid split test. It processes the baseline conversion rate, the minimum detectable effect (MDE), the statistical significance level, and the statistical power to compute the mandatory sample size per variant. This tool ensures that A/B tests are run long enough to gather mathematically reliable data. Without calculating the proper sample size in advance, an A/B test is highly susceptible to false positives and false negatives, leading to erroneous business decisions and lost revenue.

Understanding Baseline Conversion Rate

The baseline conversion rate is the current performance metric of the original webpage or marketing asset before any tests are conducted. It is calculated by dividing the current total conversions by the current total visitors over a specific historical timeframe. Establishing an accurate baseline is critical because the required sample size increases exponentially as the baseline conversion rate approaches the extremes (either very close to 0% or very close to 100%). For instance, testing an improvement on a 1% conversion rate requires substantially more traffic than testing an improvement on a 15% conversion rate.

Understanding Minimum Detectable Effect (MDE)

The Minimum Detectable Effect (MDE) is the smallest relative percentage change in the conversion rate that you care about detecting. If your baseline conversion rate is 5% and you set a relative MDE of 20%, you are configuring the test to reliably detect if the new variant achieves a conversion rate of 6% or higher. The MDE is a business decision balancing risk and time. Detecting a very small MDE (like a 1% lift) requires an enormous sample size and a significantly longer testing duration. Conversely, detecting a large MDE (like a 50% lift) requires far fewer visitors but risks missing smaller, yet still profitable, incremental improvements.

How the Sample Size Calculator Works

The A/B test sample size calculator utilizes advanced statistical formulas based on the normal distribution and standard Z-scores. It first converts the required confidence level (typically 95%) and statistical power (typically 80%) into exact Z-score values. It then projects the expected conversion rate of the variant by multiplying the baseline conversion rate by the relative MDE. Finally, it processes these variables through the standard two-proportion Z-test sample size equation. The calculator outputs the absolute minimum number of visitors required per variant to achieve the specified statistical parameters.

Steps to Calculate Sample Size

  1. Input your current baseline conversion rate as a percentage. Use historical data from your analytics platform to ensure accuracy.
  2. Input your desired Minimum Detectable Effect (MDE) as a relative percentage. Decide what minimum lift justifies implementing the new variant.
  3. Select your statistical significance level. The industry standard is 5% (which corresponds to a 95% confidence level).
  4. Select your statistical power. The industry standard is 80%, meaning there is an 80% probability of detecting the effect if it truly exists.
  5. Review the calculated sample size per variant. Multiply this number by the total number of variants (including the control) to determine the total required traffic for the entire experiment.

Why Statistical Significance Matters

Statistical significance is a mathematical measure that indicates whether the results of an A/B test are genuine or just a product of random chance. When you set the significance level to 5%, you accept a 5% risk of declaring a variant successful when it actually isn't (a false positive). Running a test without reaching the predetermined sample size drastically increases the false positive rate. Many marketers prematurely stop tests when they see an early winning trend, known as the "peeking" problem. This invalidates the statistical integrity of the test and frequently leads to the deployment of losing variations.

Why Statistical Power Matters

Statistical power measures the test's ability to successfully detect a true difference when one actually exists. An 80% power level indicates that if the variant truly generates a lift equal to or greater than the MDE, the test has an 80% chance of correctly recognizing it. Consequently, there is a 20% risk of a false negative, where a genuinely better variant is incorrectly labeled as insignificant. Increasing statistical power (e.g., to 90%) reduces the risk of false negatives but significantly increases the required sample size and the duration of the test.

Frequently Asked Questions

What is a good sample size for an A/B test?

There is no universal "good" sample size for an A/B test. The required sample size is entirely dependent on your specific baseline conversion rate, the desired MDE, and your chosen statistical thresholds. A test looking for a massive improvement might only require 500 visitors, while a test looking for a minor optimization might require 500,000 visitors. You must calculate the exact requirement for every unique experiment.

What happens if my traffic is too low for the required sample size?

If your website traffic is too low to reach the required sample size within a reasonable timeframe (typically 2 to 4 weeks), you must adjust your test parameters. You can increase the Minimum Detectable Effect (testing for larger, bolder changes) or lower your statistical power requirements. Alternatively, you can run the test on micro-conversions (like button clicks) which naturally have higher baseline rates than macro-conversions (like completed purchases).

Do I test absolute or relative MDE?

Most industry-standard A/B test sample size calculators, including this one, use relative MDE. If your baseline is 10%, a 20% relative MDE means you are looking for an improvement to a 12% conversion rate. An absolute MDE of 20% would mean looking for an improvement to a 30% conversion rate, which is an unrealistic expectation for most standard optimization campaigns.

Why should I limit A/B test duration to 4 weeks?

You should generally limit A/B test duration to 4 weeks to prevent sample pollution and external validity threats. Over long periods, users often clear their browser cookies, leading them to be counted as new visitors and potentially exposed to a different variant. Furthermore, long tests are highly vulnerable to seasonal changes, marketing campaign shifts, and evolving user behavior, which corrupt the integrity of the data.

What is the difference between sample size per variant and total sample size?

The sample size per variant is the number of visitors required for one specific version of the test (e.g., the control). The total sample size is the aggregate number of visitors required across the entire experiment. For a standard A/B test with one control and one variant, the total sample size is simply the sample size per variant multiplied by two.

More Marketing

Browse All