ridge landscape at dusk

Sample Size Calculator Proportion

Find how many people to sample for any precision and confidence, with population size, design effect and two-group power.

Result: n = 385
n for other margins 95% confidence, p = 50%
±1% n = 9,604 ±2% n = 2,401 ±3% n = 1,068 ±5% n = 385 ±10% n = 97
n for other margins
ItemValue
±1%n = 9,604
±2%n = 2,401
±3%n = 1,068
±5%n = 385
±10%n = 97
  1. 1 Critical value
    95% confidence
    z* = 1.96
  2. 2 n₀ = z² p(1 − p) ÷ E²
    1.96² × 0.5 × 0.5 ÷ 0.05²
    384.15
  3. 3 Round up
    always to the next whole person
    385

This sample size calculator for a proportion tells you how many people to survey or test. The goal is to estimate the true value within a chosen precision. Nobody knows the true population proportion in advance. Enter the required margin of error, pick the confidence, set an expected proportion, and optionally add a population size and a design effect; the result shows n with each step. A second mode works backwards from n, and a third finds the sample per group needed to detect a difference between two proportions. A proportion is a part-to-whole ratio, the same idea our proportion calculator works with.

How to Use the Sample Size Calculator

Input Values

  1. Margin of error: the ± precision you need, such as 5 for ±5%.
  2. Confidence: 90%, 95% or 99%.
  3. Expected proportion: your best guess; 50% gives the largest sample size and is the safe default.
  4. Population (optional): the total number of people you could sample.
  5. Design effect: 1 for a simple random sample, larger for cluster designs.

Sample Size Adjustment

When the population is small, the calculator applies the finite population correction. Sampling without replacement from a small group gives more information per person. The design effect multiplies n for cluster or multi-stage samples.

Find Out the Sample Size

Sample size mode returns n, rounded up to the next whole person, and the bar chart shows the n you would need for other precisions at the same settings.

Find Out the Margin of Error

Margin of error mode does the reverse: enter the sample you already have, and it reports the precision you can expect.

Sample Size Calculator Uses

One page covers the three planning questions for a proportion. As a one-proportion sample size calculator, it finds n for a survey or a prevalence study. As a two-proportion sample size calculator, it sizes an A/B test. With a population entered, it is a sample size calculator for finite population proportion. Left blank, it is a sample size calculator for infinite population proportion. The design effect field turns it into a sample size calculator for cluster sampling proportion. For a sample size calculator for stratified sampling proportion, run it once per stratum and add the results.

Some people call it a proportion sample size calculator. Others call it a sample size estimator for proportions. It is also a sample size determination tool. Some just say proportion estimator. Statisticians may file it as a statistical calculator for proportions. Margin of error mode works as a margin of error calculator. It is an online sample size calculator with no sign-up. Market researchers use it as a survey sample size calculator. Study protocols cite it as a statistical sample size calculator.

Sample size calculators all start from the same formula. The input fields take percentages, the output fields show n or the margin, and the user interface keeps the three modes on one card. The estimated proportion field defaults to 50%.

Sample Size Formula for a Proportion

Formula

n₀ = z² × p(1 − p) ÷ E²

z is the critical value (1.645 at 90%, 1.960 at 95%, 2.576 at 99%), p the expected proportion, and E the margin as a decimal. This is often called the Cochran formula.

Formula

n = n₀ ÷ (1 + (n₀ − 1) ÷ N)

Finite population correction (FPC) for a population of N. Multiply by the design effect afterwards, then round up.

The formula comes from the normal approximation to the binomial distribution. The Normal distribution of p̂ explains it: the sample proportion is roughly normal with standard deviation √(p(1 − p)/n), so the half-width of an interval is z times that value.

Worked Example

Survey at ±5%

Problem: How many respondents are needed for ±5% at 95% with no prior estimate?

Solution: n₀ = 1.96² × 0.5 × 0.5 ÷ 0.05² ≈ 384.15, so n = 385.

Small population

Problem: The same survey for a company of 2,000 employees?

Solution: n = 384.15 ÷ (1 + 383.15 ÷ 2000) ≈ 322.4, so n = 323.

Margin from a fixed budget

Problem: You can afford 400 interviews. What precision does that buy at 95%?

Solution: E = 1.96 × √(0.25 ÷ 400) = 0.049, so about ±4.9%.

Influence of Changing Input Values on Sample Size Estimates

  • Halving the margin roughly quadruples n: ±5% needs 385, ±2.5% needs 1,537.
  • Raising confidence from 95% to 99% multiplies n by about 1.73.
  • An expected proportion far from 50% needs fewer people: 10% needs 139 at ±5%.
  • A design effect of 2 doubles n.

Table of Sample Sizes at a Range of Proportion and Precision Values

Sample sizes at 95% for a large population. A proportion and its complement need the same n.

n at 95% for each expected proportion and margin
Proportion±1%±2%±3%±5%±10%
10% (or 90%) 3,458 865 385 139 35
20% (or 80%) 6,147 1,537 683 246 62
30% (or 70%) 8,068 2,017 897 323 81
40% (or 60%) 9,220 2,305 1,025 369 93
50% 9,604 2,401 1,068 385 97
n at 95%, ±5%, p = 50% for finite populations
Population NRequired n
500 218
1,000 278
5,000 357
10,000 370
100,000 383

Comparing Two Proportions: Power and Effect Size

To detect a difference between two groups, the question changes from precision to statistical power: the chance of finding a real effect. The Two proportions mode uses Cohen's h, h = 2·asin(√p₂) − 2·asin(√p₁), as the effect size.

Formula

n per group = (z₁₋α/₂ + z₁₋β)² × 2 ÷ h²

α is the significance level, 1 − β the power. Matches the normal power calculation used in statsmodels.

For a conversion rate of 20% against 30% at α = 0.05 and 80% power, n = 292 per group. The test you will run afterwards is the Two Proportion Z Test Calculator.

Definitions

  • Margin of error: half the width of the interval you want, such as ±3 percentage points.
  • Confidence level: the long-run share of intervals that capture the truth.
  • Population size: the number of people the sample is drawn from.
  • Sample proportion: the share with the trait in your sample, p̂ = x ÷ n.
  • Critical value: the z score for the chosen confidence.
  • Design effect: the variance estimate ratio of your design to a simple random sample.

Practical Tips

  • Plan for the response rate: if only 40% reply, invite n ÷ 0.4 people.
  • Non-response bias is not fixed by a larger sample; follow up with non-responders.
  • A pilot study gives a better expected proportion than 50% when one is available.
  • For subgroups, apply the calculation to each subgroup you will report on.

Sample Size Calculation Practice

Each sample size calculation below has its answer after it.

  1. ±4% at 95%, p = 50%. Answer: 601.
  2. ±2% at 99%, p = 20%. Answer: 2,654.
  3. ±5% at 95%, p = 50%, population 800. Answer: 260.
  4. n = 1,000 at 95%, p = 50%. What margin? Answer: about ±3.1%.
  5. 10% vs 15% at α = 0.05 and 80% power. Answer: 681 per group.

To calculate sample size proportion answers by hand, use the formula section. The sample size proportion formula is the equation above. Some books write the proportion sample size formula with q = 1 − p. Calculating sample size proportion values for a survey takes three inputs. A sample size for proportion studies is always rounded up. The sample size calculation proportion steps appear in Solution Steps. Every proportion sample size calculation starts from z*. Each result is a sample size proportion estimate before non-response. To estimate sample size proportion needs for subgroups, repeat the calculation. A sample size calculator for proportions also shows a trade-off. The sample size proportion confidence link is steep: 99% needs 73% more people than 95%.

Confidence interval sample size planning and hypothesis testing ask different questions. The sample size margin error link is E = z √(p(1 − p)/n). Population proportion sample size needs only an expected share. The sample size calculation for proportions in tests uses power instead. A statistical sample size for a test is chosen with power in mind. If the null hypothesis is false, a well-sized test is likely to reject it. The alternative hypothesis states the difference you want to detect, and the p-value from the finished test is compared with the alpha level. A one sample proportion test compares one group with a benchmark. A two sample proportion test compares two groups. Both are a proportion test on the z scale.

After the data are in, a confidence interval proportion calculator gives the interval. That range is a binomial proportion confidence interval. A z-score calculator reports the test statistic. A statistical significance calculator adds the p-value. The Proportion Confidence Interval Calculator does the first job. Random sampling keeps every result valid, and the correction factor matters only for small populations.

Sample Size FAQ

Why use 50% when I have no estimate?

50% gives the largest sample size, so the margin is met whatever the true value turns out to be.

How many people do I need for ±3% at 95%?

About 1,068 people for a large population.

Does population size matter?

Only when the sample is more than about 5% to 10% of it; for large populations n barely changes.

Should I round n up or down?

Always round up, because rounding down would give a slightly wider margin than you asked for.

What design effect should I use?

Use 1 for simple random samples; cluster surveys often use 1.5 to 2, taken from a previous study of the same design.

Is the sample size for prevalence studies the same?

Yes, estimating prevalence is estimating a proportion, so the same formula applies.

References

Related Calculators