UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

About·Changelog·Privacy Policy·Terms of Service·Contact
HomeStatisticsSample Size Calculator

Related Tools

Median CalculatorMean Calculator

Sample Size Calculator — Margin of Error

How many survey responses do you need for your confidence level and margin of error? Or what margin does your sample give? Finite population and response rate.

You Might Also Like

All Statistics

Median Calculator

Find the median of any dataset in seconds. Sorts the values, highlights the middle position(s), and shows the step-by-step calculation for odd and even counts.

Mean Calculator

Paste any dataset to instantly compute mean, median, mode, range, variance, standard deviation, quartiles, IQR and skewness. Sample and population modes.

CPA Calculator

Solve for CPA, total conversions or ad spend from the other two, set a target CPA to see the conversion gap, and compare against channel benchmarks. Offline.

CLV Calculator

Work out customer lifetime value three ways, with the LTV to CAC ratio and payback month, and see why zero churn breaks the usual formula.

How many people do you need to survey? It depends on three choices: how sure you want to be (the confidence level), how close to the truth the result must land (the margin of error), and how varied the answers are likely to be. Population size matters far less than most people expect. Asking 385 people gives ±5% at 95% confidence whether the population is a city or a whole country.

This calculator works it out in both directions. Sample size tells you how many responses to collect. Margin of error tells you how precise a survey you already ran is. Both work for a percentage (“what share of customers would recommend us?”) and for an average (“what is the mean delivery time?”).

Worked Example: 385 Responses at 95% and ±5%

The page opens on the textbook case: a percentage, 95% confidence, a margin of 5% and an expected proportion of 50%, with no population size.

  • z for 95% is 1.9600, so n₀ = 1.96² × 0.5 × 0.5 ÷ 0.05² = 384.146, rounded up to 385.
  • The row underneath shows the same settings at other margins: ±3% needs 1,068, ±2% needs 2,401, ±1% needs 9,604, and ±10% needs only 97. Halving the margin roughly quadruples the sample.
  • Press Load Sample once and the population becomes 1,000. The finite-population correction brings the answer down to 278.
  • Press it again for the reverse question: 1,000 responses at 95% give a margin of ±3.099%.

Cochran's Formula and the Population Correction

  • For a percentage: n₀ = z² × p(1 − p) ÷ E². p(1 − p) is largest at p = 50%, which is why 50% is the safe choice when you have no earlier result.
  • For an average: n₀ = (z × σ ÷ E)², where σ is the standard deviation from a pilot or past data and E is in the same units. σ = 15 with E = 2 at 95% needs 217.
  • Finite population N: n = n₀ ÷ (1 + (n₀ − 1) ÷ N). It only bites when the sample is a noticeable share of the population. At ±5% and 95%, N = 100,000 needs 383, N = 10,000 needs 370, and N = 500 needs 218.
  • z comes from the inverse normal distribution, so any confidence level works, not just the chips. 90% gives 1.6449, 99% gives 2.5758 and 99.9% gives 3.2905. The z for the level you typed is shown under the box.

Fill in Expected response rate and the tool also says how many people to invite. At 90%, ±4% and p = 30%, you need 356 responses, and at a 25% response rate that means 1,424 invitations.

Edge Cases: Tiny Populations, 0% and Commas

  • The answer is always rounded up, because rounding down would leave the margin slightly wider than you asked for. A population of 20 at ±5% and 95% needs all 20, and the tool says plainly that only a full census meets the margin.
  • An expected proportion of exactly 0% or 100% has no variation to measure. It gets: “The expected proportion must be between 0% and 100%. At 0% or 100% nothing varies, so there is nothing to estimate — use 50% if you don't know; it gives the largest, safest sample.”
  • The confidence level can be anything from 50% up to, but not including, 100%. A sample can never be 100% certain. The margin for a percentage can be up to ±50%.
  • A decimal comma such as 2,5 is refused rather than read as 25. Thousands commas such as 10,000 are fine.
  • The maths assumes a simple random sample. Clustered, stratified or quota designs need a design effect, and no formula fixes a biased sample.

Work out

You are estimating

z = 1.9600 (two-sided)

5 means the true figure is within ±5 percentage points.

Not sure? Keep 50% — it gives the largest, safest sample.

Sample size needed

385

responses for 95% confidence that the result is within ±5% of the true value.

z = 1.9600

n₀ = z² × p(1 − p) ÷ E² = 1.9600² × 0.5 × 0.5 ÷ 0.05² = 384.146

Rounded up to 385 — rounding down would miss the margin.

At 95% confidence, other margins need

±1%

9,604

±2%

2,401

±3%

1,068

±4%

601

±5%

385

±7%

196

±10%

97

Assumes a simple random sample and the normal approximation (Cochran's formula).