Home Back

AB Test Calculator Sample Size

Sample Size Equation:

\[ n = \frac{z^2 \times p \times (1-p)}{e^2} \]

(0-1)
(0-1)

Unit Converter ▲

Unit Converter ▼

From: To:

1. What is the Sample Size Equation?

The sample size equation calculates the minimum number of participants needed in each group of an A/B test to detect a statistically significant difference, given a specified confidence level and margin of error.

2. How Does the Calculator Work?

The calculator uses the sample size equation:

\[ n = \frac{z^2 \times p \times (1-p)}{e^2} \]

Where:

Explanation: The equation balances the trade-off between statistical power (ability to detect a difference) and practical constraints (number of participants needed).

3. Importance of Sample Size Calculation

Details: Proper sample size calculation ensures your A/B test has sufficient statistical power to detect meaningful differences while avoiding unnecessarily large samples that waste resources.

4. Using the Calculator

Tips: Common values are Z=1.96 (95% confidence), p=0.5 (most conservative estimate), e=0.05 (5% margin of error). All values must be valid (0 < p < 1, e > 0).

5. Frequently Asked Questions (FAQ)

Q1: What Z-score should I use?
A: 1.96 for 95% confidence, 2.58 for 99% confidence, or 1.645 for 90% confidence.

Q2: Why use p=0.5 as default?
A: p=0.5 gives the most conservative (largest) sample size estimate when the true proportion is unknown.

Q3: How does margin of error affect sample size?
A: Smaller margins require dramatically larger samples (n ∝ 1/e²).

Q4: Is this for continuous or binary metrics?
A: This formula is for binary outcomes (conversion rates). Continuous metrics require different formulas.

Q5: Should I adjust for multiple comparisons?
A: Yes, if testing multiple variants simultaneously, consider Bonferroni or other corrections.

AB Test Calculator Sample Size© - All Rights Reserved 2025