Sample Size Calculator

Quick answer

The sample size calculator finds how many completed responses you need for a chosen confidence level and margin of error. It uses Cochran's formula for a proportion (or the σ-based formula for a mean), applies the finite population correction and converts the result into invitations for an expected response rate.

%
%

Use 50% if unsure; it gives the largest, safest sample.

Enter 0 if the population is very large or unknown.

%

Share of contacted people who complete the survey

Sample size (infinite population)
384.2
Required sample size
377
People to invite (at the response rate)
377
Responses saved by the finite population correction
8
Sample as a share of the population
1.88 %
Margin of error achieved with this sample
5 ±

Before running a survey or an experiment you need to know how many observations are enough. Too few and the margin of error is so wide that the result is useless; too many and you waste time and money. The sample size formula works backwards from the precision you want: choose the confidence level, the margin of error you can accept and a guess of the proportion (or the standard deviation for a mean), and it returns the smallest sample that delivers that precision.

Precision has diminishing returns. Because the margin of error falls with the square root of n, halving it requires four times as many responses: ±5% at 95% confidence needs about 385 responses, ±2.5% about 1,537. If you have no idea what proportion to expect, use 50%: p(1 − p) is largest there, so the answer is the safe, worst-case sample size.

When the population is small, such as a company of 800 staff or a school of 1,500 pupils, you need fewer responses, and the finite population correction takes care of that. Finally, remember that the formula counts completed responses: if only a quarter of the people you contact answer, you must invite four times as many.

How to use the Sample Size Calculator

  1. Estimate a
  2. Confidence level
  3. Margin of error
  4. Expected proportion: Use 50% if unsure; it gives the largest, safest sample.
  5. Expected standard deviation (σ): From a pilot study or earlier research, in the units of the measurement
  6. Margin of error (in the units of the measurement)
  7. Population size: Enter 0 if the population is very large or unknown.
  8. Expected response rate: Share of contacted people who complete the survey

Results update as you type, and everything is calculated in your browser.

How it works

Cochran’s formula gives the sample for an infinite population, n₀ = z²p(1 − p)/e² (or (zσ/E)² for a mean). The finite population correction n = n₀ ÷ (1 + (n₀ − 1)/N) reduces it, the result is rounded up, and dividing by the response rate gives the number of people to contact.

Worked example

95% confidence, ±5% margin, expected proportion 50%, population 20,000. n₀ = 1.96² × 0.5 × 0.5 ÷ 0.05² = 384.16. The finite population correction gives n = 384.16 ÷ (1 + 383.16 ÷ 20,000) = 376.9, so you need 377 completed responses. With a 25% response rate you should invite 1,508 people. For a mean with σ = 15 and a ±2 margin, n₀ = (1.96 × 15 ÷ 2)² = 216.09 and n = 214.

Sample sizes at 95% confidence (p = 50%)

Population ±10% ±5% ±3% ±1%
500 81 218 341 476
1,000 88 278 517 906
10,000 96 370 965 4,900
Very large 97 385 1,068 9,604

Common mistakes to avoid

  • Mixing percentages and decimals between fields.
  • Using a rule of thumb outside the range where it applies.
  • Treating an estimate as an exact answer.

Inputs explained

Field What to enter
Estimate a Choose one: Proportion (percentage of yes answers), Mean (average of a measurement)
Confidence level Choose one: 70% (z = 1.036), 75% (z = 1.150), 80% (z = 1.282), 85% (z = 1.440) …
Margin of error In %
Expected proportion In %. Use 50% if unsure; it gives the largest, safest sample.
Expected standard deviation (σ) A number. From a pilot study or earlier research, in the units of the measurement
Margin of error (in the units of the measurement) A number
Population size A number. Enter 0 if the population is very large or unknown.
Expected response rate In %. Share of contacted people who complete the survey

What each result means

  • People to invite (at the response rate) = ceil([Required sample size]÷([Expected response rate]÷100))
  • Responses saved by the finite population correction = ceil([Sample size (infinite population)]) – [Required sample size]

Formula

Proportion: n₀ = z² × p(1 − p) ÷ e² · Mean: n₀ = (z × σ ÷ E)² · finite population: n = n₀ ÷ (1 + (n₀ − 1) ÷ N) · invitations = n ÷ response rate

Worked example

Inputs: Estimate a: Proportion (percentage of yes answers); Confidence level: 95% (z = 1.960); Margin of error: 5 %; Expected proportion: 50 %; Population size: 20,000; Expected response rate: 100 %.
Results: Sample size (infinite population) = 384.2; Required sample size = 377; People to invite (at the response rate) = 377; Responses saved by the finite population correction = 8; Sample as a share of the population = 1.88 %; Margin of error achieved with this sample = 5 ±.

Key terms

Margin of error
Half the width of the confidence interval you are aiming for.
Confidence level
How often intervals built this way contain the true value.
Finite population correction
Adjustment that reduces the sample size for small populations.
Response rate
Share of contacted people who complete the survey.

Frequently asked questions

How many people do I need to survey?

For ±5% at 95% confidence and an unknown proportion (50%), about 385 completed responses from a large population; 377 from a population of 20,000; 278 from 1,000.

Why does 50% give the largest sample?

p(1 − p) is maximised at p = 0.5 (0.25). Any other expected proportion needs fewer responses.

Does population size matter much?

Only for small populations. Above about 100,000 the required sample barely changes; for 500 people you need 218 instead of 385.

How does the margin of error affect the sample size?

Inversely with its square: halving the margin from 5% to 2.5% raises the sample from 385 to 1,537.

How do I find the sample size for a mean?

n = (z × σ ÷ E)². With σ = 15, E = 2 and 95% confidence: (1.96 × 15 ÷ 2)² = 216.1, so 217 (214 after the correction for N = 20,000).

What about response rates?

The formula counts completed responses. If you expect 25% to respond, invite four times as many people.

Is this the same as a power calculation?

No. This sets the precision of an estimate; a power analysis sets the sample needed to detect a given difference in a hypothesis test.

Sources

  1. Cochran WG: Sampling Techniques, 3rd ed., Wiley (1977)
  2. NIST/SEMATECH e-Handbook of Statistical Methods
  3. Penn State STAT 500: Applied Statistics

Guides on this topic

Cite this calculator

Speedy Calculator. (2026). Sample Size Calculator. Speedy Calculator. https://speedycalculator.com/calculators/statistics/sample-size/