Sample Size Calculator Conversion Rate

Sample Size Calculator for Conversion Rate

Calculate the visitors needed for statistically significant A/B test results.

Your current conversion rate.
Relative lift you want to detect.
90% 95% 99%
80% 90%
Required Sample Size Per Variation:
0
Total Visitors (Control + Treatment):
0

Understanding Sample Size for Conversion Rates

In A/B testing, determining the correct sample size is crucial to ensure that your results are not due to random chance. This calculator helps you define how many visitors you need to run through each version of your page to reach a statistically sound conclusion.

Key Components:

  • Baseline Conversion Rate: Your current conversion rate for the goal you are measuring (e.g., 5%).
  • Minimum Detectable Effect (MDE): The smallest relative change in conversion rate you want to detect. A smaller MDE requires a significantly larger sample size.
  • Statistical Significance: The probability that the difference in conversion is not due to random chance (95% is industry standard).
  • Statistical Power: The probability of detecting an effect if there is one (80% is standard).

Practical Example:

Suppose your current landing page converts at 3% (Baseline CR). You want to see if a new design can improve this by at least 15% (MDE). With a 95% confidence level and 80% power, this calculator will tell you exactly how many visitors are needed for both the control and the treatment group to validate that the 15% lift is real.

function calculateSampleSize() { var baselineRate = parseFloat(document.getElementById('baseline_cr').value) / 100; var relativeMde = parseFloat(document.getElementById('mde').value) / 100; var zAlpha = parseFloat(document.getElementById('confidence').value); var zBeta = parseFloat(document.getElementById('power').value); if (isNaN(baselineRate) || isNaN(relativeMde) || baselineRate <= 0 || relativeMde <= 0) { alert("Please enter valid positive numbers for the baseline and MDE."); return; } // p1 = baseline, p2 = baseline + improvement var p1 = baselineRate; var p2 = p1 * (1 + relativeMde); // Variance calculation var variance1 = p1 * (1 – p1); var variance2 = p2 * (1 – p2); // Delta (absolute difference) var delta = Math.abs(p2 – p1); // Standard Formula: n = (Z_alpha/2 + Z_beta)^2 * [p1(1-p1) + p2(1-p2)] / (p1-p2)^2 var n = Math.pow((zAlpha + zBeta), 2) * (variance1 + variance2) / Math.pow(delta, 2); // Final results var perVariation = Math.ceil(n); var totalSample = perVariation * 2; // Update UI document.getElementById('per-variation').innerText = perVariation.toLocaleString(); document.getElementById('total-sample').innerText = totalSample.toLocaleString(); document.getElementById('result-box').style.display = 'block'; }

Leave a Comment