Sample Size Calculator

Find how many people to survey for a chosen confidence level and margin of error (proportion). Optional finite population correction.

How sure you want to be that the true value falls within the margin of error. 95% is the usual choice.
%
The “plus or minus” you can accept, in percentage points (5 means ±5%).
%
Your best guess of the share who will answer “yes”. If unsure, leave 50%: it gives the largest (safest) sample size.
The total number of people you could survey. Leave 0 if the population is very large or unknown.

Results

Sample size needed
385
Critical value z (95% confidence)
1.96
Margin of error with this sample size
4.99 %
Rounding the sample size up makes the margin slightly smaller than the one you asked for.

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.

n = z² × p × (1 − p) ÷ E² with a known population N: n_adj = n ÷ (1 + (n − 1) ÷ N) margin achieved = z × √( p(1 − p) ÷ n )

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

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