ToolPatch

One page. One job. Done.

← Back to all tools
Statistics

Sample Size Calculator

Estimate required sample size from confidence level, margin error, and proportion.

Formula reviewed: 2026-02-14 Statistics

Sample Size Calculator estimates how many observations are needed to measure a proportion with a chosen confidence level and margin of error. Confidence level controls how much uncertainty the interval allows, margin of error is the maximum acceptable distance between the estimate and the true population value, and estimated proportion is the expected share of responses or outcomes. The most conservative proportion is often 50%, because it produces the largest required sample when the true proportion is unknown. Population size matters mainly for smaller finite populations; for very large populations the finite correction becomes negligible. This calculator is useful for surveys and experiments, but representativeness, nonresponse, selection bias, and measurement quality are just as important as the numeric sample size.

Permalink

Input Pattern

Enter values in the left panel, keep units explicit, run the calculation, then copy or share the result. Invalid fields are highlighted immediately.

How to use this tool

  1. Enter Confidence, Margin error (%), Estimated proportion (%), Population size (optional, 0 for infinite) for the sample size calculator, keeping units, dates, or text format consistent with the form labels.
  2. Confirm sample size, ordering, and distribution assumptions before relying on the calculated result.
  3. Click "Run the tool" and review Sample Size Inputs, Result for the primary output.
  4. Check the statistical assumptions and sample context before using the result in a report or decision.

Sample Size Inputs

Result

Infinite population n: 385

Adjusted n: 385

Sample Size and Statistical Precision

Why Sample Size Matters

Sample size determines how precisely a study can estimate an unknown value or detect an effect. More observations reduce random sampling error, but the improvement follows a square-root relationship. To cut standard error in half, a study generally needs about four times as many observations.

This diminishing return is why sample planning matters. Too small a sample can produce vague or misleading results. Too large a sample can waste money, time, and participant attention while detecting differences too small to matter practically.

Confidence, Margin, and Variability

For estimation, sample size depends on desired confidence level, margin of error, and variability. Higher confidence requires more data. A smaller margin of error requires more data. More variable populations require more data because individual observations are less consistent.

For proportions, uncertainty is largest near 50 percent because outcomes are most mixed. For means, the standard deviation controls uncertainty. Pilot studies, historical data, or conservative assumptions are often used when variability is unknown.

Power and Effect Size

For hypothesis testing, sample size planning often uses statistical power: the probability of detecting an effect if it truly exists. Power depends on effect size, variability, significance threshold, and sample size. Smaller effects require more data to detect reliably.

A study should define the smallest effect worth detecting before collecting data. Otherwise it may be powered for an effect that is statistically interesting but operationally irrelevant, or underpowered for the decision it is supposed to support.

Design Beats Raw Count

A large biased sample can be worse than a smaller representative one. Sampling method, nonresponse, clustering, measurement quality, and randomization affect validity. If observations are highly correlated, the effective sample size may be much smaller than the row count suggests.

Good sample-size planning starts with the decision, defines the target population, chooses the metric, and then computes the data needed. The calculation is only the arithmetic layer of study design.

How to interpret the result

Confidence and limitations

Formula References

Assumptions

Explore more versions

Tailored guides for specific audiences, regions, and scenarios.

Related tools and workflows