Sample Size Calculator
A sample size calculator tells you how many responses you need for a chosen margin of error and confidence level. For a survey, n = z² × p(1 − p) ÷ E². At 95% confidence (z = 1.96), a ±5% margin and p = 50%: 1.96² × 0.25 ÷ 0.05² ≈ 384.15, which rounds up to 385 responses. The tabs below also handle means and two-group studies with power.
#963; = 12.
| Margin of error | Sample size |
|---|---|
| ±1% | 9,604 |
| ±2% | 2,401 |
| ±3% | 1,068 |
| ±4% | 601 |
| ±5% | 385 |
| ±7.5% | 171 |
| ±10% | 97 |
Show steps
- Look up the z-score for 95% confidence: z ≈ 1.9600. It leaves 2.5% in each tail of the normal curve.
- Write the margin of error and the proportion as decimals: E = 5% = 0.05, p = 50% = 0.5, so p(1 − p) = 0.5 × 0.5 = 0.25.
- Compute n₀ = z² × p(1 − p) ÷ E² = 3.8415 × 0.25 ÷ 0.0025 ≈ 384.15.
- Always round up, never down, so the margin of error is met: n = 385.
How to use the sample size calculator
- Pick what you need: a survey sample size, the margin of error for a sample you already have, the sample size for estimating a mean, or the size of two groups you want to compare.
- Choose a confidence level. 95% is the usual choice.
- Enter the margin of error and your best guess of the proportion (keep 50% if you have no idea) or the standard deviation.
- Add the population size if it is small, and your expected response rate if you are sending invitations.
- Read the answer, open Show steps for the working, and use the table to see how other choices change the number.
Sample size formula for a survey (proportion)
n₀ = z² × p(1 − p) ÷ E², where:
- z is the z-score for your confidence level (1.96 for 95%).
- p is the proportion you expect, as a decimal. Using 0.5 gives the largest p(1 − p) = 0.25, so it is the safe choice.
- E is the margin of error as a decimal (5% = 0.05).
Always round up. Rounding 384.15 down to 384 would give a margin slightly wider than ±5%.
Finite population correction
When the population is small, you need fewer responses. The corrected size is n = n₀ ÷ (1 + (n₀ − 1) ÷ N), where N is the population size. This is the same formula Penn State’s survey sampling course writes as n = N·p(1 − p) ÷ ((N − 1)E² ÷ z² + p(1 − p)). For a company of 1,000 employees, 384.15 ÷ (1 + 383.15 ÷ 1,000) ≈ 277.73, so you need 278 responses instead of 385.
Sample size by population size
At 95% confidence, ±5% margin and p = 50%:
| Population size | Sample size needed |
|---|---|
| 100 | 80 |
| 500 | 218 |
| 1,000 | 278 |
| 5,000 | 357 |
| 10,000 | 370 |
| 100,000 | 383 |
| Very large or unknown | 385 |
Above a few thousand people, the population size hardly matters. A national poll needs about the same sample as a poll of one large city.
Z-scores for common confidence levels
| Confidence level | z-score | n for ±5% (p = 50%) | n for ±3% (p = 50%) |
|---|---|---|---|
| 80% | 1.2816 | 165 | 457 |
| 85% | 1.4395 | 208 | 576 |
| 90% | 1.6449 | 271 | 752 |
| 95% | 1.9600 | 385 | 1,068 |
| 98% | 2.3263 | 542 | 1,504 |
| 99% | 2.5758 | 664 | 1,844 |
| 99.9% | 3.2905 | 1,083 | 3,008 |
The z-score leaves half of the remaining probability in each tail of the normal curve: for 95%, 2.5% in each tail. The z-score calculator shows where these values sit on the curve.
Margin of error from a sample size
Turn the formula around to check a poll you already have: E = z × √(p(1 − p) ÷ n). With 1,000 responses and p = 50%, E = 1.96 × √(0.25 ÷ 1,000) ≈ 0.031, or ±3.1 percentage points. With a finite population, multiply by √((N − n) ÷ (N − 1)). To turn your actual counts into a full interval, use the confidence interval for a proportion calculator.
Sample size for estimating a mean
When you measure a quantity (a score, a weight, a time), the formula uses the standard deviation σ instead of p: n = (z × σ ÷ E)², where E is the margin of error in the same units. NIST’s Engineering Statistics Handbook gives the 95% version as N ≥ (1.96 ÷ δ)² σ². For σ = 15 points and E = ±3 points at 95% confidence: (1.96 × 15 ÷ 3)² ≈ 96.04, so you need 97. The finite-population version is n = 1 ÷ (E² ÷ (z²σ²) + 1 ÷ N). After you collect the data, the confidence interval calculator gives the interval for the mean.
Sample size for comparing two groups (power analysis)
To test whether two groups differ, the sample size also depends on power: the chance of detecting a real difference of the size you care about. With significance level α and power 1 − β, the z-approximation formulas for equal groups are:
- Two proportions: n per group = (zα/2 + zβ)² × [p₁(1 − p₁) + p₂(1 − p₂)] ÷ (p₁ − p₂)².
- Two means: n per group = 2σ²(zα/2 + zβ)² ÷ δ², where δ is the difference in means you want to detect.
For a one-sided test, replace zα/2 with zα. At α = 0.05 (two-sided) and 80% power, zα/2 = 1.96 and zβ ≈ 0.8416, so (zα/2 + zβ)² ≈ 7.849.
Example: raising a conversion rate from 10% to 15%
The variances add to 0.1 × 0.9 + 0.15 × 0.85 = 0.2175, and the difference is 0.05. So n = 7.849 × 0.2175 ÷ 0.0025 ≈ 682.85, which rounds up to 683 per group, or 1,366 in total. Asking for 90% power raises this to 915 per group.
Example: a 5-point difference in test scores
With σ = 12 and δ = 5: n = 2 × 144 × 7.849 ÷ 25 ≈ 90.42, so 91 students per group. After the study, the p-value calculator helps you read the test result.
Steps to choose a sample size
- Decide what you are estimating or testing: a proportion, a mean, or a difference between groups.
- Pick the confidence level (or α) and, for comparisons, the power. 95% and 80% are common defaults.
- Choose the margin of error or the smallest difference worth detecting. This choice drives the answer more than anything else.
- Estimate p or σ from a pilot study or earlier data. If unsure, use p = 50% or a larger σ.
- Calculate n, round up, and divide by the expected response rate. For example, 385 completed surveys at a 20% response rate means about 1,925 invitations.
Common sample size mistakes
- Rounding down. Always round up, or the margin of error is missed.
- Confusing responses with invitations. The formula gives completed responses.
- Thinking bigger fixes bias. A large sample of volunteers can still be unrepresentative. The formulas assume a random sample.
- Using the overall margin for subgroups. If you will report results for men and women separately, each subgroup needs its own sample size.
- Forgetting the square. Halving the margin of error needs about four times the sample: ±2.5% needs 1,537 instead of 385.
Sources
Formulas checked November 2026:
- Penn State STAT 506, Lesson 2: confidence intervals and sample size (proportion and mean, finite population correction)
- NIST/SEMATECH e-Handbook of Statistical Methods, 7.2.2.2: sample sizes required (mean)
- NIST/SEMATECH e-Handbook of Statistical Methods, 7.2.4.2: sample sizes required (proportion)
- Dalhousie University, Mathematics and Statistics lecture notes: sample size for comparing two means and two proportions
Sample size practice quiz: 10 questions
Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.
n = 1.96² × 0.25 ÷ 0.05² ≈ 384.15. Sample sizes are always rounded up, so you need 385. 1,068 is the answer for ±3%.
A 99% level leaves 0.5% in each tail, and the z-score with 99.5% below it is about 2.576. 1.96 is for 95%, 1.645 for 90% and 2.326 for 98%.
p(1 − p) is largest when p = 0.5, so using 0.5 gives a sample big enough for any true proportion.
E = 1.96 × √(0.25 ÷ 400) = 1.96 × 0.025 = 0.049, or ±4.9 percentage points.
Divide the completed responses by the response rate: 300 ÷ 0.25 = 1,200 invitations.
384.15 ÷ (1 + 383.15 ÷ 2,000) ≈ 322.4, which rounds up to 323. A small population needs fewer responses.
Power is 1 − β, the probability that the test finds a real effect of the size you planned for.
n = 2σ²(1.96 + 0.84)² ÷ δ² = 2 × 400 × 7.84 ÷ 100 = 62.72, which rounds up to 63 per group (126 in total).
Quiz complete
Frequently asked questions
Why is 385 the sample size for a large population?
At 95% confidence (z = 1.96), a ±5% margin and the worst-case p = 0.5, n = 1.96² × 0.25 ÷ 0.05² ≈ 384.15. Rounding up gives 385, and this barely changes once the population is above about 100,000.
What is a good sample size for a survey?
It depends on the precision you need. About 385 responses give ±5% at 95% confidence, and about 1,068 give ±3%. Small populations need fewer, and subgroup analyses need more.
Does population size affect sample size?
Only when the sample is a noticeable share of the population. For 1,000 people you need 278 responses for ±5%, but for 1,000,000 people you need 384. That is close to the 385 for an unlimited population.
What is statistical power?
Power is the probability that a study detects a real effect of the size you specified. It equals 1 − β, where β is the chance of missing that effect. Raising power from 80% to 90% raises the needed sample by about a third.
What value of p should I use if I do not know it?
Use 50%. The product p(1 − p) is largest at p = 0.5, so the sample is big enough whatever the true proportion turns out to be. If earlier data suggest p = 20%, n drops from 385 to 246 at 95% and ±5%.
Related calculators
Related to This Article
More math articles
- How to Get a GED Certificate?
- The Best Grade 8 Math Book for Idaho Students
- Superdelegates
- The Best Grade 8 Math Book for New Jersey Students
- Arizona Grade 2 English Worksheets — Free Printable PDFs
- FREE 4th Grade Georgia Milestones Assessment System Math Practice Test
- The Best Algebra 1 Book for Tennessee Students
- Best Laptop Tables and Carts for online teaching
- The Best Grade 5 ELA Practice Tests for New Mexico Students
- Nebraska Algebra 1 Free Worksheets: Printable Algebra 1 Practice, No Login Needed


What people say about "Sample Size Calculator: Surveys, Means & Power (385 Rule)"?
No one replied yet.