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.

What do you need?
Not sure of p? Keep 50%: it gives the largest, safest sample size. Leave the population blank if it is large or unknown.
Sample size needed
385 responses
You need 385 completed responses for a ±5% margin of error at 95% confidence.

z for 95%1.9600
Actual margin with 385±4.99%
Formula
n = z² × p(1 − p) ÷ E²
= 1.9600² × 0.5 × 0.5 ÷ 0.05² ≈ 384.15 → 385
Sample size by margin of error (95%, p = 50%)
Margin of error Sample size
±1% 9,604
±2% 2,401
±3% 1,068
±4% 601
±5% 385
±7.5% 171
±10% 97
Halving the margin of error needs about four times as many responses.
Show steps
  1. Look up the z-score for 95% confidence: z ≈ 1.9600. It leaves 2.5% in each tail of the normal curve.
  2. 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.
  3. Compute n₀ = z² × p(1 − p) ÷ E² = 3.8415 × 0.25 ÷ 0.0025 ≈ 384.15.
  4. Always round up, never down, so the margin of error is met: n = 385.
This assumes a simple random sample. A biased sample (for example, only volunteers) is not fixed by making it larger.

How to use the sample size calculator

  1. 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.
  2. Choose a confidence level. 95% is the usual choice.
  3. Enter the margin of error and your best guess of the proportion (keep 50% if you have no idea) or the standard deviation.
  4. Add the population size if it is small, and your expected response rate if you are sending invitations.
  5. 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

  1. Decide what you are estimating or testing: a proportion, a mean, or a difference between groups.
  2. Pick the confidence level (or α) and, for comparisons, the power. 95% and 80% are common defaults.
  3. Choose the margin of error or the smallest difference worth detecting. This choice drives the answer more than anything else.
  4. Estimate p or σ from a pilot study or earlier data. If unsure, use p = 50% or a larger σ.
  5. 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:

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.

Question 1 of 10
1. Using z = 1.96, p = 0.5 and a margin of error of ±5%, how many survey responses do you need for a very large population?

Found a mistake? Let us know!

2. Which z-score goes with a 99% confidence level?

Found a mistake? Let us know!

3. You plan a survey and have no idea what proportion to expect. Which value of p should you use?

Found a mistake? Let us know!

4. If you want to cut the margin of error from ±6% to ±3% (same confidence and p), the sample size becomes about…

Found a mistake? Let us know!

5. At 95% confidence with p = 0.5, what is the margin of error for 400 responses?

Found a mistake? Let us know!

6. A survey needs 300 completed responses and you expect 25% of invited people to respond. How many should you invite?

Found a mistake? Let us know!

7. A population has 2,000 people and the unlimited-population sample size is n₀ = 384.15. Using n = n₀ ÷ (1 + (n₀ − 1) ÷ N), what is n (rounded up)?

Found a mistake? Let us know!

8. To estimate a mean within ±2 units at 95% confidence when σ = 10, how large a sample do you need?

Found a mistake? Let us know!

9. In a two-group study, what does 80% power mean?

Found a mistake? Let us know!

10. With z for α/2 = 1.96 and z for 80% power = 0.84, how many per group are needed to detect a difference of 10 between two means when σ = 20?

Found a mistake? Let us know!

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

What people say about "Sample Size Calculator: Surveys, Means & Power (385 Rule)"?

No one replied yet.

Leave a Reply