Sample Size for Comparing Two Proportions Calculator

Sample Size for Comparing Two Proportions Calculator

Plan two independent proportion groups with expected rates, alpha, power, allocation ratio, and dropout inflation.

📌Study Presets
🔢Inputs

Usually the control, baseline, or current process rate.

Usually the treatment, variant, or improved process rate.

Two-sided uses z alpha/2, matching most comparative protocols.

Use 1 for equal groups, 2 for twice as many in group 2.

Enrollment is inflated after the analyzed sample size is computed.

Separate rounding is conservative; pair rounding keeps ratios tidier.

Group 1 analyzed
-
participants with outcome data
Group 2 analyzed
-
participants with outcome data
Total enrollment
-
after dropout allowance
Absolute difference
-
percentage points
🧮Formula Breakdown
Equal groupsn per group = [zalpha/2×sqrt(2×pbar×(1-pbar)) + zbeta×sqrt(p1×(1-p1)+p2×(1-p2))]2 / (p1-p2)2.
Allocation ratioFor r = n2/n1, n1 = [z×sqrt((1+1/r)×pbar×(1-pbar)) + zbeta×sqrt(p1×(1-p1)+p2×(1-p2)/r)]2 / d2, then n2 = r×n1.
Pooled planning ratepbar = (p1 + r×p2) / (1 + r). When r = 1 this becomes the simple average of p1 and p2.
Dropout inflationEnroll n = analyzed n / (1 - dropout). The calculator rounds upward because partial participants cannot be enrolled.
The live substitution appears after calculation.
📋Current Planning Grid
1.960
z alpha term
0.842
z beta term
45.0%
pooled pbar
1.00
n2 / n1 ratio
📐Z Value Reference
Planning choiceProbability statementz valueSample-size effect
90% confidence, two-sidedalpha = 0.10, alpha/2 = 0.051.6449Smallest common two-sided setting
95% confidence, two-sidedalpha = 0.05, alpha/2 = 0.0251.9600Most common default
99% confidence, two-sidedalpha = 0.01, alpha/2 = 0.0052.5758Substantially larger n
80% powerbeta = 0.200.8416Common planning minimum
90% powerbeta = 0.101.2816Stronger study planning
95% powerbeta = 0.051.6449Large-sample demanding
🔍Common Difference Lookup
Scenariop1p2DifferenceApprox equal n at 95% and 80%
Very small conversion lift5%6%1 pointAbout 8,150 per group
Small conversion lift10%12%2 pointsAbout 3,840 per group
Moderate process change20%25%5 pointsAbout 1,090 per group
Balanced response gap40%50%10 pointsAbout 388 per group
High baseline improvement70%78%8 pointsAbout 471 per group
Rare adverse event screen1%0.5%0.5 pointAbout 4,670 per group
Allocation Ratio Impact
Ratio n2/n1Group 1 analyzedGroup 2 analyzedTotal analyzedComparison note
0.50Calculates liveCalculates liveCalculates liveUseful when group 2 is scarce
1.00Calculates liveCalculates liveCalculates liveEfficiency baseline
2.00Calculates liveCalculates liveCalculates liveMore group 2 outcome data
3.00Calculates liveCalculates liveCalculates liveLarger total sample expected
🗂Preset Comparison Grid
Presetp1p2AlphaPowerRatioDropoutTypical use
A/B signup lift12%14%5%80%1:15%Digital experiment
Clinical response40%52%5%90%1:112%Trial protocol
Defect reduction8%5%5%80%1:13%Quality audit
Vaccine uptake55%65%5%90%1.5:18%Community program
Churn retention18%15%5%80%1:110%Retention test
School pass rate72%80%5%85%1:16%Education outcome
Rare event safety1%0.5%5%80%2:15%Safety monitoring
Small margin screen48%52%5%90%1:110%Fine difference
2:1 recruitment30%38%5%80%2:115%Unequal enrollment
💡Planning Tips
Use an honest effect size: Sample size rises with the square of the inverse difference, so cutting a planned 10-point gap to 5 points can require roughly four times as many analyzed participants.
Check allocation before recruiting: Unequal allocation can be practical, but it usually raises the total sample. Use it when one group is scarce, more safety data are needed, or the design has a real operating reason.

I have a hunch my new web design is doing better then the old one. I feel that my new email subject lines are cutting down on the deletes. It’s intuitive, but the boardroom requires more than intuition. It requires a specific number of people to test, at which point you can stop guessing.

Sample size calculation do exactly this. They bridge the gap between your optimistic guess and a statistically significant result. The calculator does all the heavy lifting for you, but knowing what drives the calculation will prevent you from running a study with three thousand people when three hundred will do.

How to Find the Right Number of People for Your Study

When you compare two proportions, it’s all about the difference: Your expected improvement minus what you already have. That’s effect size. Suppose you’re currently signing up 10% of shoppers; you’d like to sign up 12%. The gap is only two points. Small differences in rates require large samples, because they’re easy to miss amid the normal variations in human behavior.

A ten-point improvement? That drastically reduces the sample size. Instead, you are measuring delta itself. Most people underestimate this point: As your delta shrinks, your sample size balloons, and it’s not even remotely linear. Doubling your existing rate will not halve your sample size (it’ll decrease by less than half). In fact, if you want to cut your delta in half, you’ll typically need to quadruple your sample size.

Next comes: how confident do you need to be? That’s a question about the balance of power and alpha. Alpha is your willingness to accept a false positive, meaning you say there is a difference where none actualy exists. The standard default across industries are a five percent error rate, which means you are willing to take a 1-in-20 risk of being incorrect.

On the other hand, you have your power, or how likely it is that you will find a difference when there really is one. Common levels are 80 percent, though it is safer to go up to 90 percent if missing out on something is costly. Lowering alpha and increasing power both increase the sample size (because you’re buying certainty from participants).

It’s always a tradeoff between the cost of a more lengthy study vs. There is a potential risk of concluding incorrectly.

In real world studies, there is no clean data. Surveys aren’t answered, links are broken, people drop out. To account for this, the tool has a dropout inflation setting. For example, if you think you’ll require one-hundred surveyed responses per group, yet expect ten percent attrition, then you can’t simply recruit one-hundred. You must enroll more because the calculator will inflate your enrollment target so that you can reach your studied number despite inevitable losses.

It’s a classic mistake to ignore this step, it makes studies underpowered when they’re most in need of being robust.

A second lever to pull is allocation ratios. Statistically speaking, equal groups is most powerful (for any given total number of samples), so they are statistically efficient. But practically speaking, you may not be able to recruit equally. Perhaps the control group want extra safety data, or perhaps the treatment is difficult to source. This isn’t an issue: unequal allocation does work.

As the ratio moves further from one-to-one, however, the total sample size increase. Efficiency gives way to practicality. It’s a little thing, but when each participant represents time or money, it does matter.

You can see how this changes by industry with the presets on the page. For an A/B test of a landing page, you may be willing to accept lower power, or more alpha, if it means getting results quicker. For a clinical trial, you’d need very strict alpha levels. You would also probably want a lot of people enrolled so the study could be huge.

It doesn’t mean there’s one right answer. There’s just whatever answer fits your resources and risk tolerance. When you input your constraints and how fast you want to work, the equation will give you clear answers.

Exactly how many people should you shoot for? You don’t guess anymore. You plan. And the numbers help you understand where you’re going, and how to get there.

Sample Size for Comparing Two Proportions Calculator