Skip to main content

Sample Size Calculator

Compute the sample size for a proportion using n₀ = z²·p̂(1−p̂)/e², with optional FPC for a known N.

Written by Golam Rabbani, Founder & Lead Engineer

Use 50 for the most conservative (largest) sample size.

How to use this sample size calculator

  1. Choose the confidence level (80% to 99.9%).
  2. Set the margin of error you can tolerate (in percentage points).
  3. Set the expected proportion p̂. Use 50 for the most conservative (largest) sample size.
  4. Optionally enter the population size N to apply the finite-population correction.
  5. Press Calculate to read both n₀ (unlimited) and the adjusted sample size.

About this sample size calculator

Sample-size planning for a proportion uses Cochran's formula n₀ = z² · p̂(1 − p̂) / e², where z is the two-tailed critical value for the chosen confidence level, p̂ is the expected proportion, and e is the maximum acceptable margin of error (as a decimal). Picking p̂ = 0.5 makes the formula as conservative as possible — the variance term p̂(1 − p̂) is maximised at 0.25. When the population is finite, the calculator applies the finite-population correction (FPC): n = n₀ / (1 + (n₀ − 1) / N). The FPC reduces the sample size when N is small relative to n₀.

Worked example. You want a 95% confidence level, a ±5% margin of error, and you have no prior estimate so you use p̂ = 50%. z₀.₉₅ ≈ 1.9600. n₀ = (1.9600² · 0.5 · 0.5) / 0.05² = (3.8416 · 0.25) / 0.0025 = 0.9604 / 0.0025 ≈ 384.16. Round up to 385. If your population is N = 10,000, the FPC gives n = 384.16 / (1 + (384.16 − 1) / 10,000) ≈ 370.4, round up to 371. The tool rounds up automatically since you cannot survey a fractional respondent.

FAQ

Why round up the sample size?
You cannot interview half a respondent, and the formula guarantees the desired margin only at or above the computed n.
Why use p̂ = 50% when I don't know the true value?
Because p̂(1 − p̂) is maximised at p̂ = 0.5. Using 50% yields the largest (most conservative) sample size, so the resulting interval is guaranteed to meet your margin no matter what the true proportion turns out to be.
When does the finite-population correction matter?
When n₀ is more than ~5% of the population. For huge populations (national surveys), the FPC barely moves n.
Does this calculator handle stratified or cluster samples?
No — it covers simple random sampling for a single proportion. Complex designs need an effective sample size adjustment.
Is the answer the same as for a mean?
No. For a mean, the formula is n = (z · σ / e)², where σ is the population SD. This calculator is specifically for a proportion.