Math

Sample Size Calculator

Results

Enter values and calculate to see results.

Embed on your site

Any ezcalcs calculator can be embedded with one script tag. Copy the snippet below or use the homepage playground to preview and customize.

<!-- ezcalcs embed: sample-size-calculator — paste anywhere in the body -->
<script
  async
  src="https://ezcalcs.net/embed.js"
  data-calc="sample-size-calculator"
  data-theme="light"
  data-width="100%"
  data-height="640"
></script>

Use this sample size calculator to find out how many responses or subjects you need for a reliable result. Enter your confidence level, margin of error, and population size. The calculator returns the minimum sample size required so you can plan your survey, experiment, or study with confidence.

A sample size that is too small risks missing real patterns. One that is too large wastes time and money. This tool helps you land on the right number quickly.

Calculate Your Sample Size

Start with three inputs:

  1. Confidence level. How certain you want to be that the true result falls within your margin of error. Common choices are 90%, 95%, or 99%.
  2. Margin of error. The acceptable range above and below the true value. A margin of error of 5% is a typical starting point.
  3. Population size. The total number of people or items in the group you are studying.

If you know the expected proportion or standard deviation, enter those too. They sharpen the estimate. If you don't, the calculator uses conservative defaults (like a proportion of 0.5) to keep the result safe.

Hit calculate, and you get the minimum number of subjects or responses needed. Adjust any input and recalculate as often as you like.

How the Sample Size Calculation Works

The calculator uses different equations depending on whether you supply a proportion or a standard deviation. Both approaches balance the same tradeoff: more certainty and tighter error require a larger sample size.

Sample Size Calculation for a Proportion

When you are measuring the share of a population that has a trait (for example, the percentage of customers who are satisfied), the formula centers on the population proportion.

The core formula is:

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

  • Z is the z-score that matches your desired confidence level (1.96 for 95%).
  • p is the expected population proportion. If unknown, use 0.5. That value maximizes variance and gives the most conservative (largest) sample size.
  • E is the margin of error expressed as a decimal (0.05 for ±5%).

If the population is finite (not millions of people), the calculator applies a finite population correction so you don't over-sample a small group.

Sample Size Calculation Using Standard Deviation and Confidence Interval

When you measure a continuous outcome (like average spending or blood pressure), standard deviation replaces proportion in the formula:

n = (Z × σ / E)²

  • σ is the standard deviation of the measure you are studying.
  • Z and E work the same way as above.

You can pull the standard deviation from a pilot study, published research, or an educated estimate. The less certain you are about σ, the more conservative your sample size should be.

Margin of Error and Confidence Level in Sample Size

Margin of error and confidence level are the two levers that most directly control how large your sample needs to be.

Margin of error is the plus-or-minus range around your result. A survey result of 60% with a margin of error of 5% means the true value likely falls between 55% and 65%. Cutting the margin of error in half roughly quadruples the sample size needed.

Confidence level tells you how often that range would contain the true result if you repeated the study many times. At 95% confidence, 95 out of 100 repeated samples would capture the true value. Moving from 95% to 99% confidence increases the z-score from 1.96 to 2.576, which noticeably increases the sample size required.

Choose the confidence level your stakeholders expect. For most survey work and market research, 95% is standard. For clinical research where errors carry higher stakes, 99% is common.

Survey Sample Size: Determine the Minimum Number of Subjects

Population and Survey Sample Size

Your overall population is everyone who could potentially be included. A nationwide consumer panel might number in the millions. A company's employee base might be 500.

For very large populations, the required sample size levels off. Surveying 300 million people versus 30 million barely changes the math. But for smaller populations (under about 20,000), the finite population correction matters. The calculator adjusts automatically, so the minimum number stays practical.

A common misconception is that you need to survey a fixed percentage of the population. You don't. Sample size depends on your margin of error, confidence level, and variability, not on a percentage rule.

Minimum Number for Market Research and Customer Satisfaction Surveys

For market research and customer satisfaction surveys, a margin of error of 5% at 95% confidence is a widely used benchmark. With an unknown proportion (p = 0.5), that requires roughly 385 respondents from a very large population.

If you can tolerate a wider margin of error (say 7% or 8%), the minimum number drops significantly. The table below gives a quick reference:

Margin of ErrorConfidence LevelApproximate Sample Size (large population)
±3%95%1,068
±5%95%385
±5%99%666
±10%95%97

These are estimates. Your actual sample size needed may differ based on expected response rates and the variability in your target population. Always plan for non-response by inviting more people than the minimum.

Calculate Sample Size for Different Study Types

Calculate Sample Size for an Experiment or Cohort Study

Experiments and cohort studies often compare two groups (treatment vs. control). The sample size calculation for detecting a difference between groups depends on:

  • Effect size. The smallest difference you want to detect. Smaller effects need larger sample sizes.
  • Statistical power. The probability of detecting a real effect. A standard target is 80% (0.8). Higher power, like 90%, requires more subjects.
  • Significance level (alpha). Usually set at 0.05.
  • Variability. Measured by standard deviation in continuous outcomes or event rates in binary outcomes.

Power calculations for clinical research or cohort studies combine these inputs. If you are comparing proportions (like an error rate in one group vs. another), the formula uses both proportions. If you are comparing means, it uses the pooled standard deviation.

The calculator handles both scenarios. Select the study type, enter your assumptions, and it returns the minimum number of subjects per group. Always round up.

Calculate Sample Size When You Know the Population Proportion

When prior data or a pilot study tells you the expected proportion, enter it directly instead of using the default 0.5.

For example, if you expect the prevalence of a condition to be about 0.2, using p = 0.2 instead of p = 0.5 lowers the required sample size because the variance (p × (1 − p)) is smaller. This makes sense: when outcomes are less evenly split, you need fewer observations to estimate the proportion precisely.

Use 0.5 only when you truly have no idea what to expect. It is the most conservative choice and ensures a large enough sample size regardless of the actual proportion.

What Each Calculator Input Means

Confidence Interval and Standard Deviation

Confidence interval describes the range that the true population value is expected to fall within, based on your sample data. A 95% confidence interval means you are 95% certain the interval contains the true result. Wider intervals come from smaller samples or higher variability.

Standard deviation measures how spread out individual values are from the population mean. A larger standard deviation means more variability, which requires a larger sample to achieve the same precision. If you are working with proportions rather than continuous data, you won't need this input; the calculator uses p × (1 − p) instead.

What is a z-score? The z-score is the number of standard deviations a data point sits from the mean in a normal distribution. In sample size formulas, the z-score corresponds to your chosen confidence level. For 95% confidence, the z-score is 1.96. For 99%, it is 2.576. The calculator selects the correct z-score automatically.

Margin of Error and Population

Margin of error (also called acceptable error or sampling error) is the maximum amount you are willing to let your sample estimate differ from the true population value. A margin of error of 5% is standard for many surveys, but tighter research goals may need 3% or even 1%.

Population is the total group you are drawing your random sample from. When the population is small, the finite population correction reduces the sample size needed compared to the formula for an infinite population. When the population exceeds roughly 50,000, the correction has almost no effect.

Sample Size Calculator Limitations

This calculator provides an estimation and planning aid. Keep these points in mind:

  • Assumptions drive results. The formulas assume a random sample from the target population. Non-random sampling (convenience samples, voluntary responses) introduces bias that no formula corrects.
  • Non-response matters. If only 50% of invited participants respond, you need to invite roughly twice the calculated sample size. The calculator gives the number of completed responses needed, not invitations.
  • Effect size guesses can be wrong. For experiments, if the true effect is smaller than assumed, the study will be underpowered. Use the most conservative estimate you can justify.
  • Complex designs need more. Cluster sampling, stratified sampling, and multi-stage designs often require larger samples than a simple random sample calculation suggests.
  • This is not professional advice. For clinical trials, regulatory submissions, or high-stakes research, work with a statistician who can tailor power calculations to your exact design.

The calculator is a solid starting point. It gives you a defensible approximation for planning surveys, market research, coursework, and exploratory studies.

Sample Size Calculator: Common Questions

What is sample size? Sample size is the number of individual observations or responses collected from a larger population. It determines how precisely your results reflect the overall population.

What is a good sample size? It depends on your margin of error and confidence level. For most surveys targeting 95% confidence with a ±5% margin of error, 385 responses from a large population is a solid benchmark. Smaller populations may need fewer.

What is a large sample size? There is no universal cutoff. In survey research, anything above 1,000 respondents is generally considered large. In clinical research, "large" is relative to the effect being measured. A drug trial detecting a tiny effect might need tens of thousands of subjects.

Is there an easier way to calculate sample size? Yes. Enter your confidence level, margin of error, and population size into the calculator above. It handles the formulas instantly. No spreadsheet or manual math needed.

How do I determine the minimum sample size for my survey? Decide on your acceptable margin of error and confidence level. Enter those along with your population size. The calculator returns the minimum number of completed responses you need. Add a buffer for expected non-responses.

How can sample size influence results? Smaller samples produce wider margins of error and less certainty. Larger sample sizes narrow the margin of error, making results more statistically significant and representative of the target population.

What do I need to calculate my survey sample size? At minimum: population size, desired confidence level, and acceptable margin of error. If you have an expected proportion or standard deviation, include those for a more precise estimate.

Can I use this for clinical or cohort studies? The calculator supports basic power calculations for comparing two groups. For complex multi-arm trials or adaptive designs, consult a statistician. The tool gives a useful approximation, not a regulatory-grade analysis.