Sample Size Calculator
How to Use the Sample Size Calculator
- Pick a mode: Calculate Sample Size to find how many responses you need, or Calculate Margin of Error to see how precise an existing sample is.
- Choose a confidence level. 95% is a common choice.
- Enter the margin of error (sample size mode) or the number of responses you have (margin of error mode).
- Enter the population proportion. Leave it at 50% if you do not know it.
- If your population is small and known, enter its size. Otherwise leave the field empty.
- Click Calculate. Use Load Example to fill in sample values, and Clear to start over.
Understanding the Input Fields
Confidence Level
How sure you want to be that the true value falls inside your margin of error. At 95%, if you repeated the survey many times, about 95 of every 100 results would land within that margin. Higher confidence needs a larger sample.
Margin of Error
The amount of uncertainty you accept, in percentage points. If 60% of respondents say yes and the margin of error is 5%, the true figure is likely between 55% and 65%.
Population Proportion
Your best guess of the share of the population with the trait you are measuring, such as 30% of customers who prefer a product. The 50% setting assumes the most variation and so gives the biggest sample.
Population Size
The total number of people or items you want to learn about, such as 2,000 employees. It matters mostly when your sample would be a large part of the population.
Sample Size
The number of responses or observations you collect or plan to collect.
Tips and Suggestions
- A 95% confidence level is widely used in surveys and research.
- A smaller margin of error needs a larger sample. Halving the margin of error roughly quadruples the sample size.
- Use 50% for the population proportion when the real value is unknown.
- Enter the population size when you study a known, limited group, such as a school or a company.
- Leave population size blank when the group is very large or you cannot count it.
- Choose a sample that suits your research goal and sampling method. Random selection works best with these formulas.
Understanding the Result
The required sample size is the minimum number of completed responses needed to reach your chosen confidence level and margin of error. Collecting more is fine; collecting fewer widens the margin of error.
The margin of error shows how far your sample result may be from the true population value, in either direction, at the chosen confidence level.
These numbers only describe random sampling error. A correct sample size does not remove bias from poor question wording, non-response, or a sample that leaves out parts of the population, and it does not guarantee the survey represents everyone.
Formula and Calculation Method
Sample size for an unlimited population:
n₀ = z² × p × (1 − p) / e²
With a known population size N, apply the finite population correction:
n = N × n₀ / (N + n₀ − 1)
Margin of error for an unlimited population:
e = z × √[ p × (1 − p) / n ]
With a known population size N:
e = z × √{ [ p × (1 − p) / n ] × [ (N − n) / (N − 1) ] }
Here z is the z-score for the confidence level, p is the proportion and e is the margin of error, both as decimals, and n is the sample size. Required sample sizes are always rounded up to the next whole number.