How to use the sample size calculator
- Choose whether you're estimating a percentage (most surveys: "what share of customers…") or an average (for example mean spend or mean height).
- Pick a confidence level (95% is standard) and the margin of error you can accept, such as ±5%.
- For a percentage, enter your best guess of the result, or leave it at 50%. For an average, enter an estimate of the standard deviation.
- Optionally add the population size if it's small (a few thousand or fewer), and your expected response rate to see how many people to invite.
- Click Calculate sample size and read the result, the working and the chart of how sample size changes with the margin of error.
The sample size formula
For estimating a proportion (percentage), the sample size for a very large population is:
n0 = z2 · p(1 − p)E2
For estimating a mean, it is:
n0 = (z · σE)2
When the population is small, apply the finite population correction, then round up to a whole number:
n = n01 + n0 − 1N
- z
- The z-value for your confidence level: 1.645 for 90%, 1.960 for 95%, 2.576 for 99%
- p
- The expected proportion, as a decimal (0.5 if unknown)
- σ
- The estimated standard deviation of the measurement (for a mean)
- E
- The margin of error: as a decimal for a proportion (0.05 for ±5%), or in measurement units for a mean
- n0, n
- Sample size before and after the finite population correction
- N
- The population size
Worked example
A town of 20,000 residents wants to know what share support a new park. It wants ±4% precision at 95% confidence and has no earlier estimate, so it uses p = 0.5.
-
Sample size for a large population
n0 = 1.962 × 0.5 × 0.50.042 = 0.96040.0016 = 600.25
-
Apply the finite population correction for N = 20,000
n = 600.251 + 599.2520,000 = 600.251.0300 = 582.79
-
Round up
n = 583
What it means: the town needs 583 completed responses. If it expects 25% of residents to reply to a mailed survey, it should send about 583 ÷ 0.25 = 2,332 invitations.
How to interpret your sample size
The result is the number of completed responses you need, not the number of people you contact. If you collect that many from a random sample, then 95 times out of 100 (at 95% confidence) your result will be within the margin of error of the true population value.
A few things to keep in mind:
- Precision is expensive. Cutting the margin of error in half needs about four times as many responses.
- Subgroups need their own sample. If you plan to compare, say, men and women separately, each group needs enough responses for the precision you want.
- Random beats big. A large sample of self-selected volunteers can be more misleading than a small random one. The formula assumes a random sample.
- Plan for nonresponse. Use the response rate field to see how many people to invite.
Already collected your data? Use the p-value calculator to test your results, or the NPS calculator to see the margin of error for a Net Promoter Score.