Statistics Tool / 08

Sample Size for Proportion Calculator

Plan how many observations you need before collecting data, for one estimated proportion or a two-group comparison.

n = z²·p(1 − p) / E²

Plan before collecting data

Enter a confidence level, margin of error, and planning proportion to get the minimum sample size for one proportion.

Confidence is a percent such as 95. Margins, proportions, alpha, and power are decimals between 0 and 1.

Planning inputs
Choose a task

Margin-of-error target

This sample size calculator for a proportion answers the planning question that comes before any data exist: how many observations are enough? The first mode returns the minimum sample size to estimate a single proportion within a chosen margin of error, with an optional finite population correction. The second mode returns the minimum size of each group when the goal is to detect a difference between two proportions with chosen power.

Both modes show the critical values, the formula substitution, and the round-up step, so the result can be defended in a protocol or study plan rather than copied on faith.

02

How to Use the Sample Size Calculator for Proportions

  1. Choose a task. Estimate one proportion targets a margin of error; compare two proportions targets statistical power.
  2. For one proportion, enter the confidence level as a percent (such as 95), the margin of error as a decimal (0.05 means ±5 percentage points), and a planning proportion. Keep 0.5 unless prior evidence justifies another value. Add the population size only when sampling a genuinely limited population, such as one school or one customer list.
  3. For two proportions, enter the significance level α, the target power (commonly 0.8 or 0.9), and the two proportions the study is designed to distinguish.
  4. Read the unrounded requirement, the correction step, and the final rounded-up minimum together, then inflate the plan for expected nonresponse or dropout.

Confidence must be at least 50 and below 100. Margins, proportions, alpha, and power are decimals strictly between 0 and 1.

03

Sample Size Formulas for One and Two Proportions

For one proportion, the calculator solves the margin-of-error equation for n:

n₀ = z²·p(1 − p) / E²

z is the standard-normal critical value for the chosen confidence level, p is the planning proportion, and E is the target margin of error. When a population size N is entered, the finite population correction reduces the requirement:

n = n₀ / [1 + (n₀ − 1) / N]

For two proportions with equal planned group sizes, the calculator uses the unpooled normal-approximation formula:

n per group = (z_α + z_β)² · [p₁(1 − p₁) + p₂(1 − p₂)] / (p₁ − p₂)²

z_α reflects the significance level and sidedness of the planned test, and z_β reflects the target power. Because software differs in which variant it uses, the exact formula above is the one to cite when comparing outputs.

Rounding ruleAlways up
A calculated requirement of 384.15 observations means 384 are not enough: the margin or power target would be missed. Sample sizes from this calculator are always rounded up to the next whole observation, never to the nearest.
04

What Drives the Required Sample Size

Every input moves the answer in a predictable direction. Understanding the three levers below prevents both underpowered studies and wasted budget.

APlanning valuep = 0.5

Why 0.5 Is the Conservative Choice

The product p(1 − p) is largest at p = 0.5, so planning at 0.5 gives the largest—and therefore safest—sample size. Any other planning value must come from prior data, not from hope.

BPrecisionE halved → n ×4

Margin of Error vs. Cost

n grows with 1 / E². Halving the margin of error quadruples the required sample; tightening ±5 points to ±3 nearly triples it. Set the margin from what the decision needs, not from what looks precise.

CPower1 − β

Power and α in Two-Group Planning

Power is the probability of detecting the planned difference if it is real. Raising power from 0.8 to 0.9, or shrinking the difference worth detecting, both increase z_β’s share of the formula and the group sizes with it.

05

Sample Size Examples for Both Modes

One proportion. A survey should estimate a support rate within ±5 percentage points at 95 percent confidence, with no reliable prior estimate.

  1. Critical value: z = 1.959964 for 95 percent confidence.
  2. Base requirement: n₀ = 1.959964² · 0.5(0.5) / 0.05² = 384.145882.
  3. Round up: the minimum sample size is 385 usable responses.

If the same survey targets one campus of 1,000 students, the finite population correction gives n = 384.145882 / [1 + 383.145882 / 1000] = 277.733453, so 278 responses suffice.

Two proportions. A trial should detect an improvement from 60 percent to 75 percent with power 0.80 at two-sided α = 0.05.

  1. Critical values: z_α = 1.959964 and z_β = 0.841621.
  2. Variance term: 0.60(0.40) + 0.75(0.25) = 0.4275.
  3. Per group: (1.959964 + 0.841621)² · 0.4275 / 0.15² = 149.127526, rounded up to 150 per group, or 300 in total.
±5-point margin at 95% confidence: 385 responses, or 278 after the finite population correction.
06

Assumptions and Common Planning Mistakes

The formulas are standard, but the plan is only as good as its inputs. Check these points before committing to a number:

  • Round up, never down: truncating the requirement silently misses the margin or power target. This calculator always rounds up.
  • The result is usable responses: nonresponse, ineligibility, and dropout reduce the usable sample. Inflate the fielded size accordingly; the calculator does not do it for you.
  • Normal approximation: both modes rely on large-sample normal theory without a continuity correction. For very small planned samples or extreme proportions, exact methods can require noticeably different sizes.
  • The FPC needs a real boundary: apply a population size only when the population is genuinely fixed and enumerable. “Large” populations gain nothing from the correction.
  • Equal groups assumed: the two-proportion mode plans equal group sizes. Unequal allocation changes the formula and usually increases the total.
  • Detecting less takes more: the difference p₁ − p₂ in the denominator is squared, so halving the difference worth detecting roughly quadruples each group.
07

Reading and Defending a Sample Size

Which margin of error should I enter?

Enter the half-width the decision can tolerate, in proportion units: 0.05 means the final interval should span no more than ±5 percentage points. The margin is a design choice, not a statistical constant.

Why does my statistics software give a slightly different n?

Sample-size software varies in formula details—pooled versus unpooled variance, continuity corrections, or exact binomial methods. Differences of a few observations are expected. Compare formulas, not just outputs; this page states its formulas exactly.

Does reaching the calculated n guarantee a significant result?

No. Power is a probability, not a promise. A study with 80 percent power fails to detect the planned difference one time in five even when that difference is real, and no sample size rescues a biased sampling process.

Can I reuse the one-proportion mode for each arm of a comparison?

No. Sizing each group for a margin of error is not the same as powering a comparison between groups. Use the two-proportion mode when the question is whether the groups differ.

08

Method, Limitations, and Statistical Sources

The one-proportion mode uses the large-sample Wald-style margin z·√[p(1 − p)/n] solved for n, with the standard finite population correction when a population size is supplied. The two-proportion mode uses the unpooled normal-approximation formula with equal group sizes shown above. Neither mode applies continuity corrections, exact binomial or beta methods, unequal allocation, cluster or survey-design effects, or dropout inflation.

The formulas follow the NIST/SEMATECH e-Handbook of Statistical Methods section on sample sizes and Penn State STAT 415’s lessons on estimating a proportion for large populations and for small, finite populations. For regulated or high-stakes studies, confirm the calculation inside a full statistical analysis plan.