Free tool · Sample size · Binary outcomeUpdated October 9, 2026

Two-proportions sample size calculator with pooled variance and continuity correction

Responder rates, event rates, cure rates: enter the control rate and either the treatment rate, a relative risk or an odds ratio. See how the choice of formula changes n, and get enrolment after dropout.

  • Pooled, Wald and Fleiss-Tytun-Ury
  • Enter p2, relative risk or odds ratio
  • Unequal allocation and dropout

Free sandbox · No credit card · 21 CFR Part 11 aligned

Demo: responders 30% vs 50%, two-sided alpha 0.05, 80% power

Pooled, per group

93

With continuity correction

103

Enrol per group (10% dropout)

104

Wald (unpooled)91/110

91 per group

Pooled variance93/110

93 per group

Wald + continuity correction101/110

101 per group

Pooled + continuity correction103/110

103 per group

Four defensible formulas, a 13% spread. Pick the one that matches the planned test, and say which.

What this calculator does

  • For a superiority comparison of two independent proportions, the pooled-variance formula is n₁ = [z₁₋α/2 √((1 + 1/k) p̄ q̄) + z₁₋β √(p₁q₁ + p₂q₂/k)]² / (p₂ − p₁)², with p̄ = (p₁ + k p₂)/(1 + k).
  • Worked example: 30% vs 50% responders, two-sided alpha 0.05, 80% power: 93 per group (186 in total), matching R's power.prop.test. Add 10% dropout and enrol 104 per group.
  • The formula you choose matters: the unpooled Wald version gives 91, and the Fleiss-Tytun-Ury continuity correction raises the pooled answer to 103. Match the formula to the planned test.
  • You can enter the treatment effect as a relative risk or odds ratio; the tool converts it to p₂ and shows all three effect measures so the protocol quotes them consistently.
  • Rare events are expensive: halving a 10% event rate (RR 0.5) needs 435 per group, but a 30% reduction (RR 0.7) needs 1,356.

Free tool

Calculate a two-proportions sample size

Enter the control rate, then describe the effect as a treatment rate, a relative risk or an odds ratio. Choose the variance method and whether to apply a continuity correction. It runs in your browser; nothing is saved or sent.

%
Describe the treatment effect as
%
%
Test
Variance under H₀
Continuity correction
Group 1
93
Group 2
93
Total
186
evaluable

Enrol 104 + 104 = 208 with 10% dropout. Power at these sizes: 80.0%.

p₁ = 30.0%, p₂ = 50.0%. Risk difference 20.0 points, relative risk 1.67, odds ratio 2.33.

n₁ = [z₁₋α/2 √((1+1/k) p̄q̄) + z₁₋β √(p₁q₁ + p₂q₂/k)]² / (p₂ − p₁)² with z = 1.960, 0.842 = 93.0

Planning aid and reference only, not validated software. Normal approximation for a two-group comparison of independent proportions. The pooled option matches the uncorrected chi-square (z) test and R's power.prop.test; the Wald option is the simpler formula many online calculators use and gives a smaller n. The continuity correction follows Fleiss, Tytun and Ury (1980) and suits a Yates-corrected or Fisher analysis. With very small or very large rates, or expected counts under 5, use an exact method or simulation.

The formulas

Pooled, unpooled and corrected: which one to use

A binary endpoint is a count of participants with the outcome in each arm: responders at week 12, relapses by one year, infections within 30 days. The comparison is p₂ against p₁, and the sample size depends on three things: how far apart the true rates are, how variable a proportion is (variance p(1 − p), largest at 50%), and the alpha and power you require.

There are two standard variance choices. The pooled formula uses the average rate p̄ for the variance under the null hypothesis, as the usual chi-square (z) test does, and the separate rates for the variance under the alternative. It is what R's power.prop.test and most software compute. With 30% vs 50% it gives 93.0, so 93 per group. The unpooled (Wald) formula, (z₁₋α/2 + z₁₋β)² (p₁q₁ + p₂q₂) / (p₂ − p₁)², uses the separate rates throughout. It is simpler, appears in many web calculators, and gives 91 here. The difference is small for moderate rates and grows as the rates move apart or allocation becomes unequal.

The continuity correction of Fleiss, Tytun and Ury (1980), n′ = (n/4) [1 + √(1 + 2(k + 1)/(n k |p₂ − p₁|))]², adjusts for the fact that counts are discrete. It is appropriate when the planned analysis is a Yates-corrected chi-square or Fisher's exact test, because those tests are conservative and need more participants to reach the same power. In the example it raises 93 to 103. If the SAP specifies the uncorrected test, using the corrected n is just extra cost; if it specifies Fisher's exact test, the uncorrected n gives less power than you think. Fisher's exact test is more conservative still, so for small n verify power by simulation.

Entering a relative risk or odds ratio

Protocols often quote the effect as a ratio. With a control rate p₁, a relative risk RR gives p₂ = RR x p₁, and an odds ratio OR gives p₂ = OR p₁ / (1 − p₁ + OR p₁). A control rate of 30% with an odds ratio of 2.33 is 50%; the same 20-point difference is a relative risk of 1.67. The calculator shows the risk difference, relative risk and odds ratio together because the sample size depends on the rates, not on which scale you choose to report. Pick the scale that the primary analysis will use, and keep the others consistent in the text.

Unequal allocation and dropout

With a 2:1 allocation the pooled example needs 71 and 142 participants, 213 in total, against 186 for 1:1. As in any trial, the evaluable numbers are inflated for dropout by dividing by (1 − dropout); see the dropout-adjusted sample size calculator. For a binary endpoint, consider how a dropout will be counted: if missing outcomes are imputed as non-responders, dropout does not reduce the number of evaluable participants but does lower the response rate you should assume.

Sensitivity

Participants per group by control rate and relative risk

Event rate falling in the treatment arm, pooled variance, two-sided alpha 0.05, 80% power, 1:1, no continuity correction, rounded up.

Control event rateRR 0.5RR 0.6RR 0.7RR 0.8
10%4357211,3563,213
20%1993296151,447
30%121198367859
50%5893170388

Illustrative values from the formula. A smaller relative effect on a rarer event is the most expensive combination.

Assumptions

What the calculation assumes about your trial

The result rests on a normal approximation to the binomial, and on a handful of statements you should be able to defend in the protocol.

The assumptions

Check each of these against your design:

  • Two independent groups, and each participant counted once. Repeated events per person, or participants clustered within sites or families, need a design effect.
  • A well-defined, pre-specified responder definition, so that the rate you take from the literature means the same thing as the one you will measure. A response defined as a 50% reduction on a score is not interchangeable with one defined as 30%.
  • Rates away from 0% and 100% and expected counts of at least 5 in each cell. Otherwise the normal approximation is poor and exact methods or simulation are safer.
  • The control rate is realistic for your population and period. Control rates drift, and an optimistic control rate in a placebo-controlled study is the commonest reason event-driven and responder trials are underpowered.
  • The planned test is the one the formula was derived for (pooled z test, corrected test, or Fisher exact test).
Primary endpoint form (demo)
Demo subject 004-0021 · Visit 5 (Week 12)Draft entry

Responder assessment

Symptom score at baseline

SCBL
24points

Symptom score at week 12

SCW12
11points

Percent reduction from baseline

PCHG

Calculated, read-only

54.2% Calculated

Responder (reduction of 50% or more)

RESP
YesNo
The responder definition the sample size assumed is the one the form computes.

Common mistakes

Where two-proportions sample sizes go wrong

The arithmetic is easy, so the mistakes sit in the inputs and in the match between calculation and analysis.

Mixing up absolute and relative effect

A "25% improvement" can mean a rise from 40% to 50% (a relative increase of 25%) or from 40% to 65% (25 points). The two differ by a factor of about 6 in sample size, because the first example detects a 10-point difference and the second a 25-point one. Write the control rate and treatment rate explicitly in the protocol, along with the risk difference.

Using the observed effect from a small trial

Effects from small or exploratory trials are, on average, overestimated. Planning a Phase 3 trial around a Phase 2 point estimate often leaves it underpowered. Use a smaller effect than the best estimate, or the lower end of its interval, and read the sensitivity table above before you commit. If the number then looks unaffordable, the power analysis calculator shows what a smaller trial can honestly detect.

Using the formula for a non-inferiority question

These formulas test for any difference. If the aim is to show a new treatment is not worse than a control by more than a margin, the null hypothesis, alpha and denominator all change; use the non-inferiority sample size calculator. If the aim is to show two treatments are the same within limits, use the equivalence trial sample size calculator.

Capture the endpoint exactly as the sample size defined it

Build the eCRFs, visit schedule and randomization in the free sandbox with every feature. No credit card. You pay only when you go live.

Build your study free

From the number to the protocol

How this feeds the protocol, the SAP and the study build

A protocol sentence that carries the full justification reads: "With 93 participants per group (186 evaluable), the study has 80% power to detect an increase in week-12 responder rate from 30% to 50% (risk difference 20 points, odds ratio 2.33) using a two-sided chi-square test at the 5% level. Allowing for 10% dropout, 208 participants (104 per group) will be randomized." That sentence names the endpoint, both rates, the effect on each scale, the test and the inflation, which is what a reviewer looks for. The how to write a clinical trial protocol guide shows where it sits, and the clinical trial endpoints entry covers how to define the endpoint it depends on.

In Capture, the responder definition is a build decision. A calculated field can derive the percent reduction from two entered scores and show it read-only, a single-choice field can hold the responder flag, and a range or custom edit check raises an auto-query when the two disagree, so the analysis dataset does not depend on a spreadsheet formula. Randomization can follow the allocation ratio you planned, blinded roles never receive treatment-arm values, and the monitoring dashboard shows enrolment against the target. Exports come as CSV or Excel with a data dictionary, or as SDTM datasets (SAS XPT with Define-XML), and every change to a value carries its audit-trail reason. The quick clinical trial sample size calculator covers the simplest unpooled case on one screen; this page is for when you need to choose and justify the formula. For continuous endpoints use the two-means calculator, and for event-driven designs the survival sample size calculator.

Which formula for which planned analysis
PooledWaldCorrected
Chi-square / z test, no correction
Yates-corrected chi-square
Fisher exact test
Confidence interval for risk difference
Where two formulas apply, plan on the more conservative one.

Before you lock it

Two-proportions sample size checklist

Responder or event defined

Exact definition, time point and handling of missing outcomes written down.

Both rates stated

Control rate with a source; treatment rate or the smallest effect worth detecting.

Effect on three scales

Risk difference, relative risk and odds ratio, quoted consistently.

Formula matches the test

Pooled for the uncorrected z test, corrected for Yates or Fisher.

Sensitivity run

Control rate and effect varied by a plausible amount, and the cost seen.

Dropout converted

Enrolment = evaluable / (1 - dropout), rounded up.

FAQ

Questions teams ask before they switch

Something not covered here? Ask us directly.

What is the sample size formula for two proportions?

The pooled version is n₁ = [z₁₋α/2 √((1 + 1/k) p̄ q̄) + z₁₋β √(p₁q₁ + p₂q₂/k)]² / (p₂ − p₁)², where k = n₂/n₁ and p̄ = (p₁ + k p₂)/(1 + k). The unpooled version is (z₁₋α/2 + z₁₋β)² (p₁q₁ + p₂q₂/k) / (p₂ − p₁)².

Why do different calculators give different answers for the same rates?

They use different variance assumptions (pooled or unpooled), different continuity corrections, or an exact method. For 30% vs 50% at 80% power the answers range from 91 to 103 per group. Check which formula a calculator uses and match it to the planned analysis.

Should I use the continuity correction?

Use it when the planned test is a Yates-corrected chi-square or Fisher exact test, which are conservative. If the SAP specifies the uncorrected chi-square or z test, the uncorrected pooled formula is the matching one.

Can I enter an odds ratio or relative risk instead of the treatment rate?

Yes. Enter the control rate and choose relative risk or odds ratio; the tool computes p₂ (RR x p₁, or OR p₁ / (1 − p₁ + OR p₁)) and shows the equivalent effect on all three scales.

What if my event rate is very low?

The normal approximation is poor when expected counts per cell are below about 5. Consider an exact test, an event-driven design, or simulation, and confirm the plan with a statistician.

How do I handle unequal group sizes?

Set the allocation ratio n₂/n₁. A 2:1 design in the 30% vs 50% example needs 71 and 142 participants (213 in total) versus 186 for 1:1. Justify the ratio in the protocol.

Does this account for dropout?

Yes, as a separate step: enrolment is the evaluable number divided by (1 - dropout), rounded up. If missing outcomes will be imputed as failures, think about whether the response rate should be lowered instead.

Is this calculator validated?

No. It is a free planning aid that reproduces published reference values such as R's power.prop.test. A statistician should confirm the final sample size.

Build the responder definition into the study

Calculated fields, edit checks and randomization in a free sandbox. No credit card. You pay only when you go live.

Build your study free