Sample Size Calculator

Find the minimum survey size for any confidence level and margin of error.

Sample Size Calculator

Find the minimum number of respondents needed to hit a target margin of error at the chosen confidence level.

%
%

Sample Size vs Margin of Error

How required sample size shrinks as you accept a larger margin of error, holding the current confidence level and proportion fixed. The relationship is quadratic — halving the margin quadruples the n.

Confidence Level vs Required Sample Size

How required sample size grows with stricter confidence levels at the current proportion and margin of error.

Population Size Impact

How the required sample size changes across population sizes at the current confidence level, margin of error, and proportion. Beyond ~20,000 the finite population correction barely matters — a key reason national polls work with ~1000 respondents.

Z-Score Confidence Reference

ConfidenceZ-ScoreTypical use
80%1.282Internal exploration, fast directional reads
85%1.440Pilot studies and concept tests
90%1.645Market research, business decisions
95%1.960Standard survey reporting, A/B testing
98%2.326High-stakes business decisions
99%2.576Medical trials, regulatory submissions

Z-scores are the standard two-sided critical values for the normal distribution; the confidence-level calculation uses the Abramowitz & Stegun erf approximation (Φ accurate to ≈ 1.5 × 10⁻⁷). Always round required n up and add a 10–20% buffer for non-response in real surveys. Read more in our methodology and editorial policy.

What Is a Sample Size?

Sample size (n) is the number of observations you collect from a population to make a defensible inference about that population — the count of survey respondents, lab measurements, conversion events in an A/B test, or units inspected on a production line. Statistical sampling theory gives you a closed-form recipe for the smallest n that still meets a stated precision target: the Cochran formula n = Z²·p·(1−p) / E². Halve the margin of error and you quadruple n; bump confidence from 95% to 99% and n grows by roughly 70%. Sample size is the single most important number in any survey budget.

This page bundles five tools onto one URL: a Sample Size Calculator that returns the recommended n from confidence level, margin of error, and expected proportion; a Margin of Error Calculator that runs the same formula in reverse; a Confidence Interval Calculator for the population mean; a Confidence Level Calculator that reverses a fixed sample into its implied confidence; and a Finite Population Correction tool for small populations. Pair it naturally with the z-score calculator, the standard deviation calculator, and the probability calculator.

How Sample Size Works

Choose a confidence level

Pick the long-run probability that your interval contains the true value — 90, 95, or 99% are the standard reporting levels. Each level maps to a critical Z-score: 1.645 at 90%, 1.960 at 95%, 2.576 at 99%.

Decide on a margin of error

Margin of error E is the half-width of your confidence interval. A 3% margin at 95% confidence means the survey estimate will land within ±3 percentage points of the true value 95 times out of 100.

Estimate the population proportion

If you have prior data, plug it in. If not, use 50% — the variance p(1−p) is maximised at p = 0.5, so that choice produces the largest, safest n. Specialty surveys with rare characteristics often need much smaller samples.

Apply finite population correction

When n / N exceeds ~5%, divide the unadjusted n₀ by 1 + (n₀ − 1) / N. This shrinks the requirement because depleting a small pool reduces the practical sampling error.

6 Ways to Use This Sample Size Calculator

1

Plan a survey from scratch

Pick your confidence level and target margin of error, plug in the expected proportion, and let the calculator return the minimum n. Add a 10–20% buffer for non-response.

2

Audit a survey already collected

Switch to the Margin of Error tab to find out how precise your existing dataset actually is — useful before you draft conclusions for the report.

3

Estimate a population mean

Use the Confidence Interval tab to bound a numeric average — battery life, response time, monthly spend — from sample mean, SD, and n.

4

Justify a smaller sample

If your budget caps n, use the Confidence Level tool to show stakeholders what confidence that sample can actually support at your chosen margin.

5

Correct for a small population

When you survey a panel of 800 or a classroom of 30, the FPC tab returns the correction factor and adjusted margin — the textbook infinite-population formula would oversample.

6

Compare scenarios visually

The always-on sample-size-vs-margin curve, level-vs-n bar chart, and population-impact chart let stakeholders see exactly how each lever changes the recommendation.

Best Practices for Sample Size Planning

Decide the confidence level and margin of error before you collect data. Picking them after seeing results invites motivated reasoning — researchers tend to relax precision targets to make underpowered surveys look more meaningful. The calculator returns a precise n for any pair of inputs; lock them in writing.

When the population proportion p is genuinely unknown, use 0.5. The variance p(1−p) peaks at p = 0.5, so this choice maximises the required n and guarantees your survey will be precise enough no matter what the true proportion turns out to be. If you do have prior evidence — historical surveys, pilot data, peer-reviewed estimates — plug the real value in to save respondents and budget.

Always inflate the calculator's recommended n by a non-response buffer. Mailed surveys see 20–60% response rates; online intercept surveys, 15–35%. Field a sample about 1.5–2× the statistical minimum to make sure your realised n hits the target.

Why Sample Size Matters

Statistical power

Underpowered studies fail to detect real effects. The required n for a test of a given effect size scales inversely with the squared minimum detectable effect — a survey that can't reliably distinguish a 2-point swing from a 4-point swing is essentially noise.

Budget control

Every respondent costs money — incentives, panel fees, analyst time. Calculating the minimum n lets product, finance, and research lock in a defensible number before fieldwork starts, instead of overspending or scrambling mid-study.

Regulatory acceptance

Clinical trials, FDA filings, and ISO audits all require pre-registered sample sizes with justification. The Cochran formula is the standard reference for proportion-based endpoints; t- and F-based formulae cover continuous endpoints.

Credible reporting

Margins of error and confidence intervals are how reputable polls communicate uncertainty. ‘66% support, ±3% at 95% confidence, n = 1067’ tells the reader exactly what to believe. Without those figures, a single percentage point reads like fact when it's actually noise.

Where Sample Size Gets Tricky

Stratified or clustered samples

The formulas on this page assume simple random sampling. Stratification reduces required n; cluster sampling (talk to whole neighbourhoods or schools) increases it via the design effect. Multiply by the published design effect for your survey type.

Small finite populations

When the survey pool is fewer than ~10,000, the finite population correction matters and the unadjusted formula will oversample. Use the FPC tab to get the right n; for a 500-person panel, the correction can cut required n by 30–50%.

Rare characteristics

When p is very small (say 1–3%), p(1−p) ≈ p, and you need a much bigger n to actually observe enough events. For studies of rare conditions or fraud detection, supplement the formula with sample-size-for-rare-events methods.

Non-response bias

Even a statistically adequate sample can be biased if non-responders differ systematically from responders. Use weighting or non-response follow-up to address this — the calculator can't compensate for a self-selected sample.

The Core Sample Size Formulas

Sample size (infinite population)

n = Z² · p · (1 − p) / E²

Cochran formula — the canonical recipe for proportion-based surveys.

Margin of error

E = Z · √(p (1 − p) / n)

Half-width of the confidence interval for a proportion.

Confidence interval (mean)

x̄ ± Z · s / √n

Z-based bounds on the population mean from sample statistics.

Standard error of mean

SEM = s / √n

Sample SD divided by √n — shrinks with sample size.

Finite population correction

FPC = √((N − n) / (N − 1))

Multiplicative factor applied to standard errors and margins.

Adjusted sample size

n* = n₀ / (1 + (n₀ − 1) / N)

Required n after applying FPC for a finite population.

Implied Z-score

Z = E / √(p (1 − p) / n)

Solving the margin formula for Z to recover confidence.

Standard normal CDF

Φ(z) = ½ [1 + erf(z / √2)]

Maps a Z-score to a cumulative probability.

Two-sided confidence

Confidence = 2 · Φ(|Z|) − 1

Total area of the standard normal between ±Z.

Critical Z at 95%

Z₀.₉₇₅ ≈ 1.960

Most common survey confidence — 95% two-sided.

Critical Z at 99%

Z₀.₉₉₅ ≈ 2.576

Used for high-stakes business and medical reporting.

Maximum variance proportion

p (1 − p) ≤ 0.25

Maximised at p = 0.5 — the conservative choice when p is unknown.

Common Sample Size Mistakes

  1. 1

    Confusing confidence level with margin of error

    Confidence level is the probability the interval contains the true value (95%, 99%). Margin of error is how wide that interval is (±3%, ±5%). They are independent levers — both affect required n in different ways.

  2. 2

    Forgetting non-response inflation

    The calculator's n is the realised sample you need. If you expect a 40% response rate, you must field roughly 2.5× that many invitations to land at the target.

  3. 3

    Treating n / N < 5% as needing FPC

    The finite population correction barely changes anything until n / N exceeds 5%. For a 1067-person poll of a 50-million-person country, the FPC factor is essentially 1.

  4. 4

    Plugging p = 0 or p = 100

    p(1−p) is zero at both extremes, which makes the calculator return n = 0. If you genuinely expect ≥ 95% of respondents to share a trait, switch to a binomial confidence-interval method designed for boundary proportions.

  5. 5

    Reusing infinite-population n for small finite groups

    Surveying a class of 30 with a 384-person poll formula is wasted effort — the FPC tab here returns the realistic n. Conversely, surveying a panel of 500 without FPC overstates the precision you actually achieved.

  6. 6

    Reporting the calculator's number without justification

    A defensible methodology section quotes confidence level, margin of error, expected proportion, response rate, population size, and the formula. Anyone can replicate the n from those inputs; without them, the figure is unfalsifiable.

Industry Use Cases

Market research

Brand tracking studies typically target 95% confidence with a 3–4% margin of error, leading to n ≈ 600–1067. For specialty audiences (luxury buyers, niche professionals), smaller finite populations make FPC essential.

Political polling

National polls quote 95% confidence with a 2.5–4% margin of error — a 1000–1500 respondent sample. Battleground state polls often run smaller and report margins of 4–5%, which the calculator returns automatically once n and confidence are fixed.

Customer satisfaction (CSAT/NPS)

B2B SaaS panels are small finite populations (200–5000 customers), so FPC drops required n meaningfully. A 95% / ±5% NPS read on a 800-customer base needs only about 230 respondents.

Academic research

Graduate theses commonly use 95% confidence at 5% margin of error for population-level inferences. Department-level studies on small student bodies benefit from the finite population correction tab.

Medical studies

Phase II clinical trials targeting a difference in proportions often require 99% confidence and a tighter margin of error (1–2%) — pushing required n into the thousands. The calculator handles this without changing tools.

Product testing & UX research

Discount-usability studies suggest n ≈ 5 catches 80% of issues, but quantitative satisfaction surveys still need full Cochran-based sizing. Use 90% confidence with ±5–10% margin during exploratory rounds.

A/B testing

Web experiments translate sample size into ‘visitors per arm’ — for a 5% baseline conversion and a 1% absolute MDE at 95% confidence and 80% power, you need roughly 13,000 visitors per arm. The proportion calculation here is the textbook basis.

Quality control

ISO 2859 acceptance sampling builds on similar proportion math — for a 1% defective rate at 95% confidence and ±0.5% margin, n approaches 1500. The calculator returns the required n in one step.

Public opinion surveys

Election-eve aggregate polls use 95% confidence with ±2–3% — n in the 1067–2400 range. Cross-tab confidence shrinks because each subgroup has a smaller effective n; report margins per subgroup, not for the headline.

Election forecasting

Roll-up models (538-style averages) combine many small polls each with its own n and margin. The calculator's outputs are the inputs that feed those meta-models — every poll's n drives its weight in the aggregate.

Worked Examples

Example 1 — 95% confidence, 3% margin, unknown proportion

  1. 1Pick Z(95%) = 1.960 from the standard normal table.
  2. 2Convert percentages: p = 0.50, 1 − p = 0.50, E = 0.03.
  3. 3Apply Cochran: n = 1.960² × 0.50 × 0.50 / 0.03² = 3.8416 × 0.25 / 0.0009 = 1067.111.
  4. 4Round up: required n = 1068 respondents.

Example 2 — margin of error from n = 400 at 90% confidence

  1. 1Pick Z(90%) = 1.645.
  2. 2With p = 0.45, compute SE = √(0.45 × 0.55 / 400) = √(0.000619) = 0.02487.
  3. 3Multiply: E = 1.645 × 0.02487 = 0.04092 — a margin of error of ±4.09%.
  4. 4Reported result: 45% ± 4.09% at 90% confidence on a sample of 400.

Example 3 — finite population correction on a 1200-person panel

  1. 1Population N = 1200, sample n = 300, baseline margin E₀ = 4%.
  2. 2FPC = √((1200 − 300) / (1200 − 1)) = √(900 / 1199) = √0.7506 = 0.8664.
  3. 3Adjusted margin = 4% × 0.8664 = 3.47%.
  4. 4Reported result: ±3.47% — about 13% tighter than the uncorrected estimate.

Methodology you can verify

Critical Z-scores for canonical confidence levels are taken from the standard normal distribution to four decimal places; the reverse confidence-level calculation uses the Abramowitz & Stegun erf approximation (Φ accurate to ≈ 1.5 × 10⁻⁷). The Cochran formula and finite population correction match every reference statistics textbook. Read more on the methodology and editorial policy pages.

Frequently Asked Questions

Sample size (n) is the number of observations you collect from a population to make inferences about that population — the number of survey respondents, lab measurements, A/B test conversions, or quality-control samples. It matters because every statistic you compute from a sample has random sampling error, and that error shrinks roughly with √n. Double the sample size and the margin of error shrinks by about 29% (1 − 1/√2); quadruple it and the margin halves. The Sample Size tool on this page tells you the smallest n that still meets your target margin of error at your chosen confidence level — the cheapest survey that still delivers the precision you need.

For an infinite (or very large) population, the formula is n = Z²·p·(1−p) / E², where Z is the critical Z-score for your confidence level (1.645 at 90%, 1.960 at 95%, 2.576 at 99%, etc.), p is your best estimate of the population proportion, and E is the margin of error expressed as a decimal. When you have an estimate of the total population size N, divide the result by 1 + (n₀ − 1)/N to apply the finite population correction. Example: 95% confidence, 3% margin of error, and an unknown proportion (p = 0.5 — the most conservative choice) gives n = 1.96² × 0.5 × 0.5 / 0.03² ≈ 1067. With N = 5000 the correction shrinks that to roughly 880.

A confidence level is the long-run probability that a confidence interval constructed from a random sample will contain the true population parameter. A 95% confidence level means that if you repeated the same survey 100 times, about 95 of the resulting intervals would contain the true value. The confidence level is what determines the Z-score used in every sample-size and margin-of-error formula on this page — 90% picks Z = 1.645, 95% picks Z = 1.960, 99% picks Z = 2.576. Higher confidence requires a bigger sample for the same margin of error, because the interval has to be wider to cover the parameter more often.

Margin of error (E) is the half-width of a confidence interval — the maximum amount you expect your sample estimate to differ from the true population value at the chosen confidence level. For a proportion, E = Z·√(p(1−p) / n). A 3% margin of error at 95% confidence with p = 0.5 and n = 1067 means the survey is expected to land within ±3 percentage points of the true population value 95 times out of 100. Smaller margin of error gives a more precise answer but requires a quadratically larger sample — halving E from 4% to 2% multiplies the required n by 4.

95% is a convention inherited from R.A. Fisher's early statistical work — small enough to be a meaningful precision target, generous enough that the resulting Z (1.960) keeps sample-size requirements affordable. It is not a law of statistics; you can use any level between roughly 80% and 99.99%. Medical trials and aerospace tolerances often demand 99% or 99.9%; quick market-research polls sometimes use 90%. The tradeoff is purely cost: each step up multiplies your required sample size. The Confidence Level tool on this page lets you start from a fixed sample size and a desired margin of error to see what confidence level is implied — useful when budget caps the n you can actually collect.

Population proportion (p) is the fraction of the population that has the characteristic you are surveying for — the share of voters who plan to vote yes, the share of customers who would recommend the product, the share of parts that pass inspection. It enters the sample-size formula through p·(1−p), which is the variance of a Bernoulli outcome. The product is maximised at p = 0.5, so when you have no prior estimate it is the most conservative assumption — guaranteeing your sample will be large enough no matter what the true proportion turns out to be. If you know p is closer to 10% or 90%, plugging in the real estimate gives a smaller, more efficient sample.

Finite population correction (FPC) is the factor √((N − n) / (N − 1)) that shrinks the standard error of a sample mean or proportion when the sample represents a meaningful fraction of the total population N. The plain Z²·p(1−p)/E² formula assumes an infinite population — every observation is independent and sampling never depletes the pool. When n / N is more than about 5% the assumption stops holding, and FPC corrects for it. The Finite Population Correction tool on this page computes the factor, the corrected sample size n* = n / (1 + (n − 1)/N), the adjusted margin of error E_adj = E · √((N − n) / (N − 1)), and the adjusted confidence interval in one click.

It depends on three things: the confidence level you need, the margin of error you can tolerate, and your best guess at the population proportion. Standard market-research targets — 95% confidence, ±5% margin of error, p = 0.5 — require about 384 respondents for a near-infinite population. Tighten the margin to ±3% and you need ~1067. Tighten further to ±1% and you need ~9604. For specialist groups where N is small (say a panel of 800), apply the finite population correction and the requirement drops sharply. Use the Sample Size tool here with your real targets and the answer comes back in one calculation.

Counter-intuitively, no — at least not by much. Beyond a population of about 20,000, the required sample size barely changes. A 95% / ±3% poll needs about 1067 respondents for a city of 100,000 and only about 1066 for a city of 10 million. This is why national polls in countries of 50–300 million people work with sample sizes of around 1000. Only when n / N approaches 5% or more does the finite population correction make a visible difference — that is the situation the FPC tool on this page exists for.

The arithmetic is exact double-precision floating point — about 15 significant digits — so the calculator itself is not the source of any meaningful error. Real-world accuracy depends entirely on whether your assumptions match reality: did you sample randomly, is non-response negligible, did respondents tell the truth, and is the variable approximately normal (for mean-based intervals) or Bernoulli (for proportions)? The calculator's job is to translate your stated assumptions into a recommended n; the survey designer's job is to make sure those assumptions hold. Always round the result up to the next whole number, and add a small buffer (10–20%) for likely non-response in real surveys.