Skip to content

Sample Size Calculator

n0 = z^2 * p * (1-p) / moe^2; finite population: n = n0 / (1 + (n0-1)/pop). Ceil to integer.

Maintained by the Calcenzo team. Last reviewed September 25, 2026. Methodology

Sample Size Calculator

A sample size calculator finds how many responses a survey needs to estimate a proportion within a margin of error. Formula: z from confidence (99→2.576, 95→1.96, else 1.645). n0 = z^2 × p × (1-p)/moe^2. If pop>0: n = n0/(1+(n0-1)/pop); else n=n0. Result = ceil(n). At 95% confidence and ±5%, you need 385 responses from a large population.

sample size calculator
Sample size calculator chart: sample size by margin.

How to use the sample size calculator

  1. Enter the population size, or 0 if it is large or unknown.
  2. Choose a confidence level: 90, 95 or 99%.
  3. Enter the margin of error.
  4. Enter the expected proportion (50% if unsure).
  5. Read the required sample size.

How the sample size calculator works

The sample size calculator finds how many responses you need to estimate a proportion, such as the share of customers who would recommend you, within a chosen margin of error. It uses the standard formula for a proportion:

  • n₀ = z² × p(1 − p) ÷ E²
  • With a population N: n = n₀ ÷ (1 + (n₀ − 1) ÷ N)

z comes from the confidence level, p is the expected proportion and E is the margin of error, both as decimals. The tool rounds up to a whole number. Leave the population at 0 if it is very large or unknown.

Sample size calculator worked example

At 95% confidence, z is 1.96. With a margin of ±5% and p = 50%, n₀ = 1.96² × 0.25 ÷ 0.0025 = 384.16, so the sample size calculator returns 385. Halving the margin to ±2.5% roughly quadruples the sample, because E is squared. The table uses p = 50% and a large population.

Confidence Margin Sample size
90% ±5% 271
95% ±5% 385
99% ±5% 664
95% ±3% 1,068
95% ±1% 9,604
99% ±3% 1,844

Confidence levels

The tool works out the exact two-sided z value for any confidence level from 50% to 99.99% and shows it next to the result. The common levels give 80% (z = 1.2816), 90% (z = 1.6449), 95% (z = 1.96) and 99% (z = 2.5758). At ±5% and p = 50%, those need 165, 271, 385 and 664 responses. Higher confidence always costs a larger sample.

Why 50% is the safe choice

The term p(1 − p) is largest at p = 0.5, so 50% gives the biggest, most cautious sample. If earlier research suggests the answer is near 20%, p(1 − p) is 0.16 instead of 0.25 and you need fewer responses: 246 instead of 385 at 95% and ±5%. If you are unsure, keep the sample size calculator at 50%.

Small populations

When you survey a large share of a small group, the finite population correction lowers the number. With N = 1,000 at 95% and ±5%, you need 278 responses; with N = 500, 218. For a population of 100,000 the answer is 383, almost the same as for an unlimited one. That is why national polls of about 1,000 people can be accurate to roughly ±3%.

Allowing for non-response

The result is the number of completed responses. If you expect only 20% of people to reply, invite five times as many. Also remember that the formula covers random sampling error only. A biased sample, such as one drawn only from people who visit your website, can be wrong by far more than the margin, however large it is.

Subgroups

If you plan to compare groups, such as men and women or two regions, each group needs enough responses on its own. A total of 385 split into four regions gives only about 96 per region, with a margin near ±10%. Use the sample size calculator for the smallest group you want to report. Planning this before fieldwork is far cheaper than finding out afterwards that a key group is too small to say anything useful about.

Tips

  • Use 95% confidence and ±5% as a common starting point.
  • Keep p at 50% unless you have earlier data.
  • Enter the population only when it is small.
  • Inflate the sample size calculator result for expected non-response.

Related calculators:

Sources

OpenStax Introductory Statistics 2e, 8.3: A population proportion; NIST/SEMATECH e-Handbook of Statistical Methods: Confidence limits for the mean.

Formula and method

z from confidence (99→2.576, 95→1.96, else 1.645). n0 = z^2*p*(1-p)/moe^2. If pop>0: n = n0/(1+(n0-1)/pop); else n=n0. Result = ceil(n).

Proportion sample-size sketch for a given confidence, margin of error, and expected proportion. Population 0 means unlimited (no finite correction).

Questions about this calculator

What sample size do I need for 95% and 5%?

385 for a large population.

Why use 50%?

It gives the largest, most cautious sample.

Does population size matter?

Only when the sample is a large share of it.

Which confidence levels are supported?

90%, 95% and 99%.

Does it allow for non-response?

No; invite more people than the result.

Check the assumptions and units before relying on a result. Financial, tax and health estimates do not replace advice for your individual circumstances.

Report a calculation issue