SwiftCalculators Header
Statistics & Probability

Sample Size Calculator

Determine the minimum number of samples needed for your survey, or find the margin of error of a given sample size with our free tool.

⚡ Fast & Accurate 🔒 100% Private 📱 Mobile Friendly
%
%
📊

Ready to Calculate

Enter your details to find your required Sample Size or Margin of Error.

REQUIRED SAMPLE SIZE
0 samples
ℹ️ Unlimited Population Formula
Key Insight

To achieve a 95% confidence level with a 5% margin of error, you need at least 385 samples.

Z-Score
Used in formula
Variance
p(1-p)
Correction
Finite Pop Factor

What is the Sample Size Calculator?

In statistics, it's rarely feasible to survey an entire population. Instead, information is inferred by studying a finite number of individuals from that population—this subset is called a sample. The Sample Size Calculator helps you determine the optimal number of participants you need to survey to achieve statistically significant and reliable results.

This tool also functions in reverse: if you already know how many people you surveyed, you can calculate the Margin of Error associated with your data, providing a clear picture of its precision.

How to Use This Calculator

Our tool operates in two distinct modes depending on your objective:

Finding Sample Size

  1. Select Confidence Level: The standard is 95%. This indicates you are 95% confident that the true population value lies within your margin of error.
  2. Enter Population Proportion: This is the expected variance. If you aren't sure, use 50% as it yields the most conservative (largest) sample size.
  3. Set Margin of Error: Also known as the confidence interval. A 5% margin means if the survey finds 60% agree, the real answer is between 55% and 65%.
  4. Population Size (Optional): If you are surveying a small, finite group (e.g., a company of 500 employees), enter it here. Leave blank for large or infinite populations.

Finding Margin of Error

  1. Switch the top toggle to Find Margin of Error.
  2. Enter your target Confidence Level and Population Proportion as described above.
  3. Input your actual Sample Size (the number of respondents you successfully surveyed).
  4. Enter your Population Size if it is a known, finite group to apply the finite population correction.

The Formulas / The Science

The uncertainty in a given random sample is summarized by stating that the estimate is normally distributed. To determine exactly how many samples are needed, or what the margin of error is, statisticians rely on standard Z-scores and probability equations derived from the Central Limit Theorem.

Unlimited Population Formula

Sample Size (n): n = (z² × p(1 - p)) / ε²

Margin of Error (ε): ε = z × √((p(1 - p)) / n)

Finite Population Formula

When measuring a small population, it cannot be assumed that all individuals in a sample are entirely independent. A Finite Population Correction (FPC) factor is applied:

Sample Size (n'): n' = n / (1 + (n - 1) / N)

Margin of Error (ε'): ε' = z × √((p(1 - p)) / n) × √((N - n) / (N - 1))
  • z = Z-score matching the chosen confidence level (e.g., 1.96 for 95%)
  • p = Population Proportion (expressed as a decimal, e.g., 0.50)
  • ε = Margin of Error (expressed as a decimal, e.g., 0.05)
  • N = Total Population Size
  • n = Required Sample Size

Frequently Asked Questions

The confidence level is the probability that the true value being studied falls within your specified margin of error. For example, a 95% confidence level means that if you repeated the survey 100 times under the same conditions, 95 of those times the results would match the general population within the stated margin of error.

The margin of error (or confidence interval) expresses the amount of random sampling error in a survey's results. If a poll indicates that 40% of people favor an initiative with a 5% margin of error, the true support level in the population likely falls between 35% and 45%.

The population proportion (p) refers to the expected outcome. Because the mathematical variance is highest when p = 50% (since 0.5 × 0.5 = 0.25 is the maximum possible value for p(1-p)), using 50% gives you the most conservative, safest sample size estimate to ensure your constraints are met.

Surprisingly, population size rarely matters unless you are surveying a relatively small group. The math behind sample sizes shows that once a population is large enough (e.g., over 100,000), the required sample size plateaus. You need roughly the same sample size to survey a population of 1 million as you do for 100 million.

Z-scores correspond to specific confidence levels in a normal distribution curve. Common Z-scores include: 90% = 1.645, 95% = 1.96, and 99% = 2.576. Our calculator automatically applies the correct, highly precise Z-score based on your dropdown selection.