Sample Size

Other Tools

Calculate required sample size

Before running a survey, experiment, or study, one of the most important questions to answer is: how many participants do I actually need? Survey too few people and your results will be too imprecise to trust; survey far more than necessary and you waste time, money, and effort. A sample size calculator solves this problem directly by working backward from your desired precision to the exact number of observations required.

Sample size determination depends on a handful of key factors: how confident you want to be in your results (confidence level), how much error you're willing to tolerate (margin of error), how variable your population is expected to be (often estimated with a proportion near 50%, the most conservative assumption), and in some cases, the total size of the population you're sampling from.

Our sample size calculator handles both proportion-based studies (like customer satisfaction surveys or election polls) and mean-based studies (like measuring average product weight or average response time), instantly returning the minimum number of respondents or observations needed to hit your target precision at your chosen confidence level.

Why Sample Size Matters

Getting sample size right is foundational to any credible research effort, whether academic, commercial, or public-facing:

Survey and market research: Companies need enough responses to confidently generalize findings to their full customer base. Under-sampling produces results with margins of error too wide to act on; over-sampling wastes budget on unnecessary data collection.

Clinical and scientific studies: Underpowered studies (too few participants) may fail to detect real effects, wasting research resources and potentially delaying important findings. Grant applications and ethics boards typically require a documented sample size justification.

A/B testing and product experiments: Running a test with too few users produces noisy, unreliable results that can lead to false conclusions about which product variant performs better.

Quality assurance and auditing: Inspecting a representative sample rather than an entire batch requires knowing exactly how many units must be checked to reach a defined confidence level about the whole batch's quality.

Public health and epidemiology: Health researchers calculate sample sizes to ensure a study has enough statistical power to detect meaningful differences in disease prevalence, treatment efficacy, or risk factors, without exposing more participants than necessary.

Academic thesis and dissertation work: Institutional review boards and thesis committees routinely require students to justify their planned sample size mathematically before data collection begins, making this calculation a required first step rather than an afterthought.

Grant funding and budgeting: Researchers applying for funding must often show that their proposed sample size is large enough to produce statistically meaningful results, directly tying this calculation to whether a study is fundable in the first place.

The Sample Size Formula, Explained

n = (z² × p(1−p)) / E² for proportions; n = (z × σ / E)² for means

Where: z = the z-score for your chosen confidence level (1.96 for 95%), p = the estimated proportion in the population (use 0.5 if unknown, since this maximizes the required sample size and is the safest assumption), E = your desired margin of error (as a decimal), and σ = the estimated population standard deviation for mean-based studies.

The formula is essentially the confidence interval margin-of-error formula solved in reverse: instead of computing the margin of error from a known sample size, you set your desired margin of error and solve for the sample size needed to achieve it. Because n is inversely proportional to E², cutting your target margin of error in half requires quadrupling your sample size — a nonlinear relationship that surprises many first-time researchers.

For sampling from a finite, relatively small population, a finite population correction factor is applied afterward to reduce the required sample size, since sampling a larger share of a small population yields disproportionately more information.

It's worth noting that these formulas calculate a minimum required sample size assuming perfect random sampling and full participation. In practice, researchers often inflate the calculated number to account for expected non-response, dropout, or incomplete surveys, ensuring the final usable sample still meets the target precision.

How to Use the Sample Size: Step by Step

  1. Choose proportion or mean estimation

    Decide whether you're estimating a proportion (e.g., percentage who prefer option A) or a mean (e.g., average satisfaction score on a 1–10 scale).

  2. Set your confidence level

    Choose 90%, 95%, or 99% confidence. 95% is the most common standard for surveys and general research.

  3. Set your desired margin of error

    Enter how much error you're willing to accept, such as ±5%. Smaller margins of error require substantially larger sample sizes.

  4. Enter your estimated proportion or standard deviation

    For proportions, use 50% if you have no prior estimate (this is the most conservative choice). For means, use a standard deviation from prior data or a pilot study.

  5. Apply population correction if relevant

    If your total population is small and known (e.g., 500 employees in a company), enter it to apply a finite population correction that may reduce the required sample size.

Sample Size Examples: Real-World Scenarios

1

General Public Opinion Survey

A pollster wants to estimate public support for a ballot measure with a 95% confidence level and a ±5% margin of error, with no prior estimate of the true proportion (so p = 0.5, the conservative default).

Confidence level:95% (z = 1.96)
Margin of error (E):5% (0.05)
Estimated proportion (p):50% (0.5)

Calculation

n = (1.96² × 0.5 × 0.5) / 0.05² = (3.8416 × 0.25) / 0.0025 = 0.9604 / 0.0025 = 384.16

Result

The pollster needs a minimum of 385 respondents (rounding up) to achieve a ±5% margin of error at 95% confidence.

2

Product Satisfaction Study with a Known Estimate

A company previously found that around 30% of customers were dissatisfied with a feature. They now want a tighter margin of error of ±4% at 95% confidence, using that prior 30% estimate.

Confidence level:95% (z = 1.96)
Margin of error (E):4% (0.04)
Estimated proportion (p):30% (0.3)

Calculation

n = (1.96² × 0.3 × 0.7) / 0.04² = (3.8416 × 0.21) / 0.0016 = 0.80674 / 0.0016 = 504.21

Result

The company needs a minimum of 505 respondents (rounding up) to achieve the desired precision.

3

Sample Size for a Mean — Measuring Average Delivery Time

A logistics company wants to estimate average delivery time with a margin of error of ±3 minutes at 95% confidence. Past data suggests a standard deviation of 15 minutes.

Confidence level:95% (z = 1.96)
Margin of error (E):3 minutes
Standard deviation (σ):15 minutes

Calculation

n = (1.96 × 15 / 3)² = (9.8)² = 96.04

Result

The company needs a minimum of 97 deliveries (rounding up) measured to estimate the average delivery time within ±3 minutes.

Common Mistakes to Avoid

  • Using p = 0.5 unnecessarily when a better estimate is available — 0.5 maximizes required sample size and is only the right default when you have no prior information; using an actual prior estimate (like 30%) can reduce the required sample substantially.
  • Forgetting to round up — sample size formulas produce a minimum requirement, and you should always round up to the next whole participant (385, not 384.16), since a partial respondent doesn't exist.
  • Ignoring expected non-response or dropout rates — if you expect only 70% of invited participants to respond, divide your target sample size by the expected response rate to determine how many people to invite.
  • Applying the infinite-population formula to a very small, fully known population — for small populations, a finite population correction should be applied, which can meaningfully reduce the required sample size.

Tips & Tricks

  • If budget or access limits your sample size, calculate the resulting margin of error at your available sample size instead — the same formula works in reverse to show you the tradeoff you're accepting.
  • For A/B tests, sample size calculations get more complex because you need enough power to detect a meaningful difference between two groups, not just estimate one proportion — use a dedicated A/B test sample size calculator for that case.
  • Pilot studies with as few as 30 participants can give you a working standard deviation estimate to plug into the mean-based sample size formula for your full study.

Choosing the right sample size balances statistical precision against the practical cost of collecting data, and getting it wrong in either direction wastes resources or undermines your conclusions. This calculator gives you the minimum sample size needed for your confidence level and margin of error in seconds, whether you're planning a customer survey, a scientific study, or a quality audit. Calculating sample size before you start collecting data — rather than after — is what separates a defensible study design from one that risks being underpowered or wastefully oversized. Pair it with our confidence interval calculator to analyze your results once the data comes in.

Sample Size — Frequently Asked Questions

Related Calculators

Authoritative References

External links open in a new tab. OmniCalc.us is not affiliated with these organisations.

Related Calculators