Research Tips

The Sample Size Formula, Explained: What Your Calculator Is Actually Doing

By Arie Lindenburg Published on August 16, 2026 7 min read

Type a few numbers into a sample size calculator and it tells you something like "384 responses". Useful, but if a supervisor or reviewer asks why 384, "the calculator said so" is not an answer you want to give.

This guide opens the box. You will see what the formula does with each input, why 385 keeps showing up in published research, and how population size changes the answer far less than most people expect. If you just want a defensible number without the theory, our sample size guide gives you reference numbers and rules of thumb. This post is for when you need to explain the number.

The formula, in one look

For a proportion (the most common survey case), the core formula is Cochran's:

n = (z² × p × (1 − p)) / e²

Four moving parts:

  • z is the z-score for your confidence level. 95% confidence means z = 1.96.
  • p is the expected proportion giving a particular answer. When you have no idea, you use 0.5, because it produces the largest, safest sample.
  • e is your margin of error as a decimal. Plus or minus 5% means e = 0.05.
  • n is the number of completed responses you need.

Plug in the standard defaults (95% confidence, p = 0.5, 5% margin of error):

n = (1.96² × 0.5 × 0.5) / 0.05² = 0.9604 / 0.0025 = 384.16, rounded up to 385

That is the whole mystery behind "you need about 400 responses". It is this formula with its most common defaults.

💡

Why every study seems to need 385 people

The 385 figure is not a law of nature. It is what Cochran's formula returns for 95% confidence, a 5% margin of error, and maximum uncertainty (p = 0.5). Change any input and the number moves.

What each input really does

Confidence level: how often the method gets it right

A 95% confidence level means that if you repeated your survey many times, 95% of the resulting intervals would contain the true population value. It is a statement about the method, not about any single result.

Raising confidence raises the z-score, and z is squared in the formula, so the cost compounds:

Confidence level vs required sample (5% margin of error, p = 0.5)

Confidence level z-score Required responses
90% 1.645 271
95% 1.96 385
99% 2.576 664

For student research and most business surveys, 95% is the accepted default. Reach for 99% only when a wrong call is genuinely costly, such as clinical or safety contexts.

Margin of error: how precise the answer is

The margin of error is the "plus or minus" around your result. If 60% of respondents prefer option A with a 5% margin, the true value is plausibly between 55% and 65%.

Because e is squared in the denominator, halving your margin of error roughly quadruples your sample:

Margin of error vs required sample (95% confidence, p = 0.5)

Margin of error Required responses
±10% 97
±5% 385
±3% 1,068
±2% 2,401

This is the input to negotiate with. Moving from ±5% to ±6% or ±7% saves a lot of fieldwork, and for exploratory research that trade is often fine.

Expected proportion: why 0.5 is the safe default

The term p × (1 − p) peaks when p = 0.5. If you genuinely know a proportion is around 10% (say, an uncommon behavior), the required sample drops. But guessing wrong in the other direction leaves you underpowered, so unless you have prior evidence, leave p at 0.5.

The finite population correction

Cochran's formula assumes an effectively infinite population. When you survey a small, defined group (one university, one company), you can shrink the sample with the finite population correction:

n_adjusted = n / (1 + (n − 1) / N)

where N is the population size. Two things surprise people here:

Required responses at 95% confidence, ±5%

217
Population: 500
357
Population: 5,000
381
Population: 50,000
385
Population: 1,000,000+

First, small populations help a lot: for a department of 500 people you need 217 responses, not 385. Second, beyond roughly 20,000 people the correction barely matters. A city of 100,000 and a country of 80 million need almost the same sample. Population size is the input people worry about most and it matters least.

The sample size calculator applies this correction automatically when you enter a population size.

Two worked examples

Example 1: campus satisfaction survey

You are surveying satisfaction at a university with 12,000 students. You accept the standard 95% confidence and ±5% margin.

  1. Base formula: n = (1.96² × 0.25) / 0.05² = 385
  2. Finite correction: n = 385 / (1 + 384 / 12,000) = 385 / 1.032 = 373 responses

Example 2: comparing two groups in a thesis

You want to compare men and women on a 5-point scale. Suddenly the question is not "how many overall" but "how many per group", and margin-of-error math is no longer the right tool. Comparisons are about detecting a difference, which is a statistical power question. Use the statistical power calculator for this, and read statistical power, explained to understand what it is doing. As a preview: detecting a medium-sized difference between two groups at 80% power needs roughly 64 people per group.

⚠️

The most common planning mistake

Margin-of-error sample sizes are for describing one population. The moment your research question contains the word "difference", "effect", or "compare", switch to power analysis. A sample that is fine for description can be badly underpowered for comparison.

From required responses to required invitations

The formula gives you completed responses. It says nothing about how many people you must invite to get them. If your response rate is 20%, a target of 373 completes means roughly 1,900 invitations, before screen-outs and bounces.

Plan that side of the funnel with the response rate calculator, and see what counts as a good response rate for realistic benchmarks by channel.

Know your number? Now go collect it.

SurveySwap's exchange gets your survey in front of real students and researchers for free. Short on time? You can also buy targeted responses.

Get Free Responses

Frequently asked questions

What is the formula for sample size?

For proportions, the standard formula is Cochran's: n = (z² × p × (1 − p)) / e², where z is the z-score for your confidence level, p is the expected proportion (0.5 as the safe default), and e is the margin of error. For small populations, apply the finite population correction afterwards.

Why does my calculator say 385?

385 is what the formula returns at 95% confidence, ±5% margin of error, and p = 0.5, the most common defaults. It is a convention, not a magic threshold.

Does population size matter for sample size?

Less than most people think. Below about 20,000 people the finite population correction meaningfully shrinks the required sample. Above that, it changes almost nothing.

Is this the right formula for comparing groups?

No. Margin-of-error formulas describe a single population. To compare groups or test an effect, run a power analysis instead. Our statistical power calculator handles that case.

All the calculators mentioned here live in our free research tools collection.

Tags

sample-size statistics quantitative-research

Related articles

Get free respondents

Join 5,000+ researchers who collect survey responses for free.

Get started for free