How it’s calculated
To estimate a percentage (a proportion) within a chosen margin of error, the sample size comes from solving the margin-of-error formula for n. The critical value z depends on the confidence level (1.645 for 90%, 1.960 for 95%, 2.576 for 99%). The result is always rounded up to a whole person.
The product p(1 − p) is largest at p = 50%, so 50% is the cautious choice when you have no idea what to expect. For a known population, the standard error is multiplied by the finite population correction factor √((N − n) ÷ (N − 1)); solving the margin-of-error formula for n with that factor applied gives the adjusted size above. The correction matters only when the sample is a sizeable share of the population (roughly more than 5%); for large populations it changes almost nothing.
Example: 95% confidence, ±5% margin, p = 50%. z = 1.95996, so n = 1.95996² × 0.25 ÷ 0.05² = 384.15, rounded up to 385. The margin of error actually achieved is 1.95996 × √(0.25 ÷ 385) = 4.99%. If the whole population is only 1,000 people, n_adj = 384.15 ÷ (1 + 383.15 ÷ 1000) = 277.7, so you need 278.
Frequently asked questions
What sample size do I need for a 5% margin of error?
At 95% confidence with the safe assumption of 50%, you need 385 responses. That is the figure behind most opinion polls of about 400 people, and it barely changes for populations of tens of thousands or more.
Why does the calculator use 50% as the expected proportion?
Because the uncertainty about a proportion is greatest at 50%. Using it guarantees the sample is big enough whatever the true answer turns out to be. If earlier surveys suggest a different value, enter it to get a smaller sample size.
Does population size matter?
Only for small populations. For populations of tens of thousands the required sample is almost the same as for an unlimited population (for example 377 instead of 385 at 20,000 people). For small groups (a school, a company) enter the population size to avoid surveying more people than needed.
Is this for averages as well as percentages?
No. This tool is for yes/no (proportion) questions. For estimating an average you need the standard deviation: n = (z × σ ÷ E)².
Embed this calculator
Add this free calculator to your own website. Copy the code below into your page’s HTML:
Need this calculator branded, changed or built around your own prices?See custom business solutions →
Sources
- Introductory Statistics 2e, §8.3 A Population Proportion (calculating the sample size n) — OpenStax
- Business Statistics (OpenStax), 7.4 Finite Population Correction Factor — LibreTexts / OpenStax
Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.
Added · Last updated · How we check our calculators
Spotted a mistake or missing option? Report a problem· Suggest a calculator