Sample Size Calculator
Calculate the required sample size or margin of error in seconds using your confidence level, population proportion, and population size for fast, accurate research planning.
Was this calculator helpful?
Your feedback helps us improve our calculators.
What Is a Sample Size Calculator?
A sample size calculator estimates how many people, responses, observations, or data points you need to survey to estimate a population proportion with a chosen level of confidence and precision.
Instead of guessing how many responses are enough, you can calculate sample size using your confidence level, margin of error, population proportion, and population size.
This online sample size calculator can also work in reverse. If you already know your sample size, you can use the Find Margin of Error option to estimate the margin of error for your survey or study.
For example, with a 95% confidence level, 5% margin of error, 50% population proportion, and a large population, the required sample size is 385.
How to Use the Sample Size Calculator
The calculator provides two options: Find Sample Size and Find Margin of Error.
How to Find Sample Size
Use this option when you know the precision you want but need to determine how many responses to collect.
Select Find Sample Size.
Choose your Confidence Level.
Enter your desired Margin of Error as a percentage.
Enter the expected Population Proportion. Use 50% when you do not have a reliable estimate.
Enter the Population Size if you know the total size of a finite population. Leave it blank for a large population.
Click Calculate.
The calculator displays your Required Sample Size, along with the Z-score, margin of error, and population information.
When the calculated sample size is not a whole number, the required number of responses is rounded up to the next whole number.
How to Find Margin of Error
Use this option when you already know how many responses or observations you have.
Select Find Margin of Error.
Choose the Confidence Level.
Enter your Sample Size.
Enter the expected Population Proportion.
Enter the total Population Size when applicable, or leave it blank for a large population.
Click Calculate.
Review the calculated Margin of Error, Z-score, sample size, and population information.
How to Calculate Sample Size
For estimating a population proportion, sample size calculation is based mainly on the confidence level, desired margin of error, and expected population proportion.
For a large population, the basic sample size formula is:
n0=E2Z2p(1−p)
Where:
(n_0) = required sample size
(Z) = Z-score for the selected confidence level
(p) = expected population proportion as a decimal
(1-p) = remaining proportion
(E) = margin of error as a decimal
For example, 50% is entered into the formula as (0.50), while a 5% margin of error is (0.05).
Sample Size Formula for a Finite Population
If the total population is known and finite, the initial sample size can be adjusted using the finite population correction:
n=1+Nn0−1n0
Where:
(n) = adjusted sample size
(n_0) = sample size calculated for a large population
(N) = total population size
This adjustment can reduce the required sample when the sample represents a meaningful portion of the entire population.
For a very large population, the adjustment becomes small. That is why the sample size calculator lets you leave Population Size blank when working with a large population.
Sample Size Calculation Example
Suppose you are conducting a survey and choose:
Confidence level: 95%
Margin of error: 5%
Population proportion: 50%
Population: Large
A 95% confidence level corresponds to a Z-score of approximately (1.96).
Using the formula:
n0=E2Z2p(1−p)
Substitute the values:
n0=(0.05)2(1.96)2(0.50)(1−0.50)
n0=0.00253.8416×0.25
n0=384.16
Because you cannot collect a fraction of a response and rounding down could leave you below the required minimum, round the result up:
n=385
So, you need at least 385 responses under these assumptions.
How Is Margin of Error Calculated?
If you already have a sample size, you can estimate the margin of error for a population proportion.
For a large population, the formula is:
E=Znp(1−p)
Where:
(E) = margin of error
(Z) = Z-score
(p) = expected population proportion
(n) = sample size
To express the result as a percentage:
Margin of Error (%)=E×100
Margin of Error Example
Suppose:
Confidence level = 95%
Z-score = 1.96
Sample size = 385
Population proportion = 50%
Population = Large
Then:
E=1.963850.50(1−0.50)
E=1.963850.25
E≈0.04994
Convert the decimal to a percentage:
0.04994×100≈4.99%
So, the estimated margin of error is approximately 4.99%, matching the margin of error calculator result.
Common Confidence Levels and Z-Scores
A confidence level describes how often a confidence-interval procedure would capture the true population value over many repeated random samples under the model assumptions.
Common confidence levels and approximate Z-scores are:
Confidence Level | Z-Score |
90% | 1.645 |
95% | 1.960 |
99% | 2.576 |
A higher confidence level requires a larger Z-score. If all other inputs remain unchanged, this generally increases the required sample size.
For example, a study designed for 99% confidence will usually require more responses than the same study designed for 95% confidence.
Why Use a 50% Population Proportion When Unsure?
If you do not have a reliable estimate of the expected population proportion, 50% is commonly used as a conservative choice.
The sample size formula contains:
p(1−p)
When:
p=0.50
then:
0.50(1−0.50)=0.25
This is the maximum possible value of (p(1-p)). Therefore, using 50% produces the largest sample-size estimate for the same confidence level and margin of error.
For example:
0.50(0.50)=0.25
but:
0.20(0.80)=0.16
So, if you have no reliable prior information about the proportion, 50% provides a conservative starting point.
If trustworthy previous research suggests a realistic expected proportion, you may use that estimate instead.
How Confidence Level and Margin of Error Affect Sample Size
The number of responses you need can change significantly depending on the settings you choose.
Higher confidence level: Increasing the confidence level generally increases the required sample size because you are asking for greater confidence in the interval-estimation procedure.
Smaller margin of error: A narrower margin of error requires a larger sample. For example, targeting ±3% generally requires substantially more observations than targeting ±5% under otherwise identical assumptions.
Larger margin of error: Allowing less precision reduces the required sample size.
Population proportion: A proportion near 50% produces the greatest variability and therefore usually requires the largest sample under this formula.
Population size: Population size can matter when sampling without replacement from a relatively small, known population. For large populations, its effect on the required sample size becomes increasingly small.
Does Population Size Affect Sample Size?
Yes, but not always as much as people expect.
For a large population, the required sample size is driven mainly by your confidence level, margin of error, and expected population proportion rather than increasing directly in proportion to the total population.
For example, you do not necessarily need ten times as many responses simply because one population is ten times larger than another.
Population size becomes more important when you are sampling a substantial fraction of a known finite population. In that situation, the finite population correction reduces the required sample size.
This is why the margin of error calculator provides an optional Population Size field. Enter it when you have a specific finite population, or leave it blank when treating the population as large.
Common Sample Size Calculation Mistakes
Confusing Confidence Level With Margin of Error
These measure different things. Confidence level relates to the long-run coverage of the interval procedure, while margin of error describes its desired or estimated precision.
Rounding the Required Sample Down
If your calculation produces 384.16, using 384 would fall below the calculated requirement. Round upward to 385.
Automatically Using 50% When Better Information Exists
A 50% population proportion is useful when the expected proportion is unknown. If reliable prior research provides a suitable estimate, that value may give you a more study-specific calculation.
Ignoring the Finite Population
If you are sampling a substantial part of a small, known population without replacement, finite population correction can affect the required sample size.
Assuming a Larger Sample Fixes Every Research Problem
Increasing sample size can improve statistical precision, but it does not automatically eliminate problems such as selection bias, nonresponse bias, poor survey questions, measurement errors, or an unrepresentative sampling method.
Using This Formula for Every Type of Study
This margin of error calculator is designed around estimating a population proportion. Sample-size calculations for means, hypothesis tests, A/B tests, clinical trials, regression, clustered samples, or statistical power analysis may require different formulas and additional assumptions.
Tips for More Reliable Sample Size Planning
Start by clearly defining the population you want your findings to represent. A statistically adequate sample is much more useful when observations are selected using an appropriate sampling method.
Choose the margin of error based on the precision your research actually requires rather than simply selecting the smallest value possible. Smaller margins of error can dramatically increase the number of responses needed.
Use prior research to estimate the population proportion when trustworthy information is available. Otherwise, 50% is a practical conservative choice for this type of calculation.
Also remember that the required sample size means usable responses, not necessarily the number of people you need to contact.
For example, if you need 385 completed responses but expect only 50% of invited participants to respond, you may need to invite roughly:
0.50385=770
This adjustment is about expected response rate and is separate from the statistical sample size formula.
Frequently Asked Questions (FAQs)
What is a good sample size?
There is no single sample size that is good for every study. The required sample depends on factors such as confidence level, margin of error, expected population proportion, population size, and the statistical method being used.
How do you calculate sample size?
For estimating a population proportion in a large population, you can calculate sample size with:
n=E2Z2p(1−p)
Enter the Z-score, expected proportion, and desired margin of error, then round the resulting required sample upward.
What sample size do I need for a 95% confidence level?
Confidence level alone is not enough to determine sample size. For example, with 95% confidence, a 5% margin of error, a 50% population proportion, and a large population, you need approximately 385 responses.
Why is 385 a common sample size?
A sample size of 385 is commonly seen because a 95% confidence level, ±5% margin of error, 50% population proportion, and large population produce a calculated requirement of approximately 384.16, which is rounded up to 385.
How do I calculate margin of error from sample size?
For a population proportion under the large-population normal approximation, use:
E=Znp(1−p)
The margin of error decreases as sample size increases when the confidence level and expected proportion remain unchanged.
Why use a 50% population proportion?
Use 50% when you do not have a reliable estimate of the true proportion. Since (p(1-p)) reaches its maximum at (p=0.50), it produces the most conservative sample-size estimate under this formula.
Does population size affect the required sample size?
Yes, particularly for relatively small finite populations when the sample represents a substantial fraction of the population. For very large populations, population size has much less influence on the required sample.
What happens if I reduce the margin of error?
Reducing the margin of error increases the required sample size. Because margin of error is squared in the sample size formula's denominator, even a modest increase in desired precision can require substantially more responses.
Is a larger sample always better?
A larger sample generally improves statistical precision, but it does not guarantee better research. Sampling bias, poor measurement, nonresponse, and an unsuitable research design can still produce unreliable conclusions.
What is the difference between confidence level and margin of error?
Confidence level describes the long-run success rate of the interval-estimation method, while margin of error describes the distance around an estimate used to express its statistical precision.
For example, a survey might report an estimated proportion with a 95% confidence level and ±5% margin of error under the assumptions of the chosen method.
Helpful Resources
Pro Tips
The margin of error is the desired level of precision.
The confidence level determines the level of confidence in the sample size.
Higher confidence levels require larger sample sizes.