Sample Size Calculator
Survey proportion · Mean · Margin of error · Power for two groups
👥 Enter a confidence level and margin of error to see how many responses you need.
What Is Sample Size?
Sample size is the number of people, items, or measurements you include in a study. A sample that is too small gives estimates with a wide margin of error. A sample that is too large wastes time and money without adding much precision, because the margin of error shrinks only with the square root of n.
The required sample size depends on three choices: how confident you want to be (the confidence level), how close you want the estimate to be to the true value (the margin of error), and how much the answers vary (p for a yes or no question, σ for a measurement). Population size matters only when the population is small. This calculator answers the question "how many people should I survey?" and the related question "what margin of error does my sample give?"
How to Use the Sample Size Calculator
- Proportion: for surveys and polls with yes or no answers or percentages. Enter the margin of error in percentage points and the expected proportion. Keep 50% if you have no prior estimate.
- Mean: for measurements such as weight, time, or income. Enter the margin in the same units as the data and an estimate of the standard deviation σ.
- Margin: works in reverse. Enter a sample size you already have, or can afford, to see the margin of error it gives.
- Power: for experiments that compare two group means or test one mean against a target. Enter the smallest difference worth detecting, σ, and the power you want.
Add a population size only when you know it and it is small, such as 800 employees. The response rate converts completed responses into the number of people to contact: 385 completes at a 25% response rate means 1,540 invitations.
Sample Size Formulas
Sample Size Table by Margin of Error
Completed responses needed for a large population with p = 50%. These are the most common survey sample sizes.
| Margin | 90% | 95% | 99% |
|---|---|---|---|
| ±1% | 6,764 | 9,604 | 16,588 |
| ±2% | 1,691 | 2,401 | 4,147 |
| ±3% | 752 | 1,068 | 1,844 |
| ±4% | 423 | 601 | 1,037 |
| ±5% | 271 | 385 | 664 |
| ±7% | 139 | 196 | 339 |
| ±10% | 68 | 97 | 166 |
Halving the margin multiplies the sample by four. Critical z values: 1.645 at 90%, 1.960 at 95%, 2.576 at 99%.
How to Calculate Sample Size Manually
- Pick the confidence level and find z: 1.645 for 90%, 1.960 for 95%, 2.576 for 99%.
- Write the margin of error as a decimal: ±4% becomes 0.04.
- Choose p (use 0.5 if unknown) or estimate σ for a mean.
- Calculate n₀ with the proportion or mean formula.
- If the population N is known and small, apply n = n₀ ÷ (1 + (n₀ − 1) ÷ N).
- Round up, never down, then divide by the expected response rate.
Worked example. A researcher surveys a town of 2,000 residents at 95% confidence with a ±4% margin and p = 0.5. Step 4 gives n₀ = 1.96² × 0.25 ÷ 0.04² = 3.8415 × 0.25 ÷ 0.0016 = 600.23. Step 5 gives 600.23 ÷ (1 + 599.23 ÷ 2,000) = 600.23 ÷ 1.2996 = 461.85, so 462 completed responses. With a 40% response rate she should invite 462 ÷ 0.40 = 1,155 residents.
Does Population Size Matter?
Less than most people expect. The table shows completed responses needed at 95% confidence.
| Population N | ±5% | ±3% |
|---|---|---|
| 100 | 80 | 92 |
| 500 | 218 | 341 |
| 1,000 | 278 | 517 |
| 5,000 | 357 | 880 |
| 10,000 | 370 | 965 |
| 100,000 | 383 | 1,056 |
| Unlimited | 385 | 1,068 |
A national poll of millions and a city poll of 100,000 need almost the same sample. The correction matters once n₀ is more than about 5% of N.
Choosing p, the Margin, and the Response Rate
Expected proportion. The product p(1 − p) peaks at 0.25 when p = 0.5, so 50% always gives a sample large enough. If a pilot shows about 10%, p(1 − p) = 0.09 and the sample drops by 64%.
Margin of error. ±5% is common for internal surveys, ±3% for published polls. Pick the margin that would change your decision; a 52% versus 48% split needs a margin under ±2% to call.
Response rate. The formulas give completed responses. Divide by the expected response or retention rate to get the number of people to contact or enroll.
Sample Size for Comparing Two Groups (Power Analysis)
When an experiment compares two groups, the question changes from "how precise?" to "how likely am I to detect a real difference?". Power (1 − β) is the probability that the test finds a difference of size Δ when it exists. 80% is the usual minimum and 90% is common in clinical trials. α, the false positive risk, equals 1 minus the confidence level.
For two independent groups the sample size per group is 2(z₁₋α/₂ + z₁₋β)² σ² ÷ Δ². For one sample compared with a fixed target, drop the factor of 2. Use z₁₋α instead of z₁₋α/₂ for a one sided test. The ratio Δ ÷ σ is the standardized effect size d: halving d multiplies the sample by four.
These formulas use z and assume σ is known. With small samples, t critical values are larger, so the calculator also iterates with t until n settles. The NIST one sample example (one sided, α = 0.05, 90% power, Δ = σ) gives 8.57 → 9 with z and about 11 with t.
Common Mistakes
- Rounding down. 384.15 must become 385. Rounding to 384 leaves the margin slightly above target.
- Entering the margin as a whole number in the formula. ±5% is 0.05 in n = z²p(1 − p) ÷ E². Using 5 gives a sample of 0.04.
- Confusing completed responses with invitations. At a 20% response rate, 385 completes require 1,925 contacts.
- Ignoring subgroups. If you will report men and women separately, each subgroup needs its own sample for the same margin.
- Guessing σ too low. Underestimating σ by 20% cuts the sample by 36%. When unsure, use a larger σ from a pilot or published study.
Frequently Asked Questions
Sources & References
- NIST/SEMATECH. Engineering Statistics Handbook, 7.2.2.2 Sample Sizes Required itl.nist.gov
- OpenStax. Introductory Statistics 2e, 8.3 A Population Proportion openstax.org
- Penn State. STAT 415, 6.3 Estimating a Proportion for a Small, Finite Population online.stat.psu.edu
- Penn State. STAT 509, 6a.5 Comparative Treatment Efficacy Studies online.stat.psu.edu
Results are estimates for planning and assume simple random sampling. They are not a substitute for advice from a statistician on a complex design. Methodology reviewed: 2026.