Sample Size Calculator
Sample size is the number of responses needed to estimate a proportion within a chosen margin of error. At 95% confidence, a ±5% margin and an expected proportion of 50%, you need 385 respondents, or 323 if the population is just 2,000.
Last updated · By S. Dilshan · Runs in your browser, nothing is uploaded
Advanced options
Step-by-Step Solution
What Is a Sample Size Calculator?
When you survey a group of people to learn about a larger population, the number you ask determines how precise the results can be. Ask too few and the answer is a rough guess. Ask more than you need and you waste time and money. A sample size calculator finds the smallest number of responses that delivers the precision you want.
Three choices drive the answer. The confidence level is how sure you want to be that the true value lies within your range. The margin of error is how wide that range is. The expected proportion is your best guess for the answer, and 50% is the safe, most conservative choice because it demands the largest sample.
Typical Sample Sizes (Large Population, p = 50%)
| Margin of error | 90% confidence | 95% confidence | 99% confidence |
|---|---|---|---|
| ±10% | 68 | 97 | 166 |
| ±5% | 271 | 385 | 664 |
| ±3% | 752 | 1,068 | 1,844 |
| ±2% | 1,691 | 2,401 | 4,147 |
Sample Size Formula
For a proportion in a large population, Cochran’s formula gives the starting sample size:
If the population size N is known and not huge, apply the finite population correction:
zis the critical value for your confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%).pis the expected proportion as a decimal. Use 0.5 if you are unsure.eis the margin of error as a decimal (0.05 for ±5%).Nis the population size.
The result is always rounded up to the next whole number. You can look up z values with the critical value calculator.
Worked Example: Customer Survey
A company wants to survey customers with 95% confidence, a ±5% margin of error and no prior knowledge of the answer (p = 50%).
- z = 1.96, p = 0.5, e = 0.05.
- n₀ = 1.96² × 0.5 × 0.5 ÷ 0.05² = 3.8416 × 0.25 ÷ 0.0025 = 384.16.
- Round up: 385 respondents.
With a Small Population
If there are only 2,000 customers in total, the correction applies:
- n = 384.16 ÷ [1 + (384.16 − 1) ÷ 2,000] = 384.16 ÷ 1.1916 = 322.4.
- Round up: 323 respondents.
Surveying a larger share of a small population lets you get away with fewer responses.
Why the Population Barely Matters for Big Groups
A city of 100,000 and a country of 100 million both need almost the same sample, about 385, for the same precision. What matters is how many people you ask, not what fraction of the population they are.
Sample Size for Estimating a Mean
If you want to estimate an average instead of a percentage, the formula uses the standard deviation: n = (z × s ÷ E)². Suppose s = 10, you want a margin of error of E = 2 units and 95% confidence. Then n = (1.96 × 10 ÷ 2)² = 9.8² = 96.04, so you need 97 observations. A rough estimate of s from a pilot study or earlier research is usually enough.
How to Use This Sample Size Calculator
- Choose your confidence level, normally 95%.
- Enter the margin of error you can accept, for example 5.
- Enter your expected proportion. Leave it at 50 if you do not know.
- Enter the population size, or 0 if it is very large or unknown.
- Read the required sample size and see the value before correction.
After collecting your data, use the margin of error calculator to confirm the precision you actually achieved.
Real-World Uses of Sample Size Calculations
- Market research: deciding how many customers to survey about satisfaction or purchase intent.
- Opinion polling: national polls of about 1,000 to 1,500 people give a margin near ±3%.
- Healthcare studies: planning how many participants a study needs before it starts.
- Quality inspection: choosing how many items to test from a production batch.
- Employee and student surveys: working out how many replies are needed from a defined group.
What Are the Most Common Mistakes With the Sample Size Calculator?
- Forgetting non-response. If only 20% of people reply, you must contact five times as many as the sample size.
- Treating it as a guarantee. The formula assumes a simple random sample. A biased sampling method cannot be fixed by a larger sample.
- Using it for means. This calculator is for proportions. Sample sizes for estimating a mean depend on the standard deviation.
- Ignoring subgroups. If you want ±5% for each of four regions, you need that sample in each region, not in total.
- Not rounding up. Always round up, never down.
- Hypothesis testing needs more. Detecting a difference between groups requires a power analysis, not just a margin of error.
Where Can You Verify These Formulas?
The definitions and formulas on this page follow standard references. Check them against these sources:
Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.
Frequently Asked Questions
How do you calculate sample size?
For a proportion, n = z² × p × (1 − p) ÷ e², rounded up, where z is the critical value for your confidence level, p is the expected proportion and e is the margin of error.
What sample size do I need for 95% confidence and a 5% margin of error?
About 385 respondents for a large population when p = 50%. For a population of 2,000 the figure drops to 323.
Why use 50% for the expected proportion?
Because p × (1 − p) is largest at 0.5, which gives the biggest, most cautious sample size. It guarantees at least the precision you asked for whatever the true answer is.
Does population size affect sample size?
Only when the population is small. Once the population is in the tens of thousands, the required sample barely changes.
What happens to the sample size if I want a smaller margin of error?
It rises quickly. Halving the margin of error, from ±5% to ±2.5%, roughly quadruples the sample size.
Is a bigger sample always better?
A bigger sample reduces random error, but with diminishing returns, and it does nothing about bias from poor sampling or badly worded questions.