Sample Size Calculator
Enter a confidence level, a margin of error and an expected proportion. The result is the number of observations Cochran’s formula asks for, rounded up.
How it works
This is a sample-size plan for a single proportion, using a normal (z) approximation — not a t-interval for a mean. n = z² p (1−p) / E², then rounded up to the next whole person. p is the expected proportion (0.5 if unknown, which maximises n).
E is the margin as a decimal (5% → 0.05). z comes from the two-sided normal quantile for the confidence level (1.96 at 95%). If you supply a finite population N, the page applies n′ = n / (1 + (n−1)/N).
Formula
n = z² p (1 − p) / E² n′ = n / (1 + (n − 1) / N) (optional FPC) Then round up.
Worked examples
A typical opinion poll
95% confidence, p = 50%, E = 5% → 385
Useful notes
- This is not a power calculation for a clinical trial or an A/B test.
- z values are two-sided standard-normal quantiles.
FAQ
- Why use 50% for the proportion?
p(1−p) is largest at 0.5, so the sample size is conservative when you do not know the outcome rate.
- What does the margin of error mean?
It is the plus-or-minus around the estimated percentage, not a percentage of the population size.
- When do I fill in population?
When the group is small enough that sampling without replacement shrinks the needed n. Leave it blank for a large or unknown population.
Related tools
Confidence Interval
Build a z-interval for a mean from x̄, a standard deviation, n and a confidence level.
Z-score Calculator
Convert a value to a z-score, or a z-score back to the original scale, given a mean and standard deviation.
Probability Calculator
Combine two event probabilities as independent, mutually exclusive, or overlapping, plus complements and “at least one”.
See all Statistics tools.