How to Use the Sample Size Calculator
This calculator can find the required sample size for estimating either a population proportion or a population mean.
To use the calculator:
- Under Estimate, select Population Proportion or Population Mean.
- Enter the confidence level you want to use, such as 90%, 95%, or 99%.
- Enter the population size if it is known. You can leave this field blank for a large or unknown population.
- If you selected Population Proportion, enter the margin of error and expected proportion. Use 50% for the expected proportion if it is unknown.
- However, if you selected Population Mean, enter the margin of error and estimated population standard deviation.
- Click Calculate.
The calculator instantly returns the minimum sample size for your study as a whole number and shows you how the value was obtained using a step-by-step approach.
What Is Sample Size?
Sample size is the total number of individual units, participants, or observations included in a research study or survey to represent a larger target population.
For example, suppose a researcher wants to estimate the percentage of university students who use a particular learning platform. Surveying every student may not be practical. Instead, the researcher can collect data from a smaller group and use the results to estimate the proportion in the full population. The number of students included in that smaller group is the sample size.
Choosing an appropriate sample size is important because it affects the precision of an estimate. A sample that is too small may give an estimate with a large margin of error. However, collecting a much larger sample than necessary can require additional time and resources without providing a meaningful improvement in precision.
Therefore, the sample size you need depends on the parameter you want to estimate and the level of precision you require.
Sample Size for a Proportion vs. a Mean
This sample size calculator uses different formulas depending on whether you want to estimate a population proportion or population mean.
The table below summarizes the difference between the two calculations.
| Population Proportion | Population Mean | |
|---|---|---|
| Used to estimate | A percentage or proportion | An average |
| Example | Percentage of voters supporting a candidate | Average examination score |
| Variability input | Expected proportion, p | Population standard deviation, σ |
| Margin of error | Entered as a percentage | Entered in the same units as the variable |
| Main formula | n₀ = z²p(1 − p) / E² | n₀ = (zσ / E)² |
As shown in the table, both calculations require a confidence level and margin of error. The main difference is how variability is represented. For a proportion, variability depends on p(1 − p), while for a mean, it depends on the estimated population standard deviation.
Sample Size Formula
The sample size formula depends on whether you are estimating a proportion or a mean. When estimating a population proportion, the formula for estimating the initial sample size is:
n₀ = z²p(1 − p) / E²
where:
- n₀ is the required sample size before any finite population adjustment.
- z is the z critical value for the selected confidence level.
- p is the expected population proportion.
- 1 − p is the complementary proportion.
- E is the desired margin of error expressed as a decimal.
For example, a 5% margin of error is entered in the formula as 0.05.
If your study specifically asks you to determine sample size using Cochran’s method, use our Cochran’s Formula Calculator for a dedicated Cochran calculation and explanation.
However, when estimating a population mean, the formula for estimating the initial sample size is:
n₀ = (zσ / E)²
where:
- n₀ is the required sample size.
- z is the z critical value.
- σ is the estimated population standard deviation.
- E is the desired margin of error.
Note. In this case, the standard deviation and margin of error must be expressed in the same units. For example, if you are estimating average examination scores and σ = 18 points, the margin of error should also be entered in points.
If the population standard deviation is unknown, you can estimate it using previous research, historical data, or a pilot sample.
Finite Population Correction Formula
The above sample size formulas assume that the population is very large or unknown. However, if the total population size, N, is known, the calculator applies the finite population correction. The finite population correction formula is:
n = Nn₀ / (N + n₀ − 1)
where:
- N is the population size.
- n₀ is the initial sample size.
- n is the adjusted sample size.
The correction can reduce the required sample size when the sample represents a noticeable part of the population. If the population is very large, the correction has little effect. In that case, you can leave the population size field blank.
How to Calculate Sample Size for a Proportion by Hand
To calculate the required sample size for estimating a population proportion:
- Identify the confidence level, margin of error, and expected proportion.
- Find the z critical value for the selected confidence level.
- Convert the margin of error and expected proportion from percentages to decimals.
- Apply n₀ = z²p(1 − p) / E².
- If the population size is known, apply the finite population correction.
- Round the final result up to the next whole number.
Example 1.
A researcher wants to estimate the proportion of customers who prefer a new product. The researcher wants a 95% confidence level with a 4% margin of error and expects about 40% of customers to prefer the product. The population size is unknown.
What is the minimum sample size required?
Solution
To find the minimum sample size for the study manually, follow these steps:
Step 1: Identify the given values.
From the problem:
- Confidence level = 95%
- Margin of error = 4% or 0.04 as a decimal
- Expected proportion = 40% or 0.40 as a decimal
Step 2: Find the z critical value.
For a 95% confidence level, the two-tailed z-critical value is 1.96.
You can also use our Z Critical Value Calculator to verify the above result or find the z critical value for another confidence level.
Step 3: State the sample size formula.
For a population proportion, the sample size formula is: n₀ = z²p(1 − p) / E²
Step 4: Substitute the values.
n₀ = (1.96² × 0.40(1- 0.40) / 0.04²
= (3.8416 × 0.24) / 0.0016
= 576.24
Step 5: Round up.
The calculated sample size is 576.24. Since a sample cannot contain part of an observation, we round up to the next whole number.
Therefore, the required sample size is 577. This means that the researcher should collect at least 577 observations.
How to Calculate Sample Size for a Mean by Hand
To calculate the required sample size for estimating a population mean:
- Identify the confidence level, margin of error, and estimated population standard deviation.
- Find the z critical value for the confidence level.
- Apply n₀ = (zσ / E)².
- If the population size is known, apply the finite population correction.
- Round the final answer up to the next whole number.
Example 2.
Suppose a researcher wants to estimate the average examination score of a group of students. The researcher wants a 95% confidence level and a margin of error of 4 points. Previous data suggest that the population standard deviation is approximately 18 points. The population size is unknown.
Find the minimum sample size for the study.
Solution
Step 1: Identify the given values.
We know that:
- Confidence level = 95%
- Margin of error, E = 4
- Population standard deviation, σ = 18
Step 2: Find the z critical value.
For 95% confidence, the z-critical value is z = 1.96
Step 3: State the sample size formula.
For estimating a population mean, the sample size formula is: n₀ = (zσ / E)²
Step 4: Substitute the values.
Substituting the values into the formula, n₀ = (1.96 × 18 / 4)²
= (35.28 / 4)²
= 77.7924
Step 5: Round up.
Rounding 77.7924 up gives n₀ = 78.
Thus, the Required sample size is 78. This implies that the researcher should collect at least 78 observations.
Once the data have been collected, you can use the Mean Confidence Interval Calculator to calculate the confidence interval for the population mean.
What Determines the Required Sample Size?
The required sample size depends mainly on the confidence level, margin of error, population variability, and population size.
- Confidence Level. A higher confidence level requires a larger sample. For example, all other inputs being equal, a 99% confidence level requires more observations than a 95% confidence level because the corresponding z critical value is larger.
- Margin of Error. A smaller margin of error requires a larger sample. For example, estimating a proportion within ±2% requires substantially more observations than estimating it within ±5%. If you already have a sample and want to determine its precision, use our Margin of Error Calculator.
- Population Variability. Greater variability generally requires a larger sample. For a proportion, variability depends on p(1 − p). However, for a mean, it is represented by the population standard deviation, σ.
- Population Size. Population size can reduce the required sample when the population is finite and relatively small. For very large populations, however, increasing the population size has little effect on the required sample once the other inputs remain unchanged.
What Expected Proportion Should You Use?
When estimating a population proportion, enter your best estimate of the expected proportion if reliable information is available. For example, if previous research suggests that approximately 30% of the population has a particular characteristic, you can use p = 0.30.
However, if you do not have a reasonable estimate, use p = 0.50. A proportion of 0.50 maximizes p(1 − p), which produces the largest sample size for a given confidence level and margin of error. For this reason, 50% provides a conservative sample-size estimate when the true proportion is unknown. This setting is already used as the default in the calculator.
Why Is the Sample Size Always Rounded Up?
A sample size should always be rounded up, not to the nearest whole number. For example, suppose the formula gives n = 214.16. Rounding to the nearest whole number would give 214. However, 214 observations are slightly fewer than the number required to achieve the specified margin of error. As such, we round upward. Thus, n = 215
The same rule applies even when the decimal part is very small. If the calculated sample size is 214.01, the required sample size is still 215. Rounding upward ensures that the final sample is at least as large as the calculated minimum.
When Should You Use the Finite Population Correction?
Enter the population size when you are sampling from a known, finite population and the calculated sample represents a meaningful fraction of that population.
For example, sampling several hundred employees from an organization with 1,000 employees is different from sampling the same number of people from a population of several million.
The finite population correction accounts for this difference and usually reduces the required sample size. If your population is very large or its exact size is unknown, leave the population size field blank. The calculator will use the initial large-population sample size.
For a detailed calculation specifically based on Cochran’s approach for finite and infinite populations, use the Cochran’s Formula Calculator.
Sample Size and Margin of Error
Sample size and margin of error are closely related. As the sample size increases, the margin of error decreases. However, the relationship is not linear. Cutting the margin of error in half requires substantially more observations. This means that increasing a sample from 100 to 200 improves precision, but doubling the sample does not cut the margin of error in half.
Therefore, the appropriate sample size depends on how much precision you need and how practical it is to collect additional observations.
After collecting a sample, you can use the Proportion Confidence Interval Calculator or Mean Confidence Interval Calculator to estimate the corresponding population parameter.
Assumptions and Limitations
This calculator is designed for planning sample sizes when estimating a single population proportion or mean using a confidence level and margin of error.
Keep the following points in mind:
- The calculation assumes observations are obtained using an appropriate sampling method, such as simple random sampling.
- The result is the number of usable observations required. It does not automatically account for people who fail to respond or drop out.
- Complex survey designs, such as cluster sampling, may require an additional design-effect adjustment.
- The mean calculation requires an estimate of the population standard deviation.
- These formulas are for estimation. Studies designed to test hypotheses or detect differences between groups may require a power-based sample size calculation instead.
Therefore, the calculated value should be treated as the minimum required sample under the assumptions entered into the calculator.
Frequently Asked Questions
A sample size calculator is an online tool that determines how many observations or participants you need to estimate a population parameter with a chosen confidence level and margin of error. This calculator can find the required sample size for either a population proportion or mean.
For a large or unknown population and an expected proportion of 50%, a 95% confidence level with a 5% margin of error requires approximately 385 observations.
Use 50%. A proportion of 50% produces the largest required sample size and therefore provides a conservative estimate.
Yes, especially when the population is relatively small. If the population size is known, the calculator applies the finite population correction. For very large populations, the effect is usually small.
Yes. Select Population Mean, then enter the confidence level, desired margin of error, and estimated population standard deviation.
The sample size is rounded up because rounding down would give fewer observations than the calculated minimum. Rounding up ensures that the required level of precision is maintained.
