Math Calculators

Sample Size Calculator

Find the sample size needed for a survey, or compute the margin of error for an existing sample. Supports finite population correction when a population size is provided.

Find Out the Sample Size

This calculator gives out the number of observations required to reach a required confidence level and margin of error.

%
%Use 50% if not sure
Leave blank if unlimited population size.

Find Out the Margin of Error

This calculator gives out the margin of error or confidence interval of observation or survey.

%
Leave blank if unlimited population size.

Sample size calculator guide

A sample size calculator estimates how many observations you need for a survey or study to reach a chosen confidence level and margin of error. It is useful for opinion polls, product research, A/B testing, quality assurance, clinical trials, academic surveys, and any statistical study based on sampling.

The confidence level (usually 90%, 95%, or 99%) reflects how often repeated samples would produce an interval that includes the true population proportion. The margin of error sets how wide that interval is. Smaller margins require larger samples, and higher confidence levels also require larger samples.

The population proportion p is the expected share of respondents who pick a specific answer. If unknown, use 50% because that maximizes required sample size and gives the most conservative estimate.

When the population is finite and small enough to matter, finite population correction (FPC) reduces the required sample. If population size is left blank, the calculation treats the population as unlimited.

A second common task is the reverse problem: given an existing sample size, compute the resulting margin of error at a chosen confidence level. This tool includes both operations in separate sections, each with its own inputs and results panel.

Use the steps area to see formulas, the chosen z multiplier, and intermediate values so your calculation is transparent and easy to report.

How to use

  • Pick the confidence level. 95% is the typical default.
  • Enter margin of error as a percentage (for example, 5 for ±5%).
  • Enter expected population proportion. Use 50% if unsure for the most conservative sample size.
  • Enter population size if known. Leave blank for an unlimited population.
  • To reverse the calculation, enter a sample size in the second section to see the resulting margin of error.

Core formulas

Infinite population: n = z² × p × (1 − p) / e². Finite population correction: n_adj = n / (1 + (n − 1) / N). Margin of error: e = z × √(p(1 − p) / n), with FPC multiplier √((N − n) / (N − 1)) when N is known.

Notes and limitations

  • Results assume simple random sampling and a normal approximation using z multipliers.
  • When p is unknown, use 50% for the most conservative (largest) sample.
  • If the population size is very large, finite population correction has little effect.
  • For small populations or stratified, clustered, or complex designs, additional adjustments may apply.

FAQ

What if I do not know the population proportion?

Use 50% because it maximizes variance p(1 − p) = 0.25 and produces the largest (most conservative) sample size.

Do I need the population size?

Only for finite population correction. If you leave it blank, the tool assumes an effectively infinite population.

Which confidence level should I pick?

Common choices are 90%, 95%, and 99%. Higher levels need more data for the same margin of error.

Can I solve for margin of error directly?

Yes. The second section computes the margin of error given your sample size and confidence level.