{
    "name": "A/B Test Sample Size Calculator",
    "url": "https://calculators.geekmidst.com/calculators/ab-test-sample-size-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/ab-test-sample-size-calculator.md",
    "category": "Statistics & probability",
    "description": "Find how many visitors each variant needs to detect a chosen lift in conversion rate at your significance level and power, one- or two-sided.",
    "summary": "Set the current conversion rate, the smallest lift worth detecting, α and power, and get the visitors needed per variant before you start the test.",
    "also_called": [
        "Split test sample size calculator"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "baseline",
            "label": "Baseline conversion rate",
            "type": "number",
            "default": "10",
            "unit": "%"
        },
        {
            "name": "mde",
            "label": "Minimum detectable effect",
            "type": "number",
            "default": "2"
        },
        {
            "name": "mde_type",
            "label": "Effect is",
            "type": "segmented",
            "default": "absolute",
            "options": {
                "absolute": "Absolute (points)",
                "relative": "Relative (%)"
            }
        },
        {
            "name": "alpha",
            "label": "Significance level α",
            "type": "number",
            "default": "5",
            "unit": "%"
        },
        {
            "name": "power",
            "label": "Power",
            "type": "number",
            "default": "80",
            "unit": "%"
        },
        {
            "name": "sides",
            "label": "Test",
            "type": "segmented",
            "default": "two",
            "options": {
                "two": "Two-sided",
                "one": "One-sided"
            }
        }
    ],
    "outputs": [
        {
            "key": "n_per_group",
            "label": "Visitors per variant",
            "format": "integer"
        },
        {
            "key": "total",
            "label": "Total visitors (2 variants)",
            "format": "integer"
        },
        {
            "key": "target_rate",
            "label": "Rate you want to detect",
            "format": "percent"
        },
        {
            "key": "absolute_effect",
            "label": "Absolute effect (points)",
            "format": "percent"
        },
        {
            "key": "unrounded",
            "label": "Exact value before rounding up",
            "format": "number"
        }
    ],
    "formula": {
        "text": "n = (z_α √(2p̄(1 − p̄)) + z_β √(p₁(1 − p₁) + p₂(1 − p₂)))² ÷ (p₂ − p₁)²,  p̄ = (p₁ + p₂) ÷ 2;  round up",
        "variables": {
            "p₁": "baseline rate",
            "p₂": "baseline plus the minimum detectable effect",
            "z_α": "z₁₋α/₂ (two-sided) or z₁₋α (one-sided)",
            "z_β": "normal quantile of the power"
        }
    },
    "worked_example": {
        "inputs": {
            "baseline": "10",
            "mde": "2",
            "mde_type": "absolute",
            "alpha": "5",
            "power": "80",
            "sides": "two"
        },
        "steps": [
            "p₁ = 0.10, p₂ = 0.12, p̄ = 0.11; z_α = 1.96, z_β = 0.8416.",
            "Numerator: (1.96 × √(2 × 0.11 × 0.89) + 0.8416 × √(0.09 + 0.1056))² = 1.53634.",
            "n = 1.53634 ÷ 0.02² = 3840.85 → 3,841 per variant."
        ],
        "result": "Detecting a lift from 10% to 12% needs 3,841 visitors per variant, 7,682 in total."
    },
    "interpretation": "Divide the total by your daily eligible traffic to estimate the test duration, and run whole weeks to average out weekday effects. If the duration is impractical, test a bolder change with a larger effect.",
    "assumptions": [
        "Equal traffic split and the pooled two-proportion z-test; matches R’s power.prop.test."
    ],
    "limitations": [
        "Assumes you look at the result once, at the planned sample size.",
        "Not for revenue or other continuous metrics, which need their variance."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "Relative or absolute effect?",
            "answer": "A 20% relative lift on a 10% baseline is the same as a 2-point absolute lift: both target 12%."
        },
        {
            "question": "Why does a low baseline need so many visitors?",
            "answer": "Rare events carry little information each, and small absolute differences need large samples: required n grows with 1 ÷ (effect)²."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "A/B Test Significance Calculator",
            "url": "https://calculators.geekmidst.com/calculators/ab-test-conversion-significance-calculator"
        },
        {
            "name": "Statistical Power Calculator",
            "url": "https://calculators.geekmidst.com/calculators/statistical-power-approximation-calculator"
        },
        {
            "name": "Sample Size Calculator",
            "url": "https://calculators.geekmidst.com/calculators/sample-size-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}