How to use it
- Choose the Confidence level, usually 95%, and What to find.
- For a required sample size, type the Margin of error E you accept, and the Expected proportion p. For the margin of a sample, type the Sample size n instead.
- Add the Population size N if the population is small. Leave it empty for a very large one.
- Read Required sample size or Margin of error of the sample, then How it is worked out.
Cochran's formula for a proportion
The sample size needed to estimate a proportion with a margin of error E at confidence level C is n₀ = z² × p × (1 − p) ÷ E². The z value is the point of the standard normal distribution below which the share (1 + C) ÷ 2 lies: 1.9600 for 95%. The product p × (1 − p) is largest when p is 50%, which is why 50% is the safe choice when the proportion is not known.
It rests on the normal approximation to the sampling distribution of a proportion, which the NIST e-Handbook of Statistical Methods also uses when it sizes samples for proportions.
n₀ = z² × p × (1 − p) ÷ E²
n = n₀ ÷ (1 + (n₀ − 1) ÷ N) (population correction)
E = z × √(p × (1 − p) ÷ n) (margin of error of a sample)
Population correction and the margin of a sample
When the population N is small, a smaller sample reaches the same margin of error, so the answer is reduced by the correction. The correction matters only when n₀ is a large share of N.
Given a sample of n people, the margin of error follows from the same formula, solved for E. The result is the ± value to report with the proportion.
What the calculator does not cover
- Sampling designs other than simple random sampling, such as clusters, strata or weights, and design effects.
- Non-response, and the sample size needed for a comparison between two groups or for a statistical power.
- Means and other statistics than a proportion.
Worked example: 95%, p = 50%, E = 5%
The z value for 95% is 1.9600, so n₀ = 1.9600² × 0.5 × 0.5 ÷ 0.05² = 384.15, which rounds up to 385 people.
If the population is only 1,000 people, the correction gives 384.15 ÷ (1 + 383.15 ÷ 1,000) = 277.73, so 278 people are enough.
| Sample size | |
|---|---|
| Margin of error 1% | 9,604 |
| Margin of error 5% | 385 |
| Margin of error 10% | 97 |
| Population 1,000, margin 5% | 278 |
Frequently asked questions
Why do I use 50% for the proportion?
The product p × (1 − p) is largest at 50%, so a sample size calculated with 50% is large enough for any true proportion. If you know the proportion, a smaller value gives a smaller, still valid, sample.
What does the margin of error mean?
It is the ± range around the estimated proportion within which the true value is expected to lie at the chosen confidence level. A 5% margin at 95% confidence means that about 95 out of 100 such samples would give a result within 5 points of the true value.
Why is the sample size smaller for a small population?
Once a sample is a large share of the population, each person adds less new information. The finite population correction accounts for this, so the required sample is smaller than n₀.
Which confidence level should I choose?
95% is the most common choice. A higher level, such as 99%, needs a larger sample for the same margin; a lower level, such as 90%, needs a smaller one but gives a wider uncertainty.
Does the calculator include non-response?
No. Add the share of people you expect not to respond to the sample size yourself, by dividing the size by the expected response rate.
Are the numbers I enter sent to a server?
No. The calculation runs in your browser, and nothing you type is sent to us.
Sources
- NIST e-Handbook of Statistical Methods: 7.2.4.2, sample sizes required for proportions
- Wikipedia: Sample size determination, Cochran's formula for a proportion
- Wikipedia: Margin of error
Figures and text last checked on Tuesday, November 10, 2026.