# Sample Size Calculator

URL: https://hifreetools.com/calculators/sample-size-calculator

> This calculator tells you how many people you need to survey to estimate a proportion at a chosen confidence level and margin of error. Pick 90%, 95% or 99% confidence, set your margin of error and expected proportion, and — if you are sampling a small group — add the total population for a finite-population correction. The default of 95% confidence, ±5% margin of error and a 50% proportion returns the familiar answer of 385.

## Quick answer

To find the sample size for estimating a proportion, use n = (Z² · p · (1 − p)) / E², where Z is the z-score for your confidence level (1.645 for 90%, 1.96 for 95%, 2.576 for 99%), p is the expected proportion as a decimal, and E is the margin of error as a decimal. For 95% confidence, a ±5% margin of error and p = 0.5, that is n = (1.96² × 0.5 × 0.5) / 0.05² = 384.16, which rounds up to 385. If you are surveying a finite population N, multiply through the correction n_adj = n / (1 + (n − 1) / N), which lowers the required sample for small groups.

## Formula

- Sample size for a proportion (large or unknown population): n = (Z² · p · (1 − p)) / E²
- Finite-population correction: n_adj = n / (1 + (n − 1) / N)

The calculator converts your confidence level to a two-sided z-score (90% → 1.645, 95% → 1.96, 99% → 2.576), converts the margin of error and expected proportion from percentages to decimals, and applies n = (Z² · p · (1 − p)) / E². Because a sample size must be a whole number that meets or beats the target precision, the raw value is always rounded up (ceiling). If you supply a finite population N, it then applies the finite-population correction n_adj = n / (1 + (n − 1) / N) and rounds that up too. Leaving p at 50% is the conservative choice: p·(1 − p) is largest at p = 0.5, so it produces the biggest — safest — sample size when you have no prior estimate.

## Examples

- Standard 95% survey (the default): Confidence 95% (Z = 1.96), margin of error E = 5%, proportion p = 50% → n = 385
- Higher precision and confidence: Confidence 99% (Z = 2.576), margin of error E = 3%, proportion p = 50% → n = 1,844
- Finite population correction: Confidence 95% (Z = 1.96), E = 5%, p = 50%, population N = 2,000 → n = 323
- Lower confidence with a skewed proportion: Confidence 90% (Z = 1.645), E = 4%, p = 20% → n = 271

## FAQ

**Why is 385 the standard sample size for a survey?**
It comes from the most common settings: 95% confidence (Z = 1.96), a ±5% margin of error, and p = 50%. Plugging in gives n = (1.96² × 0.5 × 0.5) / 0.05² = 384.16, which rounds up to 385. That single number works for any large population, which is why ‘about 400 responses’ is a frequent rule of thumb.

**Why does the population size barely change the answer for large groups?**
The finite-population correction n / (1 + (n − 1) / N) only shrinks the sample when n is a noticeable fraction of N. For a country of millions, 385 responses is a tiny share, so the correction is negligible — that's why national polls of 30 million or 300 million people use almost the same sample size. It matters mainly for populations under a few thousand.

**What proportion (p) should I use if I have no idea what to expect?**
Use 50% (p = 0.5). The term p(1 − p) is largest at p = 0.5, so it produces the maximum required sample size. Choosing 50% guarantees your margin of error is met no matter what the true proportion turns out to be, making it the conservative, safe default.

**How do confidence level and margin of error each affect the sample?**
Both increase the sample when made stricter, but not equally. Raising confidence swaps in a larger Z (1.96 → 2.576 from 95% to 99%), and since n depends on Z², that alone multiplies the sample by about 1.7. Halving the margin of error makes the required sample about four times larger (n grows with 1/E²). Margin of error is usually the bigger lever.

**Is this the right calculator for estimating an average rather than a percentage?**
No. This formula is for a proportion (a yes/no share or percentage). To size a sample for a mean of continuous data — like average income or height — you need n = (Z · σ / E)², which uses the population standard deviation σ instead of p(1 − p). Use a mean-based sample size formula in that case.

**Should I survey more people than the calculated sample size?**
Often yes. The result is the number of complete, usable responses you need. Because surveys have non-response and unusable answers, invite more people than n — divide n by your expected response rate. For example, if you need 385 responses and expect a 20% response rate, you'd contact about 385 / 0.20 = 1,925 people.


## Sources

- [NIST/SEMATECH e-Handbook of Statistical Methods — Sample sizes for proportions](https://www.itl.nist.gov/div898/handbook/prc/section2/prc242.htm)
- [Wikipedia — Sample size determination](https://en.wikipedia.org/wiki/Sample_size_determination)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Sample Size Calculator", https://hifreetools.com/calculators/sample-size-calculator
