Sample Size for Two Proportions:
Formula and Example
Sample size for two proportions estimates how many observations are needed in each group to compare two binary-outcome rates, such as recovery, readmission or treatment response. It requires the two anticipated proportions, a significance level, desired power and allocation ratio. The right method also depends on the planned test and whether the data are independent (Fleiss et al., 2003; Machin et al., 2009).

When should you use a two-proportions calculation?
Use it when each participant has a binary outcome and two independent groups will be compared. For instance, you may plan to compare the proportion of patients meeting a prespecified recovery criterion between intervention and control arms.
Do not use this independent-group formula for matched case-control pairs, repeated binary outcomes, clustered participants, non-inferiority designs or very rare outcomes without considering the corresponding design-specific methodology (Fleiss et al., 2003; Chow et al., 2017).
Define the effect before using the formula
You will need a baseline proportion p₁, an anticipated comparison proportion p₂, and the difference Δ = p₂ − p₁. For a clinical study, define whether an absolute risk difference, risk ratio or odds ratio is the scientific target. A sample-size method for a risk difference is not automatically interchangeable with one for an odds ratio, even when the underlying event rates can be translated (Fleiss et al., 2003).
Sample size for two proportions: a normal-approximation formula
For independent, equal-sized groups using a two-sided significance test:
Here, n is the approximate analyzable number per group, p̄ = (p₁ + p₂)/2, α is the type I error rate, and 1 − β is power. This is one uncorrected normal-approximation approach; a score-based, continuity-corrected, exact or simulation method may yield a different answer (Fleiss et al., 2003; Machin et al., 2009).
Suppose the anticipated outcome rate is 30% in the control group and 45% in the intervention group. The target absolute difference is 15 percentage points.
- Set p₁ = 0.30, p₂ = 0.45 and p̄ = 0.375.
- Set two-sided α = .05 and power = .80; the normal quantiles are approximately 1.960 and 0.842.
- Insert these values into the formula above.
- The result is approximately 162.33, so round up to 163 analyzable participants per group (326 total).
Because this is an approximation, a calculation targeting a specific exact or continuity-corrected test may require a larger or different n. For 15% anticipated missing outcomes, simple recruitment inflation yields ceil(163 / 0.85) = 192 people per arm, subject to the validity of that assumption.
Example in R
The formula and R’s built-in function return the same value for these hypothetical inputs, about 162.3 before rounding up.
# Hypothetical inputs: proportions, not percentages
p1 <- 0.30; p2 <- 0.45
alpha <- 0.05; target_power <- 0.80
# Formula above (normal approximation, equal groups)
pbar <- (p1 + p2) / 2
n <- (qnorm(1 - alpha / 2) * sqrt(2 * pbar * (1 - pbar)) +
qnorm(target_power) * sqrt(p1 * (1 - p1) + p2 * (1 - p2)))^2 /
(p2 - p1)^2
ceiling(n) # analyzable participants per group
# Built-in check with the same inputs
power.prop.test(p1 = p1, p2 = p2, sig.level = alpha, power = target_power)
# Recruitment target if 15% of primary outcomes will be missing
ceiling(ceiling(n) / 0.85)
Where do the two proportions come from?
The baseline estimate may be obtained from a comparable cohort, published trial or registry. The assumed difference should represent a plausible and meaningful change rather than an optimistic effect chosen to reduce recruitment. When evidence is weak, present alternative scenarios showing the implications of smaller and larger differences (Lakens, 2022).
A baseline of 5% versus 10% is not the same design problem as 40% versus 45%, although both differ by five percentage points. The underlying variances p(1 − p) differ, as does the expected information available for estimating event risks.
What about unequal allocation or clustered samples?
Unequal allocation changes the variance of the group comparison and usually increases the total sample needed compared with equally sized groups for a fixed absolute difference and common per-participant cost. Matched or cluster-randomized studies require methods reflecting dependence between observations (Fleiss et al., 2003; Chow et al., 2017).
Reporting template
The primary binary outcome was [definition] assessed at [time point]. The calculation assumed outcome proportions of [p₁] and [p₂] in the two groups, a difference of [Δ], two-sided α = [value], power = [value] and allocation [ratio]. Using [specified method/software], [n] analyzable participants were required in each group. The recruitment target was inflated to [N] to allow for [assumed incomplete primary outcome data].
Common errors
- Substituting a relative difference for an absolute difference in the denominator.
- Supplying percentages as 30 and 45 instead of proportions 0.30 and 0.45.
- Applying a 1:1 calculation to a 2:1 study.
- Assuming a chi-square, exact Fisher and continuity-corrected test always produce identical sample sizes.
- Treating the assumed outcome rates as confirmed facts about the new population.
Frequently asked questions
Is a two-proportions formula the same as a chi-square calculation?
Both may target the same two-by-two comparison, but the result depends on the precise test, approximation, alternative hypothesis and correction used. State which approach was selected (Fleiss et al., 2003).
Can I use it for pre-post proportions in the same patients?
No. Matched binary outcomes depend on discordant pairs and are commonly analyzed using McNemar-type methods; the independent-groups variance structure is inappropriate (Fleiss et al., 2003).
What if the outcome is very rare?
Consider a rare-event or exact calculation suited to the planned analysis and available evidence. A large-sample normal approximation can perform poorly when expected cell counts are low (Fleiss et al., 2003).
Research Planning & Study DesignPlanning a study with a binary primary outcome? A statistician ties the calculation to the test you intend to run and to the anticipated event rates.
Research Planning & Study Design
Research Planning & Study Design at OnlineSPSS is carried out by in-house PhD-level statisticians. A statistically trained Research Coordinator reviews your request, and the analytical work, deliverables, timeline and fixed project fee are confirmed before work begins. The research question, interpretation and conclusions remain with you.
References
- Chow, S.-C., Shao, J., Wang, H., & Lokhnygina, Y. (2017). Sample size calculations in clinical research (3rd ed.). CRC Press. https://doi.org/10.1201/9781315183084
- Fleiss, J. L., Levin, B., & Paik, M. C. (2003). Statistical methods for rates and proportions (3rd ed.). Wiley. https://doi.org/10.1002/0471445428
- Lakens, D. (2022). Sample size justification. Collabra: Psychology, 8(1), Article 33267. https://doi.org/10.1525/collabra.33267
- Machin, D., Campbell, M. J., Tan, S.-B., & Tan, S.-H. (2009). Sample size tables for clinical studies (3rd ed.). Wiley-Blackwell. https://doi.org/10.1002/9781444300710
Last reviewed November 2026 by the OnlineSPSS Statistical Team. Worked examples use hypothetical values and are not client data.
NEXT STEP
Need this done for
your study?
Share your research in about a minute and receive a complimentary assessment the same day: scope, timeline and one fixed fee.
No Commitment Required
Strictly Confidential
Fixed Project Fee
In-House PhD-Level Statisticians
Same-Day Response
Serving Researchers Since 2014