Sample Size Calculator
Determine the sample size needed for a target margin of error and confidence.
About Sample Size Calculator
The Cochran formula gives the minimum sample size to achieve a specified margin of error at a given confidence level. For proportions it is n₀ = z² × p(1−p) / e², where p = 0.5 maximises n₀ and is therefore the conservative choice when the true proportion is unknown. When the population is finite and n₀ exceeds 5 % of N, the finite population correction n = n₀/(1+(n₀−1)/N) reduces the requirement.
Formulas
Cochran (proportion)
n₀ = z² × p(1−p) / e²
- z
- Critical z value
- p
- Expected proportion
- e
- Margin of error (decimal)
Cochran (mean)
n₀ = (z×σ/e)²
Finite population correction
n = n₀ / (1 + (n₀−1)/N)
- N
- Population size
Worked example
With the default values below, Sample Size Calculator returns Required sample size (n) of 385. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Population typeone of Proportion (unknown / 50 %), Mean — known σ
- Proportion (unknown / 50 %)
- Confidence level (%)accepts 50–99.9
- 95
- Margin of error (%)accepts 0.1–50
- 5
- Expected proportion (p)accepts 0.01–0.99
- 0.5
- Population std deviation (σ)minimum 0
- 15
- Absolute margin of error (same units as σ)minimum 0
- 3
- Population size (N) — leave 0 for infiniteminimum 0
- 0
Results
- Required sample size (n)Rounded up to guarantee the margin-of-error constraint.
- 385
- n (infinite population)
- 385
- Critical z value
- 1.9600
- Finite population correction applied
- No
Step by step
- 1Critical z value= 1.9600
- 2Cochran formula (infinite population)= 385
- 3Required sample size (rounded up)= 385
Assumptions and limits
- The result is derived only from the 7 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Why do I use p = 0.5 when the proportion is unknown?
The product p(1−p) is maximised at p = 0.5, which produces the largest — and most conservative — sample size estimate. Any other value of p will result in a smaller required sample. By using 0.5 you ensure the margin-of-error target is met regardless of the actual proportion.
What is the finite population correction (FPC)?
For a large population the Cochran formula treats n as if sampling from an infinite pool. When your population is finite and the uncorrected sample would be more than 5 % of N, the FPC shrinks the required n because you are sampling a non-trivial fraction of the total population.
Why is the result always rounded up?
Rounding down would mean your actual margin of error slightly exceeds the target. Rounding up guarantees the margin-of-error constraint — you cannot have a fractional person in a sample.
Does this formula assume simple random sampling?
Yes. The Cochran formula assumes each unit is drawn independently with equal probability. For cluster, stratified or systematic designs the effective sample size differs and you need a design effect (DEFF) correction.
