SolveKit

Sample Size Calculator

How many people do you need to survey? Set the confidence level and margin of error — or enter your sample size to see the margin you can claim.

By Dr. Priya Nair, science writer and former university physics lecturer · Updated

Sample Size Calculator

Enter any 3 known values — the others are solved as you type. Change units at any time.

Fill in the values you know.

How to use this calculator

The confidence level and expected proportion are pre-filled with the common defaults of 95% and 50%. Enter the margin of error you can tolerate and the required sample size appears, with a rounded-up figure underneath. If you have a pilot estimate of the proportion — say 20% of customers churn — enter it; proportions far from 50% need smaller samples.

Run it backwards to evaluate a survey you already ran: delete the margin of error, enter your sample size, and the achievable margin is calculated. This is how news reports arrive at the "±3 points" quoted for a poll of about 1,000 people.

The formula

n = z² × p̂ (1 − p̂) / E²
E = z × √(p̂ (1 − p̂) / n)
CL
confidence level
z
critical value
p̂
expected proportion
E
margin of error
n
sample size

Worked example

You want to estimate a proportion to within ±5 percentage points at 95% confidence, with no prior estimate of the proportion.

  1. z = 1.96 for 95% confidence.
  2. Use p̂ = 50%, the most conservative choice.
  3. n = 1.96² × 0.5 × 0.5 / 0.05² = 384.1, rounded up to 385.

Survey at least 385 respondents.

Assumptions and limits

  • Simple random sampling from a large population. For populations under about 20 times the sample size, apply the finite population correction n′ = n / (1 + (n − 1)/N).
  • Margin of error covers sampling error only, not non-response or question-wording bias.

Frequently asked questions

Why use 50% when I do not know the proportion?

p(1 − p) is largest at 0.5, so it gives the largest, safest sample size. Any other true proportion will then have a smaller margin of error.

Does population size matter?

Barely, unless the population is small. A national poll and a city poll need about the same sample for the same margin of error.

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

About 1,068 with p̂ = 50%.

Sources

Related calculators

More in Statistics calculators.