Sample Size Calculator

Find the sample size for a survey or estimate, or the number per group needed to detect a difference with a chosen power, with the formula worked out.

Plus or minus, in percentage points.
Use 50% if you have no idea; it gives the largest (safest) sample.
Leave blank for a large or unknown population.
Before rounding
384.1459
Critical value (z)
1.96
Required sample size385for a large population
  • Assumes simple random sampling. Cluster or quota samples usually need more.

Show the work

  1. Critical value for 95% confidence: z = 1.96
  2. n₀ = z² × p(1 − p) ÷ E² = 1.96² × 0.5 × 0.5 ÷ 0.05² = 3.8415 × 0.25 ÷ 0.0025 = 384.1459
  3. Round up to a whole number: n = 385
Sample size at other margins of error (95% confidence)
Margin of errorLarge populationFinite N
±1%9,604—
±2%2,401—
±3%1,068—
±4%601—
±5%385—
±7%196—
±10%97—

Too small a sample gives estimates so loose they settle nothing; too large a sample wastes time and money. This calculator sizes a study before you collect data. It handles the two common goals: estimating a proportion or mean to a chosen margin of error, and comparing two groups with enough power to detect a difference that matters.

How to use the sample size calculator

  1. Choose your goal: estimate a proportion, estimate a mean, compare two means or compare two proportions.
  2. Estimating: enter the confidence level and the margin of error you can live with. For a proportion, add your best guess of the rate (50% if unknown). For a mean, add an estimate of the standard deviation.
  3. Optionally enter the population size to apply the finite population correction, and an expected response rate to see how many people to contact.
  4. Comparing: enter the difference you want to detect, the significance level α, the power and whether the test is one- or two-sided.
  5. The tape shows the required size, rounded up; the table shows how it changes with the margin of error or power.

Sample size formulas

To estimate a proportion within ±E:

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

To estimate a mean within ±E when the standard deviation is about σ:

n₀ = (z × σ ÷ E)²

For a finite population of size N, shrink the result:

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

To compare two means with power 1 − β, each group needs

n = 2σ²(zα/2 + zβ)² ÷ δ²

and two proportions need [zα/2√(2p̄(1 − p̄)) + zβ√(p₁q₁ + p₂q₂)]² ÷ (p₁ − p₂)², where p̄ is the average of the two rates. Results are always rounded up.

Worked examples

A customer survey. You want ±5% at 95% confidence and have no idea of the answer, so p = 0.5. Then n₀ = 1.959964² × 0.25 ÷ 0.0025 = 384.15, so you need 385 completed responses. If the customer base is only 10,000 people, the correction gives 384.15 ÷ (1 + 383.15 ÷ 10,000) = 369.97, or 370. Expecting a 30% response rate, invite 370 ÷ 0.30 ≈ 1,234 customers.

An A/B test on a mean. A checkout redesign should shave 5 seconds off a task whose times have a standard deviation of about 10 seconds. With α = 0.05 two-sided and 80% power, each version needs 2 × 10² × (1.96 + 0.8416)² ÷ 5² = 62.79, so 63 users per group, 126 in all.

Two conversion rates. To detect a lift from 50% to 60% with the same α and power, the formula gives 387.34, so 388 visitors per group. Detecting a smaller lift, from 50% to 55%, takes about four times as many.

Choosing the inputs

Margin of error and confidence

Halving the margin of error quadruples the sample, because E is squared in the denominator. Going from ±5% to ±3% at 95% confidence lifts the requirement from 385 to 1,068. Moving from 95% to 99% confidence multiplies it by about 1.73.

Where σ comes from

The mean formulas need a standard deviation before you have data. Use a pilot study, published results or last year’s numbers. Without anything better, the range of plausible values divided by 4 is a rough stand-in. When in doubt, overestimate σ; you will end up slightly oversampled rather than short. The standard deviation calculator is handy for pilot data.

Power and the smallest effect that matters

Pick the difference to detect from practical importance, not from what you hope to see. Small effects are expensive: detecting half the difference takes four times the sample. After the data arrive, analyze them with the t-test calculator and report a confidence interval so readers see the size of the effect, not just whether it was significant.

These are planning formulas based on the normal approximation and simple random sampling. Complex designs (clusters, strata, repeated measures) need a design effect or specialist software.

Frequently asked questions

Why is 385 the sample size for so many surveys?

It is the answer for a ±5% margin of error at 95% confidence when you assume a 50% proportion: 1.96² × 0.25 ÷ 0.05² = 384.15, rounded up to 385. That combination is a popular default, so the number shows up everywhere.

Does a bigger population need a much bigger sample?

Hardly. Beyond a few tens of thousands, the population size barely matters, which is why national polls of about 1,000 people work. The finite population correction only makes a real difference when the sample would be a sizable share of the whole population, roughly 5% or more.

Why use 50% when I do not know the proportion?

The term p(1 − p) is largest at p = 0.5, so assuming 50% gives the biggest, safest sample. If you are confident the true rate is near 10% or 90%, the required sample drops considerably.

What is statistical power?

Power is the probability that a study detects a real difference of the size you specify. The usual target is 80%, meaning a one-in-five chance of missing a true effect. Raising power to 90% costs roughly a third more subjects.

Does the response rate change the sample size?

It changes how many people you must contact, not how many completed responses you need. If you need 370 responses and expect 30% to reply, invite about 1,234. Low response rates can also introduce bias that no sample size can fix.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.