AI Tools Free

Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC)

Compute the exact per-group (`n_1`, `n_2`) and total (`N`) sample size required to detect a difference between two independent proportions (`p_1` vs. `p_2`), including pooled normal approximation, Fleiss continuity correction, and Cohen's `h` effect size.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Calculate Required Sample Size.

Enter the control or baseline event probability as a decimal between 0 and 1 (e.g. 0.10 for a 10% conversion or incidence rate).

Enter the expected treatment or variant probability as a decimal between 0 and 1 (e.g. 0.15 for 15%).

Probability of a Type I error (false positive).

Probability of detecting a true difference |p2 - p1| (1 - Type II error).

Use k = 1 for equal 50/50 split (n1 = n2), or k > 1 when placing more subjects in Group 2.

Two-sided testing is standard for clinical trials and product A/B experiments.

Your result
Enter your details

Result will appear here

How the Two-Proportion Sample Size Calculator Works

Comparing two independent binomial proportions requires accounting for both the null pooled variance p_bar * (1 - p_bar) and the alternative unpooled variance p_1(1 - p_1) + p_2(1 - p_2)/k.

p_bar = (p_1 + k * p_2) / (1 + k); n_1 = [z_{alpha} * sqrt((1 + 1/k) * p_bar * (1 - p_bar)) + z_{beta} * sqrt(p_1(1 - p_1) + p_2(1 - p_2)/k)]^2 / (p_2 - p_1)^2.

For continuous outcomes (means and standard deviations), switch to our Sample Size Calculator for Means (/tools/sample-size-calculator-for-means).

Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC) workflow overview
Workflow overview for Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC).

Two-Proportion Sample Size Benchmarks (`alpha = 0.05`, Two-Sided, `k = 1`)

Required sample size per group (`n_1 = n_2`) and total `N` at 80% and 90% power across common clinical and A/B testing scenarios.

Baseline `p_1` vs. Target `p_2`Absolute / Relative Lift80% Power (`n` per group / Total `N`)80% Power with Fleiss CC (`n_cc` / `N_cc`)
`0.10` vs. `0.15` (Default)`+5.0%` abs (`+50%` rel, `h = 0.152`)`686` per arm (`1,372` total)`725` per arm (`1,450` total)
`0.05` vs. `0.10` (Low-rate conversion)`+5.0%` abs (`+100%` rel, `h = 0.193`)`435` per arm (`870` total)`474` per arm (`948` total)
`0.20` vs. `0.30` (10-point lift)`+10.0%` abs (`+50%` rel, `h = 0.232`)`294` per arm (`588` total)`313` per arm (`626` total)
`0.50` vs. `0.60` (Max-variance region)`+10.0%` abs (`+20%` rel, `h = 0.201`)`388` per arm (`776` total)`408` per arm (`816` total)

How to Plan a Two-Proportion Study or A/B Test in 3 Steps

Size your clinical trial or conversion experiment before collecting data.

Enter baseline proportion p1 and minimum detectable target p2

Input your control group rate p1 (e.g., 0.10 for 10%) and the smallest target rate p2 worth detecting (e.g., 0.15 for 15%).

Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC) step 1: Enter baseline proportion p1 and minimum detectable target p2
Step 1 workflow overview for Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC).

Set significance alpha, statistical power (1 - beta), and allocation ratio k

Choose alpha = 0.05 (two-sided) and 80% or 90% power, with k = 1 for an equal 50/50 split between control and treatment.

Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC) step 2: Set significance alpha, statistical power (1 - beta), and allocation ratio k
Step 2 workflow overview for Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC).

Compare unadjusted vs. Fleiss continuity-corrected sample sizes

Use the unadjusted N when analyzing with a standard two-proportion Z-test, or use the Fleiss continuity-corrected N_cc when analyzing with Fisher's exact test or Yates's chi-square.

Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC) step 3: Compare unadjusted vs. Fleiss continuity-corrected sample sizes
Step 3 workflow overview for Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC).

Worked Two-Proportion Sample Size Examples

See how baseline rates, minimum detectable effects, and unequal allocation change required N.

Baseline example

Free sample size calculator for comparing two independent proportions (p1 vs. p2). Compute unadjusted and Fleiss continuity-corrected n1, n2, total N, and Cohen's h.

Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC) example 1: Baseline example
Worked example 1 for Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC).

Comparison scenario

p_bar = (p_1 + k * p_2) / (1 + k); n_1 = [z_{alpha} * sqrt((1 + 1/k) * p_bar * (1 - p_bar)) + z_{beta} * sqrt(p_1(1 - p_1) + p_2(1 - p_2)/k)]^2 / (p_2 - p_1)^2.

Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC) example 2: Comparison scenario
Worked example 2 for Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC).

Boundary check before exporting

For continuous outcomes (means and standard deviations), switch to our Sample Size Calculator for Means (/tools/sample-size-calculator-for-means).

Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC) example 3: Boundary check before exporting
Worked example 3 for Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC).

How to Interpret Unadjusted N, Fleiss CC, and Cohen's h

Keep these three statistical rules in mind when budgeting traffic or patient recruitment.

First, sample size scales inversely with the square of the absolute difference (p_2 - p_1)^2. Halving your minimum detectable lift from 5 percentage points to 2.5 percentage points quadruples the required sample size.

Second, always inflate your final recruitment target by 1 / (1 - dropout_rate) if you expect subject attrition or incomplete follow-up.

How to interpret Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC) results
Result interpretation guide for Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC).

Study Design Guardrails & Related Calculators

Verify independence and test alignment before locking your protocol.

1. Independent Observations: Both formulas assume independent Bernoulli trials; cluster-randomized or repeated-measures designs require multiplying N by the Design Effect DEFF = 1 + (m - 1) * ICC.

2. Match Analysis to Sizing: If you size your study using the unadjusted normal formula, analyze it with the unadjusted two-proportion Z-test or Pearson chi-square test.

Scope limits and assumptions for Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC)
Assumptions and input boundaries for Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC).

Frequently Asked Questions About Two-Proportion Sample Size

Answers about using Sample Size Calculator for Two Proportions (A/B Test & Fleiss CC) and understanding its results.

What is the difference between the unadjusted sample size and Fleiss continuity-corrected sample size?

The unadjusted normal formula aligns with the uncorrected Pearson chi-square or two-proportion Z-test. The Fleiss (1981) continuity correction inflates n1 and n2 slightly so your study achieves full nominal power when analyzed with Yates's continuity-corrected chi-square or Fisher's exact test.

Why does detecting a 5% lift near p = 0.50 require more samples than near p = 0.05?

The binomial variance p(1 - p) reaches its maximum at p = 0.50 (0.50 * 0.50 = 0.25) and shrinks near 0 or 1 (at p = 0.05, 0.05 * 0.95 = 0.0475). Higher variance around 50% requires a larger denominator to separate signal from noise.

What is Cohen's h effect size for two proportions?

Cohen's h = 2 * arcsin(sqrt(p_2)) - 2 * arcsin(sqrt(p_1)) stabilizes binomial variance across the [0, 1] scale. Values around |h| = 0.20, 0.50, and 0.80 represent small, medium, and large proportion differences.

When should I use this tool vs. the Sample Size Calculator for Means?

Use this calculator when your primary outcome is binary (yes/no, converted/not converted, cured/relapsed). When your outcome is a continuous measurement with a mean and standard deviation, use our Sample Size Calculator for Means (/tools/sample-size-calculator-for-means).

Try your own values

Choose another tool for your next calculation, conversion, or text task.

Calculate Required Sample Size