Sample Size Calculator

Sample Size Calculator

Find how many people to survey, or how many measurements to take, for the margin of error and confidence level you want. Works for percentages and for averages, corrects for a small population, and turns around to give the margin of error for a sample you already have.

Every figuretap a card to copy its value

Sample size against margin of error

Sample sizes at a glance

For a percentage, n = z² × p × (1 − p) ÷ E², where z is the critical value for the confidence level, p the expected proportion and E the margin of error as a fraction. For an average, n = (z × σ ÷ E)², with σ the standard deviation and E in the same units. With a population N, the finite population correction gives n ÷ (1 + (n − 1) ÷ N). Results are rounded up to whole responses. This assumes a simple random sample; it does not allow for people who do not respond. The CSV, image and printed report contain the values you entered, nothing preloaded.

How to use this tool

Choose what you are measuring. For a survey question answered as a percentage, such as the share of customers who would recommend you, enter the margin of error you can accept, the confidence level, and the percentage you expect, or 50 if you have no idea. For an average, such as the mean weight of a batch, enter the margin of error in the same units and a standard deviation from earlier data or a small pilot. Add the population size if you are sampling from a known, limited group. To check a sample you already have, choose the margin of error option and enter how many responses you got.

The input people most often get wrong is the margin of error. It is the plus or minus around your result, not the total width of the interval, and for a percentage it is in percentage points: ±5% on a 60% result means 55% to 65%.

What the calculation is doing

A sample result wobbles around the true value from one sample to the next, and for a random sample that wobble follows a normal curve with a spread called the standard error. For a percentage the standard error is √(p × (1 − p) ÷ n). The margin of error is that spread multiplied by a critical value z from the normal curve, 1.96 for 95% confidence. Setting the margin to the value you want and solving for n gives n = z² × p × (1 − p) ÷ E².

For an average the same logic uses the standard deviation σ instead: n = (z × σ ÷ E)². When the sample is a noticeable share of a known population, each response removes more of the uncertainty, and the finite population correction, n ÷ (1 + (n − 1) ÷ N), trims the sample accordingly.

Curve of the survey sample needed for a ±5% margin of error at 95% confidence against population size on a logarithmic scale: 80 for 100 people, 218 for 500, 278 for 1,000, 357 for 5,000, 370 for 10,000, 383 for 100,000 and 384 for a million, levelling off at 385; beside it a table of sample sizes for margins of ±1% to ±10% at 90, 95 and 99% confidence
A city of 100,000 and a country of 100 million need almost the same sample; what drives the number is the margin of error you want, not the size of the population.

Why the population barely matters, and what really does

It surprises most people that a national poll and a poll of one town need about the same number of responses. The reason is that precision comes from how many independent answers you have, not from what fraction of the population you asked. A spoonful of soup tells you how salty the pot is whether the pot holds one litre or a hundred, as long as it is stirred.

What does matter is the margin of error, because it sits squared in the denominator. Halving it from ±5% to ±2.5% multiplies the sample by four, from 385 to 1,537. Raising the confidence from 95% to 99% multiplies it by (2.576 ÷ 1.96)², about 1.73. That is why most surveys settle on ±3% to ±5% at 95%: beyond that, each extra point of precision costs a great deal more fieldwork.

The stirring matters most of all. These formulas assume a random sample, where everyone had the same chance of being chosen. A thousand responses from a self selected online poll can be precise and still wrong, because the people who choose to answer often differ from those who do not. No sample size fixes a biased sample.

Sample sizes by population

Completed responses needed for a result expected near 50%, at the margin and confidence shown.

Population±5%, 90%±5%, 95%±5%, 99%±3%, 95%
10074808892
250131152182203
500176218286341
1,000214278400517
2,500245334525749
5,000257357586880
10,000264370623965
50,0002703826551,045
100,0002703836601,056
1,000,0002713846641,066
Very large2713856641,068

A worked example you can check on paper

For a ±5% margin of error at 95% confidence, expecting around 50%: z = 1.96, so n = 1.96² × 0.5 × 0.5 ÷ 0.05² = 3.8415 × 0.25 ÷ 0.0025 = 384.15, rounded up to 385 responses.

If the population is only 1,000 people, apply the correction: 384.15 ÷ (1 + 383.15 ÷ 1,000) = 384.15 ÷ 1.38315 = 277.73, so 278 responses. Turning it around, 1,000 responses from a large population give a margin of error of 1.96 × √(0.25 ÷ 1,000) = 1.96 × 0.015811 = 0.031, or ±3.1%.

For an average: to estimate a mean within ±2 units when the standard deviation is about 10, n = (1.96 × 10 ÷ 2)² = 9.8² = 96.04, so 97 measurements.

Mistakes that catch people out

Treating the margin of error as the full width. ±5% means the interval runs 5 points either side, 10 points in total.

Forgetting non response. The sample size is completed responses. Divide by the response rate to find how many to invite.

Using the whole sample margin for a subgroup. If you report results for men and women separately, each group has its own, larger margin of error. Size the sample for the smallest group you will report on.

Guessing the standard deviation too low. For averages the sample grows with σ squared. Use a realistic or slightly pessimistic value from past data or a pilot.

Believing a big sample removes bias. Precision and accuracy are different. A random 400 beats a self selected 40,000.

Popular calculations

Each opens the calculator with those values filled in, and they can be changed once it is open. Survey examples assume an expected 50% and a large population unless stated.

Margin of error at 95% confidence

Other confidence levels

Small populations

Expected percentage other than 50%

Estimating an average

Margin of error for a sample you have

How this was checked

The critical values come from an inverse normal function accurate to better than one part in a billion, checked against the standard table: 1.644854 for 90%, 1.959964 for 95% and 2.575829 for 99%. The sample size formulas follow the NIST/SEMATECH Handbook of Statistical Methods, and the familiar results were reproduced exactly: 385 for ±5% at 95%, 1,068 for ±3%, and 278 for a population of 1,000. The margin of error mode was checked by feeding each sample size back in and recovering the margin.

Every address in the lists above was then opened and checked for a distinct title, the right sample size or margin, a chart that renders, and clean CSV, image and print output containing only the values entered, at desktop, tablet and phone widths.

Common questions

What sample size do I need for a survey?

For a large population, a ±5% margin of error at 95% confidence needs 385 completed responses, assuming the answer could be anywhere near 50%. For ±3% you need 1,068, and for ±10% only 97. Smaller populations need fewer, as the finite population correction shows.

Does a bigger population need a bigger sample?

Only up to a point. Once the population is more than a few thousand, the sample needed hardly changes: 370 for 10,000 people, 383 for 100,000 and 384 for a million, at ±5% and 95%. For small groups it matters more; 1,000 people need 278 responses.

What margin of error do 1,000 responses give?

About ±3.1% at 95% confidence for a result near 50%, from 1.96 × √(0.5 × 0.5 ÷ 1,000). That is why many national polls survey around 1,000 people. Results nearer 0% or 100% have a smaller margin.

Why use 50% if I do not know the expected result?

The term p × (1 − p) is largest at 50%, so assuming 50% gives the biggest sample and covers every possible outcome. If you are confident the answer will be near 10% or 90%, you can use that and survey fewer people.

Which confidence level should I use?

95% is the usual choice in research, polling and quality work. 90% needs about 30% fewer responses for the same margin; 99% needs about 73% more. Pick the level before collecting data and report it with the result.

How do I allow for people who do not respond?

Divide the sample size by the response rate you expect. For 385 completed surveys with a 20% response rate, invite about 1,925 people. The calculation also assumes the people who respond are like those who do not, which a low response rate can undermine.

Related Calculators and Reference