Sample Size Calculator

Calculate required sample size for surveys and studies with confidence levels and margin of error.

For learning and homework help — verify critical calculations independently.

Reviewed by CalculatorDrive Math Editorial Board · Last updated

Calculator

Range: 0.1% to 50%

If blank, uses conservative estimate of 50%

If provided, applies finite population correction

Enter the confidence level, margin of error, and other parameters to calculate the required sample size.

The short answer

Required sample size grows with how confident you want to be and shrinks as you accept a larger margin of error. For a proportion, n = (z² × p × (1−p)) ÷ e², where z comes from your confidence level, p is the expected proportion (0.5 if unknown), and e is your acceptable margin of error. Tighter margins and higher confidence both push the required sample size up, often dramatically.

Key takeaways

  • Cutting the margin of error in half roughly quadruples the required sample size, since e is squared in the denominator.
  • Using p = 0.5 when the true proportion is unknown is the safest choice, since p(1−p) is maximized there — any other guess would only need a smaller sample if you happened to guess right.
  • A known, finite population size lets you apply a correction that meaningfully reduces the required sample for smaller populations, but makes little difference once the population is much larger than the sample.
  • Estimating a mean requires an estimate of the population's standard deviation, not a proportion — the two calculation types use related but different formulas.

The proportion sample size formula

n = (z² × p × (1 − p)) / e²

z comes from the confidence level (1.96 for 95%), p is the expected population proportion, and e is the margin of error expressed as a decimal (5% = 0.05).

Why margin of error dominates the formula

Margin of error Required n (95% confidence, p=0.5)
10%97
5%385
2.5%1,537
1%9,604

Halving the margin of error roughly quadruples the sample size needed — this is why national polls typically settle for a ±3-5% margin instead of chasing ±1% precision, which would require tens of thousands of respondents.

Worked example: planning a survey

You want 95% confidence and a 5% margin of error, with no prior estimate of the proportion.

n = (1.96² × 0.5 × 0.5) / 0.05² = 0.9604 / 0.0025 ≈ 384.16

Round up: n = 385

Sample size always rounds up, never down — a fractional respondent isn't possible, and rounding down would leave you just short of your target precision.

Common mistakes to avoid

  • Expecting a halved margin of error to double the sample size — it roughly quadruples it instead, since e is squared.
  • Guessing a proportion far from 50% "to be safe" — that actually shrinks the calculated sample size, the opposite of conservative; 50% is the truly conservative (maximum) choice.
  • Applying the finite population correction to an effectively infinite population (national surveys, web traffic) — the correction barely changes anything at that scale.
  • Confusing the proportion formula with the mean formula — the mean version needs an estimate of standard deviation, not a proportion.

Frequently Asked Questions

Why does sample size matter in statistics?

Too small a sample yields unreliable estimates and wide confidence intervals. Adequate size detects real effects and keeps margin of error within your target.

What inputs drive sample size formulas?

Confidence level, margin of error, population variability, and whether you estimate a proportion or a mean all affect required sample size.

Does population size always matter?

For large populations, sample size depends mainly on margin of error and variability. For small finite populations, a correction factor can reduce required n.

What is statistical power?

Power is the chance of detecting an effect when one exists. Underpowered studies often miss real findings; sample-size planning balances power, cost, and precision.

How do I use this sample size calculator?

Select study type, enter confidence level, margin of error, and estimated variability, then click Calculate for recommended sample size.

Why should I use p = 0.5 when I don't know the population proportion?

When the true proportion is unknown, 50% is the safest assumption because p × (1 − p) — the term driving sample size — is at its maximum when p = 0.5. Any other split, like 20/80 or 90/10, produces a smaller calculated sample size, so using 50% guarantees your study is adequately powered no matter what the real proportion turns out to be.

More math calculators