Mihsaba›Statistics & Probability›Sample Size Calculator

Sample Size Calculator

Calculate the minimum sample size for estimating a proportion or mean from confidence level and margin of error, with optional finite-population correction.

Share this free calculator

Send this tool to someone who needs the calculation.

How to use

Sample-size planning estimates the minimum number of observations needed for a target confidence level and margin of error when estimating a proportion or mean under simple random sampling.

  1. Choose proportion or mean.
  2. Set confidence level and margin of error, then p for a proportion or σ for a mean.
  3. Optionally enter finite population size and use the final result rounded up.

How it is calculated

proportion n₀=z²p(1−p)/E²; mean n₀=(zσ/E)²

Example

For an unknown proportion at 95% confidence and ±5 percentage-point margin, p=0.5 gives n₀≈384.15, so 385 completed responses are required before any finite-population correction.

Important notes

This is a margin-of-error sample-size calculator, not a statistical-power calculator for hypothesis testing. Clustered, stratified or nonresponse-adjusted designs can require additional corrections.

Worked examples and interpreting results

For an expected proportion of 50%, margin 5 percentage points and 95% confidence, the initial size is about 384.146, rounded up to 385 completed observations without a finite population input.

Worked examples and interpreting results
CaseCalculationResult
Unrounded size1.95996398454² × 0.5 × 0.5 ÷ 0.05²384.145882
Required sizeceil(384.145882)385

How to check the result

Select proportion and leave population blank. This approximates a simple random sample; design effects and nonresponse require separate adjustments. Margin 5% here means five percentage points.

Frequently asked questions

Why use p=0.5 when the proportion is unknown?

It maximizes p(1−p) and therefore gives the most conservative proportion sample size.

Why round up?

A fractional sample cannot meet the target; the next whole observation is required.

When should I use finite-population correction?

When the total population is known and bounded and sampling is effectively without replacement.

Why does sample size rise when margin of error shrinks?

Higher precision requires more information. In common formulas, sample size is roughly inversely proportional to the square of margin of error, so halving the margin can require about four times the sample.