Sample Size Calculator

About this calculator

The Sample Size Calculator works in two directions. Give it a confidence level, margin of error, expected proportion and (optionally) population size, and it returns the minimum number of responses you need. Or give it a sample size and it returns the margin of error your survey achieves. Both modes apply the finite population correction when you enter a population size.

%
%
Use 50% if you are not sure.
Leave blank for an unlimited population.
%
Leave blank for an unlimited population.
Embed this calculator

Paste this code into a Custom HTML block on your site. The calculator fits the width of the block. Adjust the height in the code if you want more room for results.

Find this widget in the publisher directory

Why sample size matters

Surveying an entire population is usually impossible, so researchers measure a random sample and use it to estimate the whole. The bigger the sample, the closer the estimate is likely to be to the truth, but each extra response costs time and money. Sample size planning finds the smallest sample that still delivers the precision you need.

Statistics of a random sample

The key idea is that a sample proportion varies from one random sample to the next. If you could repeat a survey many times, the results would form a roughly normal distribution centered on the true proportion. Its spread, the standard error, equals √(p(1 − p) / n). Larger samples shrink the standard error, but only with the square root of n: to cut the margin of error in half you need four times as many responses.

Confidence level

The confidence level is how often the method would capture the true value if you repeated the survey many times. Each level corresponds to a z-score, the number of standard errors on each side of the estimate:

Confidence levelz-score
70%1.04
75%1.15
80%1.28
85%1.44
90%1.65
95%1.96
98%2.33
99%2.58
99.9%3.29
99.99%3.89
99.999%4.42

Margin of error

The margin of error (often called the confidence interval half-width) is the plus-or-minus figure reported with poll results. A result of 52% with a margin of ±3% at 95% confidence means the method yields an interval of 49% to 55% that would contain the true value in 95% of repeated surveys.

Sample size formula

n₀ = z² × p(1 − p) / ε²

Here z is the z-score for your confidence level, p is the expected proportion as a decimal and ε is the margin of error as a decimal. When you do not know p, use 50%: p(1 − p) is largest at 0.5, so this gives the most conservative, largest sample.

Finite population correction

If the population is small, sampling a sizable share of it gives extra precision. The corrected sample size is:

n = n₀ / (1 + (n₀ − 1) / N)

The result is always rounded up to the next whole respondent.

Worked example

You want 95% confidence, a ±5% margin and have no idea of the proportion, so p = 0.5. Then n₀ = 1.96² × 0.5 × 0.5 / 0.05² = 384.16, which rounds up to 385. If the population is only 2,000 people, n = 384.16 / (1 + 383.16 / 2,000) ≈ 322.4, so you need 323 responses.

Finding the margin of error

If the sample size is already fixed, reverse the formula:

ε = z × √(p(1 − p) / n) × √((N − n) / (N − 1))

Drop the last factor for a very large or unknown population. For example, 100 responses with p = 60% at 95% confidence give 1.96 × √(0.24 / 100) ≈ 0.0960, a margin of ±9.60%.

Practical tips

  • Plan for non-response. If you expect a 25% response rate, invite four times the required sample.
  • The formula assumes a simple random sample. Clustered or convenience samples need larger sizes or different methods.
  • Subgroup analysis needs the required sample size within each subgroup, not just overall.
  • Precision is not the same as accuracy: a large biased sample can still be badly wrong.

Common mistakes

Do not confuse the margin of error with the response rate, and do not assume a bigger population always needs a proportionally bigger sample: beyond a few tens of thousands, the required size barely moves. Also enter the margin of error for the precision you actually need. A ±1% margin at 95% confidence requires 9,604 responses, more than six times the 1,068 needed for ±3%.

Frequently asked questions

What sample size do I need for a 95% confidence level and 5% margin of error?
For a large population and an unknown proportion (50%), you need 385 responses. Smaller populations need fewer once the finite population correction is applied.
Why use 50% for the population proportion?
The term p(1 − p) is largest when p is 50%, so it produces the largest, safest sample size when you have no prior estimate.
Does population size matter?
Only when the sample is a noticeable fraction of the population. For populations in the tens of thousands or more, the required sample barely changes.
How do I halve my margin of error?
Multiply the sample size by about four, because the margin of error shrinks with the square root of the sample size.

Formulas and sample results on this page were checked against independent references. Page last reviewed or updated . How we verify calculators. Project led by Shaun Connell.