Sample Size Calculator | Best Calculator

Sample Size Calculator

Use 50% if not sure Leave blank if unlimited population size.
Sample Size: -
Formula for Sample Size:
n = (Z² × p × (1 - p)) / E²
Adjusted n = n / (1 + ((n - 1) / N))
Example:
For a population of 1000, confidence level of 95%, margin of error of 5%, and population proportion of 50%, the required sample size is 278.
Copied!

Understanding How Sampling Works

In statistics, we often draw conclusions about a larger group (a population) by analyzing a smaller, selected group (a sample). The assumption is that this sample represents the overall population. For example, if a certain percentage p of people in a population have brown hair, and you sample n people, you can calculate the proportion () of brown-haired individuals in that sample to estimate the true value p.

However, since this estimate is based on just a sample and not the entire population, it’s subject to variation (called sampling error). Fortunately, statistical tools like confidence intervals can help estimate how close is to the actual value of p.

Statistics from a Random Sample

Any random sample introduces uncertainty. In fact, the sample proportion is usually normally distributed, with a mean equal to p and variance equal to p(1-p)/n. This principle is explained by the Central Limit Theorem.

Key terms used in sampling:

  • Confidence Interval: A range around the estimate where the true population value is likely to fall.

  • Confidence Level: The likelihood that the interval includes the actual population value.

For instance, a 95% confidence level means that 95 out of 100 random samples would contain the true proportion.

What is a Confidence Level?

A confidence level expresses how certain we are that the sample reflects the population. Common confidence levels are 90%, 95%, and 99%. Each of these corresponds to a z-score, which you use to calculate confidence intervals.

Common Confidence Levels and Their Z-Scores

Confidence Levelz-score (±)
70%1.04
75%1.15
80%1.28
85%1.44
92%1.75
95%1.96
96%2.05
98%2.33
99%2.58
99.9%3.29
99.99%3.89
99.999%4.42

These values assume a normal distribution of the sampling data.

What is a Confidence Interval?

A confidence interval gives a range that’s likely to contain the true population value. For example, a 95% confidence interval of 40% ± 2% means the true proportion likely falls between 38% and 42%.

Important factors that influence the width of a confidence interval:

  • Sample Size: Larger samples reduce uncertainty.

  • Confidence Level: Higher confidence widens the interval.

  • Variability: Greater variability in data leads to wider intervals.

Different formulas exist depending on the sample size and whether the population’s standard deviation is known. The formula typically used for estimating proportions is:

     CI = p̂ ± z * √(p̂(1 – p̂) / n)

Where:

  • z is the z-score based on the confidence level

  • is the estimated proportion

  • n is the sample size

When the population is finite, a finite population correction (FPC) is used:

     FPC = (N – n) / (N – 1)

This corrects for the fact that each sample point affects the remaining ones.

Example

Suppose there are 120 employees at Company Q, and 85 of them drink coffee daily. To find the 99% confidence interval for the proportion, apply the formula with z = 2.58.

How to Calculate Sample Size

Sample size refers to how many individuals or data points you need in your sample to confidently estimate a population characteristic.

To calculate it, you must:

  1. Choose a confidence level (e.g., 95%).

  2. Decide the margin of error (ε) you can tolerate.

  3. Use the formula below to find the required sample size n:

     n = (z² * p̂(1 – p̂)) / ε²

For finite populations, adjust the sample size using:

     n’ = n / (1 + (n – 1)/N)

Where:

  • z is the z-score

  • ε is the margin of error

  • is the estimated proportion (often 0.5 if unknown)

  • N is the total population size

Sample Size Example

You want to find how many people you need to survey in the U.S. to estimate the number of vegan shoppers with 95% confidence and ±5% margin of error. Assume p̂ = 0.5 and a large population.

Using z = 1.96, the calculation gives a minimum sample size of 385 people. If better estimates are known (e.g., only 6% identify as vegan), use p̂ = 0.06 in the formula.