Math calculator

Free sample size calculator

Calculate the required sample size for your survey or study — enter your confidence level, margin of error, and population proportion to see the minimum sample needed, updated live, as you type.

InputsLive
Confidence level
Margin of error
%
Estimated proportion
0 to 1 (use 0.5 for worst-case / unknown).
Result
Required sample size
385
95% confidence, ±5% margin, p=0.5
Confidence level95%
Margin of error±5%
Est. proportion0.5
Sample size (n)385

For proportion surveys. Uses z-score: 1.645 (90%), 1.96 (95%), 2.576 (99%).

Results are estimates. Consult a professional.

How it's calculated

How the sample size calculator works

Sample size determines how many observations you need to achieve a desired level of statistical precision. Too few and your results are unreliable; too many and you waste time and resources. This calculator computes the minimum sample size for estimating a proportion or a mean, given a confidence level and margin of error.

For proportions: n =× p × (1 p) ÷
For means: n =× σ² ÷
where z = critical z-value, p = estimated proportion, E = margin of error, σ = std deviation
Conservative estimate (unknown p): use p = 0.5, which maximises n
Cochran, W.G. (1977) Sampling Techniques, 3rd ed. — standard sample size formulas
Example

Worked example: survey with 95% confidence, ±5% margin

Example: 95% confidence, ±5% margin, unknown proportion

A market researcher wants to estimate the proportion of customers who prefer a new product. She needs 95% confidence with a ±5% margin of error. Since the true proportion is unknown, she uses the conservative p = 0.5.

z = 1.96 (95% confidence level)
p = 0.5 (conservative, maximises required n)
E = 0.05 (5% margin of error)
n = 1.96² × 0.5 × 0.5 ÷ 0.05²
n = 3.8416 × 0.25 ÷ 0.0025
n = 0.9604 ÷ 0.0025 = 384.16 → 385 respondents
385 respondents
With 385 survey responses you can estimate the proportion with ±5% accuracy at 95% confidence. Knowing the approximate proportion in advance can reduce this number.
Quick reference

Required sample sizes by confidence and margin of error

The table below shows minimum sample sizes (n) for estimating a proportion, using p = 0.5 (worst case). Actual requirements are lower if the proportion is far from 0.5.

Confidence level±3% margin±5% margin±10% margin
90%75227168
95%1,06838597
99%1,849666166

Calculated using n = z² × 0.25 ÷ E² with p = 0.5. Round all values up. Finite population correction may reduce these figures for small populations.

Practical tips

Tips for planning your sample size

A well-chosen sample size balances statistical power with practical constraints. These tips help you plan efficiently.

  • Use a prior estimate of p if available — if past research suggests p ≈ 0.3, use that instead of 0.5; it will reduce the required sample size significantly.
  • Account for non-response — if you expect a 70% response rate, divide your calculated n by 0.70 to determine how many people to contact.
  • Apply finite population correction for small populations — if the population N is small relative to n, use n_adj = n ÷ (1 + (n−1) ÷ N) to reduce the required sample.
  • Budget for attrition in experiments — in longitudinal studies, some participants drop out; add 10–20% to the sample size to maintain power at the end.
  • Set α and power before recruiting — for hypothesis tests, also specify desired power (typically 80% or 90%) in addition to α, and use power-based sample size formulas.
Accuracy & limits

Accuracy and limitations

These formulas assume simple random sampling from a large or infinite population. For stratified, cluster, or systematic sampling designs, the required sample size differs and typically requires specialist software. The proportion formula assumes the normal approximation to the binomial is valid, which holds when both np and n(1−p) are at least 10. For very small populations, apply the finite population correction factor. These calculations give the minimum n for estimation; hypothesis testing (power analysis) may require a larger sample depending on the expected effect size.

Glossary

Key terms

The number of observations or respondents in your study. Larger n gives narrower confidence intervals and more reliable estimates.
The maximum expected difference between the sample estimate and the true population value, at the chosen confidence level.
The fraction of the population with a particular characteristic. Unknown before the study; p = 0.5 is the conservative default.
The percentage of repeated studies whose intervals would contain the true value. Commonly 90%, 95%, or 99%.
An adjustment that reduces required sample size when the population N is small relative to n — n_adj = n ÷ (1 + (n−1) ÷ N).
The probability of correctly rejecting a false null hypothesis. Typically set at 80% or 90% in power-based sample size calculations.
About

About this calculator

Part of our math calculators suite — explore all calculators.

Questions

Frequently asked questions about the free sample size calculator

A sample size calculator is a free online tool that helps you calculate required sample size for a survey. Standard sample-size formula for proportions. It runs entirely in your browser with instant results and no sign-up.
JavaScript double-precision floating-point — accurate to about 15-17 significant digits. For arbitrary precision, use the Big Number calculator.
The statistics calculator computes population variance (divides by n). For sample variance, multiply variance by n/(n-1).

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.