Calculatorbudy Official Logo
Browse Calculators

Sample Size & Margin of Error Calculator

Last updated: March 2026

Figure out exactly how many people you need to survey or find the margin of error for results you already have. This tool helps ensure your research data is reliable and accurate before you start collecting responses.

1. Find Out the Sample Size

Sample size needed:

2. Find Out the Margin of Error

Margin of Error:

About This Tool

Why This Tool Exists

Running surveys takes time and resources. We built this calculator so you can find out the exact number of responses you need for trustworthy results. This prevents you from overspending on massive surveys or getting too little data to make confident decisions.

When Should You Use This Tool?

  • Customer Satisfaction Surveys: Make sure you hear from enough users to understand true sentiment without annoying your entire customer base.
  • Academic Research: Prove your findings are statistically valid for your thesis or study.
  • Product Testing: Test new features on a right sized audience segment before a full public launch.
  • Employee Feedback: Get an accurate read on company morale across different departments and teams.

How It Works

You enter your total population, how confident you want to be in the results, and your acceptable margin of error. The tool uses standard statistical formulas to instantly give you the exact number of survey responses you need to meet those criteria.

Limitations and Accuracy

This calculator provides accurate targets based on math, but real world results depend heavily on how you collect your data. If your survey only goes out to a specific biased group, having the perfect sample size will not fix skewed answers. Always remember to factor in your expected response rate when deciding how many survey invites to send.

The Comprehensive Guide to Sample Size and Margin of Error

Whether you are a university student conducting a thesis, a market researcher analyzing consumer trends, or a business owner gauging customer satisfaction, understanding the mathematics behind surveys is crucial. The validity of any research project rests heavily on one critical question: How many people do I need to survey?

If your sample size is too small, your results may not be statistically significant, leading to erroneous conclusions. Conversely, if your sample size is unnecessarily large, you waste valuable time and resources. This guide dives deep into the definitions, formulas, and real world applications of sample size and margin of error to help you design better surveys.

Why is Sample Size Important?

In statistics, a "population" represents the entire group you want to study. For example, every adult in the United States or every customer who bought your product last year. However, it is rarely feasible to survey an entire population due to budget and time constraints. Instead, we select a subset of that group, known as a sample.

The goal of sampling is to select a group that accurately represents the larger population. If the sample is representative, the results of your survey can be generalized to the population with a known degree of accuracy. This accuracy is defined by two key metrics: the Confidence Level and the Margin of Error.

Key Statistical Definitions

1. Population Size (N)

The population size is the total number of distinct individuals in the specific group you are studying.

  • Finite Population: A known, countable number. Example: The 500 employees of a specific company.
  • Infinite Population: When the population is very large or unknown, statistical formulas often treat it as infinite. In our calculator, leaving the population field blank applies the formula for an infinite population.

2. Margin of Error

No sample is perfect. The margin of error tells you how much sampling error is present in your results. It is expressed as a percentage. For example, if a poll shows that 60% of people prefer Brand A with a margin of error of 5%, the true percentage of the population who prefer Brand A is likely between 55% and 65%.

A smaller margin of error requires a larger sample size. Researchers typically aim for a margin of error between 3% and 5%.

3. Confidence Level

The confidence level determines how certain you can be that the true population value falls within your margin of error. It is essentially a measure of reliability.

  • 95% Confidence Level: The industry standard. It means that if you repeated the survey 100 times, 95 of those times the results would fall within the calculated margin of error.
  • 99% Confidence Level: Used for high stakes research where precision is critical. This requires a significantly larger sample size.
  • 90% Confidence Level: Used when a general idea of trends is sufficient and budget is limited.

4. Expected Proportion (p)

This metric represents the variance you expect in your responses. In a binary survey, a proportion of 50% yields the highest variance, meaning it requires the largest sample size to achieve significance.

Most researchers stick to 50% as a conservative estimate because it ensures the sample size is sufficient regardless of the actual outcome. If you have historical data showing that 90% of your audience answers favorably, you could use 90% as your proportion, which would reduce the required sample size.

The Mathematics: Cochran's Formula

Our calculator uses standard statistical formulas to derive the results. For large or infinite populations, we use Cochran's Formula.

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

Where:

  • n₀ = The required sample size
  • Z = The Z-score corresponding to the confidence level
  • p = The expected proportion
  • e = The margin of error

Finite Population Correction: If the population is small and known, we apply a correction to reduce the sample size required.

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

As the population grows larger, this correction factor becomes negligible.

Factors Influencing Your Survey Design

Response Rate

Calculating the sample size is only the first step. You must also consider your response rate. This is the percentage of people who will actually complete the survey. If you need 400 respondents but your typical email open rate is only 20%, you will need to send invitations to 2,000 people to hit your target.

Design Effect (DEFF)

The standard formulas assume a simple random sample, where every individual has an equal chance of being picked. If your sampling method is more complex, the Design Effect helps adjust the sample size to account for the loss of efficiency. A DEFF of 1.0 means simple random sampling. Values higher than 1.0 require larger sample sizes.

Common Scenarios and Examples

Scenario A: The Employee Satisfaction Survey

You are an HR manager at a company with 500 employees. You want to know how they feel about the new benefits package with 95% confidence and a 5% margin of error.

  • Population (N): 500
  • Confidence: 95%
  • Margin of Error: 5%
  • Result: Using the calculator, you need approximately 217 responses.

Scenario B: The Nationwide Political Poll

A news agency wants to predict the outcome of an election in a country with 300 million people. Because the population is so large, it is treated as infinite.

  • Population: Infinite
  • Confidence: 95%
  • Margin of Error: 3%
  • Result: The agency needs 1,067 respondents. This explains why most national polls you see on TV survey around 1,000 people. That is the statistical sweet spot for validity without breaking the bank.

Tips for Reducing Margin of Error

If you find that your margin of error is too high, your results may be too vague to be useful. To reduce this number:

  1. Increase Sample Size: This is the most direct method. However, doubling your sample size does not halve your margin of error. It reduces it by the square root of 2.
  2. Lower Confidence Level: If you accept a 90% confidence level instead of 95%, the margin of error will shrink for the same sample size. This is a common trade off between precision and certainty.

Frequently Asked Questions

What is a good sample size for a survey?
For most market research, a sample size of 385 is considered ideal. This number assumes an infinite population, a 95% confidence level, and a 5% margin of error. If you need higher precision, you will need a larger sample.
How do I calculate the margin of error?
You calculate the margin of error using your confidence level, sample size, and expected proportion. Rather than doing the math by hand, our calculator processes these inputs automatically to give you an accurate percentage.
What is the difference between Confidence Level and Margin of Error?
Confidence Level is how sure you are that your results are accurate. Margin of Error is the range that your results might vary from the true population value. They work together to define the reliability of your study.
What if I do not know my population size?
If your population is very large or unknown, you can leave the population field blank. The calculator will use the formula for an infinite population, which is standard practice for most general population surveys.
Why is 50% used for the Expected Proportion?
Using 50% is a safe estimate. It ensures your sample size is large enough to cover the most varied responses. If you have past data suggesting a specific outcome, you can adjust this to potentially reduce your required sample size.
Disclaimer: This calculator is provided for educational purposes. The results are based on standard statistical formulas. Actual results may vary depending on your sampling methodology.