Skip to content

Sample Size Calculator

Updated:

Calculate how many respondents or observations your survey or study needs. Enter the confidence level, margin of error, expected proportion (or standard deviation) and population size to get the required sample size.

Determine Your Sample Size

Input Fields
E
Proportion: percentage points (5 = ±5%). Mean: in the same units as the standard deviation.
p
%
Your best guess of the result. Use 50% when unknown — it is the most conservative (largest sample) choice.
If enabled, the result will update automatically when you change any value.

Sample Size Formula

Formula
\[ n_0 = \frac{z^2 \, p(1-p)}{E^2} \ \text{(proportion)} \qquad n_0 = \frac{z^2 \, \sigma^2}{E^2} \ \text{(mean)} \\ n = \frac{n_0}{\, 1 + \dfrac{n_0 - 1}{N} \,} \ \text{(finite population correction)} \]

Where:

  • \(z\) — the z-value for the chosen confidence level (1.96 at 95%)
  • \(p\) — expected proportion, as a decimal (0.50 = 50%)
  • \(E\) — margin of error; for a proportion as a decimal (0.05 = ±5 percentage points), for a mean in the same units as the data
  • \(\sigma\) — population standard deviation (only when estimating a mean)
  • \(n_0\) — required sample size for an unlimited (very large) population
  • \(N\) — population size, when it is known and finite
  • \(n\) — final required sample size, always rounded up to a whole number

The first formula is Cochran's formula for a proportion; the second is its counterpart for a mean. The finite population correction reduces the required sample when a noticeable share of the population is surveyed.

Sample Size – Calculation Example

Example: you want to survey residents of a town of 10,000 people. You expect roughly 50% satisfaction, want a margin of error of ±5 percentage points at the 95% confidence level.

\[ z = 1.959964 \]

\[ n_0 = \frac{1.959964^2 \times 0.50 \times (1 - 0.50)}{0.05^2} = \frac{0.9604}{0.0025} = 384.15 \rightarrow 385 \]

\[ n = \frac{384.15}{1 + \dfrac{384.15 - 1}{10\,000}} = \frac{384.15}{1.0383} = 369.97 \rightarrow 370 \]

Result: you need 370 respondents. Without the population correction the answer would be 385, so knowing the population size saves 15 interviews. With 370 responses and the correction applied, the margin of error is ±5.0 percentage points.

How to use the calculator

  1. In What you estimate, choose "A proportion or percentage (survey)" for questions like "% of voters who support X", or "A mean (average value)" for quantities like average income or weight.
  2. Select the Confidence level — 95% is the standard choice for most surveys.
  3. Enter the Margin of error (E). For a proportion this is in percentage points (5 = ±5%); for a mean it is in the same units as the standard deviation (e.g. ±$200).
  4. For proportions, enter your Expected proportion (p). If you have no idea, leave it at 50% — this is the most conservative value and produces the largest sample.
  5. For means, enter the Population standard deviation (σ), estimated from a pilot study or previous data.
  6. If the population is small enough that your sample covers a noticeable share of it, check Finite population (known size) and enter the Population size (N). Otherwise leave the box unchecked.
  7. Read the Required sample size, along with the value without population correction, the achieved margin of error, the z-value and a summary in the interpretation block.

What sample size means and why it matters

Sample size is the number of people or observations you need to collect so that your estimate — a percentage or an average — is accurate enough to be useful. No survey questions everyone; instead, you measure a sample and use it to estimate the whole population. The larger the sample, the closer your result will tend to be to the true value.

Two numbers control the required sample size. The margin of error says how far your result may sit from the truth: if 62% of your sample answers "yes" with a ±5% margin of error, the true population value is likely between 57% and 67%. The confidence level says how often that statement is right: at 95% confidence, the true value falls inside your interval in 95 out of 100 identical surveys.

Tighter margins and higher confidence both cost more data. Going from ±5% to ±3% more than doubles the sample size, and pushing confidence from 95% to 99% adds roughly 40% more respondents for a proportion. The z-value in the results is the link between the confidence level and the formula:

Confidence level z-value
90% 1.6449
95% 1.9600
98% 2.3263
99% 2.5758
99.9% 3.2905

When the population is small — say a company of 500 employees — the finite population correction lowers the required sample, because each respondent represents fewer people. For populations above roughly 100,000 the correction changes little and can be ignored.

Assumptions, limitations and practical tips

  • Simple random sampling is assumed. Every member of the population must have an equal chance of being selected. Stratified, cluster or convenience samples need adjustments (a "design effect" that multiplies the sample size).
  • Non-response inflates your workload. If you expect a 30% response rate, divide the sample size by 0.30: 370 respondents mean sending about 1,233 invitations.
  • Use 50% when unsure (proportions). The product \(p(1-p)\) is largest at \(p = 0.50\), so any other guess yields a smaller required sample. If your real result turns out to be far from 50%, your margin of error will actually be smaller than planned.
  • σ is rarely known exactly (means). The formula uses the normal (z) distribution and treats σ as known. If σ comes from a small pilot (under ~30 observations), a t-distribution would be more appropriate, and the result here is a close approximation.
  • Subgroups need their own sample. If you plan to analyse results separately by region, age group or segment, size the sample for the smallest group you care about, not just for the total.
  • The achieved margin of error may differ slightly from E because the sample size is rounded up and, with a finite population, the correction is applied — the value shown is what your final sample actually delivers.

Frequently Asked Questions

How do I calculate sample size by hand without a calculator?

For a proportion, use Cochran's formula: multiply the z-value squared by \(p(1-p)\), then divide by the margin of error squared. At 95% confidence with \(p = 0.50\) and \(E = 0.05\), this gives \(1.96^2 \times 0.25 / 0.0025 \approx 384\), rounded up to 385. If your population is small, divide that result by \(1 + (n_0 - 1)/N\). Always round up, never down, so you meet the target precision.

Why does a sample of 385 or 400 come up so often in surveys?

Because 385 is what the most conservative standard setting produces: 95% confidence, ±5 percentage points, and \(p = 0.50\). Many pollsters round this up to 400 for a safety buffer. The number is famous because it works for any large population — 385 respondents give ±5% precision whether you survey a city of 200,000 or an entire country. Only small populations or tighter precision requirements change it substantially.

What margin of error and confidence level should I choose?

±5% at 95% confidence is the default for opinion and market surveys. Use ±3% for election polls or publication-quality research, and accept ±10% for quick exploratory work where cost matters more than precision. 90% confidence is acceptable for internal business decisions; 99% is reserved for medical or high-stakes studies. Each tightening roughly doubles or adds heavily to cost, so choose the loosest values your decisions can tolerate.

Do I need the population size? What if I don't know it?

If the population is large — above roughly 100,000 — you can safely leave it out, because the correction changes the answer by less than a percent. Just use the uncorrected value. For small, countable groups (employees at a company, students at a school, members of an association), you should find or estimate the size, since surveying a large share of a small group genuinely requires fewer people. A rough estimate of N is fine; small errors in N barely affect the result.

What are the most common mistakes when calculating sample size?

The biggest is confusing percentages with decimals: entering 5 instead of 0.05 when computing by hand, or mixing ±5 percentage points with ±5% of a value. Others include rounding down instead of up, forgetting to divide by the expected response rate, sizing only for the total when you actually need subgroup results, and applying the finite-population correction when the sample is a tiny fraction of a huge population (which is harmless but pointless). Also remember the formula assumes simple random sampling.

How many people do I need to invite if many won't respond?

Divide the required sample by the expected response rate expressed as a decimal. If you need 370 completed responses and expect 30% to answer, invite \(370 / 0.30 \approx 1{,}234\) people. If your achieved response falls short, your margin of error grows: with only 200 responses instead of 370, the ±5% plan becomes roughly ±6.9%. Non-response can also bias results if those who answer differ systematically from those who don't.

When should I use the t-distribution instead of the z-value?

When estimating a mean and your standard deviation comes from a small pilot study — under about 30 observations — the t-distribution is technically correct because σ itself is uncertain. The difference is modest: at 95% confidence the t-value is about 2.09 for 20 pilot observations versus 1.96 for z, inflating the sample by roughly 14%. This calculator uses the normal approximation, which is standard practice for planning; you can simply add a 10–15% buffer for small pilots.

Leave a Reply

Your email address will not be published. Required fields are marked *