📊 Sample Size Calculator free & instant

From a standard deviation or a survey proportion

For educational use. Double-check results that matter — rounding and input assumptions can shift an answer.
📊

Sample Size Calculator

From a standard deviation or a survey proportion

📊Enter values and click Calculate
Related Calculators
📊
Standard Deviation
Spread of a data set
→
📏
Average Calculator
Mean, median & mode
→
%
Percentage Calculator
Percent of, change & more
→
⚖
Ratio Calculator
Simplify and solve
→

What sample size means

Sample size is the number of observations you need so that an estimate from the sample lands within a chosen distance of the true population value, with a chosen level of confidence. Too few and the result is noise; too many and you have paid for precision you did not need.

Three things set the answer: how confident you want to be, how much error you can tolerate, and how variable the thing you are measuring is.

Sample size formula with a standard deviation (estimating a mean)

When the goal is to estimate an average — a mean weight, delivery time or test score — and you have an estimate of the population standard deviation σ:

n = (z × σ ÷ E)²

Here z is the z-score for the confidence level, σ is the standard deviation and E is the margin of error in the same units as the measurement. Always round the result up.

Worked example: test scores have a standard deviation of about 15 points and you want the sample mean within 3 points of the true mean at 95% confidence. n = (1.96 × 15 ÷ 3)² = 9.8² = 96.04, so you need 97 people.

Notice the squared term. Halving the margin of error to 1.5 points does not double the sample — it quadruples it, to 385.

Sample size formula for a proportion

When the result is a percentage — the share who answer yes, the defect rate, a conversion rate:

n = z² × p × (1 − p) ÷ E²

p is the proportion you expect, as a decimal. If you have no idea, use 0.5: it maximises p(1 − p) and so gives the largest, safest sample. At 95% confidence and a ±5% margin that is 1.96² × 0.25 ÷ 0.05² = 384.16, rounded up to 385 — the figure quoted for most opinion surveys.

Z-scores for common confidence levels

Confidence levelz-scoren for ±5% (p = 0.5)n for ±3% (p = 0.5)
90%1.645271752
95%1.9603851,068
99%2.5766641,844

Small populations: the finite population correction

The formulas above assume the population is very large. When you are sampling from a small, known group — 800 employees, 2,000 customers — you need fewer responses, because each one covers a meaningful share of the whole:

n = n₀ ÷ (1 + (n₀ − 1) ÷ N)

n₀ is the uncorrected sample size and N is the population. For N = 2,000 and n₀ = 384.16 the corrected sample is 384.16 ÷ 1.1916 = 322.4, so 323. For populations above roughly 20,000 the correction barely changes the answer, which is why a national poll needs about the same sample as a city poll.

Where the standard deviation comes from

The formula needs σ before any data has been collected, which looks circular. In practice there are three sources: a previous study of the same measurement, a small pilot sample (calculate it with the standard deviation calculator), or the range rule of thumb — roughly (largest plausible value − smallest) ÷ 4.

If you are unsure, overestimate. A standard deviation that is too large only costs a few extra observations; one that is too small leaves you with a margin of error wider than you planned.

What the number does not cover

Sample size controls random sampling error only. It does nothing for a biased sample: 5,000 responses from a self-selected group can be less accurate than 400 chosen at random. Also allow for non-response — if you expect 30% of people to reply, invite n ÷ 0.30. For clinical trials and A/B tests, which compare two groups and need a power calculation, use a method designed for that purpose and consult a statistician.

Frequently Asked Questions

How do I calculate sample size with a standard deviation?

Use n = (z times sigma divided by E) squared, where z is the z-score for your confidence level, sigma is the standard deviation and E is the margin of error. Round the result up to the next whole number.

What sample size do I need for 95% confidence and a 5% margin of error?

385 for a large population, using the proportion formula with p = 0.5. For a smaller, known population the finite population correction reduces it, for example to 323 for a population of 2,000.

Why should I use 0.5 when I do not know the proportion?

Because p times (1 minus p) is largest at 0.5, which produces the largest required sample. Any other true proportion would need fewer responses, so 0.5 is the safe choice.

Does a bigger population need a bigger sample?

Only up to a point. Once the population is above about 20,000 the required sample barely changes, because sampling error depends on the size of the sample, not the size of the population.

Why do I always round the sample size up?

Rounding down would give a margin of error slightly wider than the one you specified. Rounding up guarantees the target precision is met.