Sample Size Calculator

Figuring out how many responses you actually need for a survey or study isn't just a math exercise. Get it wrong in either direction and your results are either unreliable or way more expensive to collect than they needed to be. That's where a sample size calculator comes in. Plug in a few numbers, like your confidence level, margin of error, and population size, and you get a concrete answer: the minimum number of responses that will give you statistically valid results. No guessing, no padding the number just to feel safe. This page walks through everything the calculator uses under the hood, so you understand what you're entering and why it matters.

Enter Details

Use 50% for the most conservative (largest) sample.

Leave blank for a very large / unknown population.

Result

Choose your confidence level and margin of error to size your survey.

Based on n = z²·p·(1−p) ÷ e², with a finite-population correction when a population size is given.

How to Use the Sample Size Calculator

Using the calculator is straightforward once you know what each field means. Here's the general flow:

  1. Enter your population size (the total group you want to draw conclusions about). If you're surveying all adults in the U.S., that's roughly 260 million. If you're studying employees at a single company with 400 people, enter 400.
  2. Choose your confidence level. The most common choices are 90%, 95%, and 99%. Higher confidence means a larger required sample.
  3. Set your margin of error (also called the confidence interval). A margin of 5% is standard for most surveys. Tighter margins like 2% or 3% require significantly more responses.
  4. Enter your expected proportion. If you have no prior data, use 50%, which gives the most conservative (largest) sample size estimate.
  5. Hit calculate. The result is your minimum recommended sample size.

That's really it. The hard math happens behind the scenes. What you get back is a number you can actually plan around, whether you're budgeting for a market research project or designing a clinical study.

What Is Sample Size in Statistics?

Sample size is simply the number of individual observations or responses included in a study. You rarely have the time or resources to measure an entire population, so you measure a representative slice of it instead. That slice is your sample, and how big that slice needs to be is the sample size.

The goal is for your sample to reflect the larger population accurately enough that conclusions drawn from it are trustworthy. A sample that's too small introduces a lot of random error, making your results unreliable. A sample that's unnecessarily large wastes time and money without meaningfully improving accuracy.

Think of it like tasting soup. One small spoonful from a well-stirred pot tells you a lot about the whole batch. But if the pot hasn't been stirred, you might need a few more spoonfuls from different spots. The underlying idea in statistics is the same: a properly sized, randomly selected sample gives you a reliable read on the whole population.

Sample Size Formula Explained

The standard formula for calculating sample size looks like this:

n = (Z² × p × (1 - p)) / e²

And when you're working with a finite population (one that has a specific, known size), you apply a correction:

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

Here's what each variable means:

  • n = the initial sample size (before any finite population correction)
  • Z = the Z-score corresponding to your chosen confidence level
  • p = the expected proportion (expressed as a decimal, so 50% becomes 0.5)
  • e = your margin of error (also as a decimal, so 5% becomes 0.05)
  • N = the total population size

The finite population correction matters more than people often realize. If your initial sample size comes out to 400 and your total population is only 800, the unadjusted formula would overestimate how many responses you need. The correction brings the number down to something realistic. For very large populations, though, the correction has almost no effect, which is why the unadjusted formula works fine for most national-scale surveys.

Confidence Level and Z-Score

The confidence level tells you how certain you want to be that your results fall within your chosen margin of error. A 95% confidence level means that if you ran the same study 100 times with different random samples, about 95 of those studies would produce results within your stated margin of error.

Each confidence level maps to a specific Z-score, which comes from the standard normal distribution. The Z-score is what actually goes into the formula.

Confidence LevelZ-Score
80%1.28
85%1.44
90%1.645
95%1.96
99%2.576

The jump from 95% to 99% confidence might not sound dramatic, but it pushes your required sample size up considerably because you're squaring the Z-score in the formula. For most surveys and market research projects, 95% is the sweet spot between reliability and practicality. Medical and scientific research often demands 99% because the stakes of being wrong are much higher.

Margin of Error Explained

The margin of error (sometimes called the confidence interval) represents the range within which the true population value is expected to fall. If a survey reports that 60% of respondents prefer Product A with a margin of error of ±5%, the real number in the full population is likely somewhere between 55% and 65%.

Smaller margins of error give you more precise results, but they come at a cost: you need a larger sample. The relationship isn't linear either. Because the margin of error appears squared in the denominator of the formula, cutting your margin of error in half roughly quadruples your required sample size. Going from 5% to 2.5% doesn't double your workload. It multiplies it.

For general public opinion surveys, a 5% margin of error is widely accepted. Academic research and medical studies often aim for 3% or lower. If you're running a quick internal poll where precision isn't critical, 10% might be perfectly acceptable. The right margin of error depends entirely on how much uncertainty your use case can tolerate.

Population Size vs Sample Size

One of the most counterintuitive things about statistics is that the required sample size doesn't scale proportionally with population size. You don't need 10 times more responses to survey a city of one million than a town of 100,000. The math just doesn't work that way.

For very large populations (anything above roughly 100,000), the population size has almost no effect on the required sample size. A survey of U.S. adults and a survey of a city with 500,000 people might require nearly identical sample sizes for the same confidence level and margin of error. What drives the sample size is the desired precision, not the size of the group you're studying.

Where population size does matter is with small populations. If your entire population is 200 people, you obviously can't need 400 responses. The finite population correction formula handles this by reducing the required sample size when the population is small relative to the initial estimate. In some cases, especially with very small groups, you may find that surveying nearly everyone makes more sense than sampling at all.

Expected Proportion in Sample Size Calculation

The expected proportion, sometimes called p, is an estimate of what percentage of your population will answer a survey question in a certain way or have a particular characteristic. If you're asking whether respondents prefer one product over another and you expect about 60% to say yes, you'd enter 0.6.

The reason this matters is that the variability in a proportion is highest when it's close to 50% and lowest when it's near 0% or 100%. More variability means you need more responses to get a reliable estimate, so a proportion of 0.5 always produces the largest (most conservative) required sample size.

When you genuinely don't know what the proportion will be, 50% is the standard default. It's a safe choice because it ensures your sample will be large enough to detect whatever the actual result turns out to be. If you have solid prior data suggesting the proportion will be closer to 20% or 80%, using that number will reduce the required sample size somewhat. Just make sure your prior data is actually reliable before leaning on it.

Real-World Uses of Sample Size Calculation

Sample size calculation shows up in more places than most people realize. It's not just an academic exercise or something reserved for professional statisticians.

  • Market research: Companies use it to determine how many consumer surveys they need before trusting the results enough to make product or pricing decisions.
  • Political polling: News organizations and campaigns calculate sample sizes to ensure their polls are representative of the voting population within an acceptable margin of error.
  • Clinical trials: Pharmaceutical researchers must calculate sample sizes before starting trials to ensure the study can detect a real treatment effect if one exists.
  • Quality control: Manufacturers use sampling to inspect product batches without testing every single item off a production line.
  • Academic research: Researchers in psychology, sociology, education, and economics all rely on proper sample sizing to make sure their studies hold up to scrutiny.
  • A/B testing: Digital product teams calculate minimum sample sizes before running website or app experiments to avoid drawing conclusions from insufficient data.

In every one of these cases, the underlying math is the same. What changes is how much precision is needed and what the consequences are of getting it wrong. A poorly sized sample in a market survey might lead to a bad product launch. In a clinical trial, the stakes are obviously much higher. Either way, taking a few minutes to calculate a proper sample size before you start collecting data is almost always worth it.

Other Maths Calculators

Explore all