Sample Size Calculator
At 95% confidence and ±5% you need 385 completed responses from any large population. Change the numbers below and the answer updates as you type.
How sample size is calculated
The formula turns the confidence interval around: instead of asking how wide the interval is for a given n, it asks what n makes the interval as narrow as you want. Because precision grows with √n, halving the margin of error needs four times as many responses, which is why national polls rarely go below ±3%. To go the other way, from a sample you already have to its precision, use the margin of error calculator.
This page sizes one estimate. If you plan to compare two groups, such as an A/B test or a treatment and a control, the question is different: how many people you need to detect a difference of a given size. That is a power analysis.
A big sample doesn’t fix a biased one. The 1936 Literary Digest poll collected over two million ballots and still called the US presidential election wrong, because its mailing lists over-represented wealthier voters.
Frequently asked questions
Why is 385 the magic number for surveys?
At 95% confidence, a ±5% margin of error and the most cautious assumption p = 50%, the formula gives 1.96² × 0.25 ÷ 0.05² = 384.16, rounded up to 385. That holds for any large population, whether it is a city or a country.
Does population size matter?
Surprisingly little once the population is more than about 20 times the sample. The finite population correction only makes a real difference for small groups, like surveying a school of 600 students. Leave population blank for large or unknown populations.
What if I don’t know the expected proportion?
Use 50%. It gives the largest required sample, so your margin of error will be at most what you asked for whatever the true value turns out to be.
What is the formula for sample size?
For a proportion: n₀ = z² × p(1 − p) ÷ E², where z is the critical value for your confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%), p the expected proportion and E the margin of error as a decimal. For a mean: n₀ = (z × σ ÷ E)². For a finite population N, adjust with n = n₀ ÷ (1 + (n₀ − 1) ÷ N). This is Cochran’s formula, from his textbook Sampling Techniques.
How many people do I need to survey for a population of 1,000?
At 95% confidence and a ±5% margin of error you need 278 completed responses from a population of 1,000. For ±3% it is 517. The table on this page lists other population sizes.
What sample size do I need for a 95% confidence level?
It depends on the margin of error: 97 for ±10%, 385 for ±5%, 1,068 for ±3% and 9,604 for ±1%, for a large population with p = 50%.
Is this the number of people to contact?
No, it is the number of completed responses. If you expect a 20% response rate, divide by 0.2 and contact five times as many people.
Can I use this for an experiment comparing two groups?
This page sizes a single estimate to a given precision. Comparing two groups to detect a difference needs a power calculation, which also depends on the effect size and desired power (usually 80%). Use the power analysis calculator for that.