Sample Size Calculator

Sample Size Calculator

Work out how many responses a survey or study needs to hit a target margin of error, for a percentage or an average, with a correction for small populations.

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

Leave the expected percentage at 50% if you don’t know it: that gives the largest, safest sample.

Enter the margin of error you're aiming for

What Does a Sample Size Calculation Do?

A sample size calculation tells you how many people to survey (or items to measure) so your result lands within a chosen distance of the truth, most of the time. That distance is the margin of error; "most of the time" is the confidence level.

The surprising part is that, for large populations, the answer barely depends on population size. About 1,068 random responses give ±3% at 95% confidence whether you're surveying a town or a whole country.

Population size only matters when the sample is a sizeable share of it, such as surveying a company of 500 staff. The finite population correction then trims the number needed.

Sample Size Formula

As given in Cochran, Sampling Techniques, chapter 4, and the NIST/SEMATECH e-Handbook, section 7.2.2.2. See Sources.

1. For a percentage

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

p(1 − p) is largest at p = 0.5, which is why 50% is the safe default.

2. For an average

n₀ = (z × σ ÷ E)²

3. Finite population correction

n = n₀ ÷ (1 + (n₀ − 1) ÷ N), then round up

Worked Example: A Staff Survey of 5,000 Employees

Given:
An employer of 5,000 wants satisfaction figures within ±3% at 95% confidence, with no idea of the likely answer.
Step 1:
Infinite-population size:
1.96² × 0.25 ÷ 0.03² = 1,067.1
Step 2:
Correct for 5,000 staff:
1,067.1 ÷ (1 + 1,066.1 ÷ 5,000) = 879.5
Step 3:
Round up and allow for non-response:
880 responses · at a 40% response rate, invite 2,200
Result:
880 completed responses

The population correction saves nearly 190 responses compared with the 1,068 a national poll would need. The margin still only covers random error: a survey that only keen staff answer can be precise and wrong.

Sample Size by Margin of Error

For a percentage near 50% in a large population. Halving the margin quadruples the sample.

Required sample size for each margin of error and confidence level
Margin90%95%99%
±10%6897166
±5%271385664
±3%7521,0681,844
±2%1,6912,4014,147
±1%6,7649,60416,588

Common Sample Size Mistakes

  • Calculating invitations instead of responses. The formula gives completed responses. Divide by the expected response rate to get the number to contact.
  • Forgetting subgroups. ±3% overall becomes about ±6% for a quarter of the sample, such as one region. Size for the smallest group you'll report.
  • Thinking a big sample fixes bias. Ten thousand self-selected responses can be further off than 1,000 random ones.
  • Rounding down. Always round up; 1,067.1 means 1,068.

Sample Size FAQs

Why do national polls use about 1,000 people?

Because 1,000 random respondents give roughly ±3% at 95% confidence, whatever the country’s size, and going much further costs a lot for little gain.

Why use 50% when I don’t know the answer?

p(1 − p) is largest at 50%, so it gives the biggest sample. If the truth is nearer 10% or 90%, you’ll end up more precise than planned.

When does population size matter?

When the sample would be more than about 5% of the population. Below that, the correction makes little difference.

What confidence level should I choose?

95% is standard. 99% needs about 70% more responses for the same margin.

Does this work for comparing two groups?

Not directly. Comparing groups needs a power calculation; use the power analysis calculator.

What if I can’t reach the required size?

Report the larger margin of error you actually achieved. The margin of error calculator works it out from your real sample.

How do I estimate σ for an average?

From a pilot study, earlier surveys, or roughly range ÷ 4 if you know the typical spread.

Does the margin cover question wording or non-response?

No. It covers only random sampling error. Bias from wording, coverage or who answers needs separate attention.

Sources

Related Tools