
Sample Size Calculator
Calculate the exact sample size and margin of error for your next survey or study. Use our free Sample Size Calculator for statistically accurate results.
Sample Size
385
Margin of Error
9.8%
There was an error with your calculation.
Last updated: June 26, 2026
Table of Contents
- Sample
- Margin of error
- Confidence Interval
- Interconnection between Sample in Statistics, Margin of Error, and Confidence Interval
- Formula to calculate Sample Size
- Example 1
- Example 2
- Formula to calculate the Margin of Error
- Example 3
- Formula to calculate the confidence interval
- Example 4
Our versatile sample size calculator features two primary functions: calculating the ideal sample size and determining the margin of error for your study.
To calculate your required sample size, begin by selecting your desired confidence level from the drop-down menu. Next, input the relative margin of error. (Note: You can convert an absolute margin of error into a relative one by dividing the absolute value by your point estimate). If you know the exact population proportion, enter it; otherwise, leave it at the default 50%. Enter the total population size in the designated field if known, or leave it blank for an unknown or infinite population. Finally, click "Calculate."
To determine the margin of error using the calculator's second function, start by choosing your confidence level from the drop-down menu. In the subsequent fields, enter the study's sample size and the population proportion. Lastly, input the population size—leaving it blank if unknown—and click "Calculate."
Sample
In statistics, a sample is a specific subset or portion of a larger population. The term "population" encompasses every single element or individual of interest in a given study. While surveying an entire population yields the most accurate data, doing so is rarely practical due to numerous limiting factors.
For instance, if you are studying a specific insect species in a vast jungle, the population is practically infinite, making a comprehensive census impossible. Additionally, some testing procedures are inherently destructive. If you open a sealed soft drink bottle to measure its exact volume, that specific product can no longer be sent to market.
Evaluating an entire population requires significant time, capital, and resources. Because researchers typically operate within strict budget and time constraints, conducting a full population census is unfeasible in most cases. The most effective solution is to extract a representative sample and conduct your research on that smaller group.
Margin of error
Because examining every component of a population is rarely possible, researchers use sample statistics (metrics calculated from the sample) to estimate population parameters (metrics characterizing the entire population). These sample statistics represent the actual data observed within your chosen sample. When you estimate a single value for a population parameter based on this data, it is known as a point estimate.
For example, if you want to estimate the average volume of soft drink bottles on a production line, you might select a random batch and calculate its average volume. Let's assume that batch yields an average volume (x̄) of 250 ml. Based on this point estimate, you assume the entire production line averages a volume (μ) of 250 ml per bottle.
In reality, an estimated parameter rarely aligns perfectly with the actual population parameter. This discrepancy occurs naturally because the calculation relies on a sample rather than the complete population.
The margin of error quantifies this uncertainty. It is defined as the maximum expected difference between a parameter's point estimate and its true population value, sometimes referred to as the maximum error of the estimate.
Confidence Interval
A confidence interval represents the acceptable range within which a population parameter is expected to fall. This range of estimates indicates that a parameter has been calculated within a specific margin of error. To calculate the lower boundary of a confidence interval, you subtract the margin of error from your point estimate. Conversely, to find the upper boundary, you add the margin of error to the point estimate.
Interconnection between Sample in Statistics, Margin of Error, and Confidence Interval
Rather than surveying an entire population, researchers study a sample to make educated estimates about population parameters. Because of this sampling approach, a natural variance exists between the estimated parameter and the true population parameter. The margin of error accounts for this by defining the maximum expected difference between the point estimate and the actual value.
Crucially, there is an inverse relationship between sample size and the margin of error. A larger sample size provides a more accurate representation of the broader population, effectively reducing the margin of error. Conversely, utilizing a smaller sample size increases the margin of error.
Ultimately, applying this margin of error to your initial point estimate yields the study's confidence interval.
Formula to calculate Sample Size
Depending on the data available, several formulas can be used to calculate the appropriate sample size.
Your desired confidence level dictates the degree of accuracy, while the acceptable margin of error determines the precision of your range estimate.
If the population standard deviation is known, you can calculate the minimum sample size required to achieve your target confidence interval using the following formula:
$$n=\left(\frac{z_{\alpha/2}×\sigma}{E}\right)^2$$
The final result n should be rounded up to the nearest whole number.
Alternatively, the Cochran formula allows you to determine the minimum sample size based on your acceptable margin of error, target confidence level, and the estimated proportion of the attribute within the population. The Cochran formula is expressed as:
$$n₀=\frac{z^2p(1-p)}{E^2}$$
- z = Z-score from the z-table corresponding to your desired confidence level
- p = The expected proportion of the attribute present in the population
- E = Margin of error
Example 1
Imagine we are researching international students enrolled in undergraduate courses across Canada. At the outset, we lack concrete data, so we hypothesize that international students make up 60% of all Canadian undergraduates. Consequently, the estimated population proportion is 60%. If we want a 95% confidence level and a 4% margin of error, what is the minimum sample size required for this study?
$$(1-\alpha)=95\%$$
$$z_{α/2}=z_{{95\%}/2}=1.96$$
$$p=60\%$$
$$E=4\%$$
$$n₀=\frac{z²p(1-p)}{E²}=\frac{1.96²×60\%×(1-60\%)}{4\%²}=576.24≈577$$
Therefore, a minimum of 577 students must be surveyed to achieve a 95% confidence level with a 4% margin of error.
The Cochran formula is ideal for large or infinite populations. However, if your population size is small or finite, you must adjust the sample size. The finite population correction formula is:
$$n=\frac{n₀}{1+\left(\frac{n₀-1}{N}\right)}$$
- n₀ = The initial sample size calculated using the Cochran formula
- N = Total population size
- n = Adjusted sample size for a finite population
Example 2
Now, suppose we are researching international students enrolled in undergraduate courses at your specific college in Canada. Similar to the previous example, we assume international students make up 60% of the student body. The estimated proportion remains 60%. However, the total number of students at your college is exactly 12,000. For a 95% confidence level and a 4% margin of error, what is the minimum required sample size?
In this scenario, because the population is finite, you must first calculate n₀ using the Cochran formula and then apply the adjustment.
$$n₀=\frac{z^2p(1-p)}{{E}^2}=\frac{1.96^2×{60\%}×(1-{60\%})}{{4\%}^2}=576.24$$
$$n=\frac{n₀}{1+\left(\frac{n₀-1}{N}\right)}=\frac{576.24}{1+\left(\frac{576.24-1}{12,000}\right)}=549.88\approx550$$
By using our dedicated minimum sample size calculator, you can bypass these complex manual calculations and get accurate results in a fraction of a second.
Formula to calculate the Margin of Error
You can mathematically rearrange the standard sample size formula to solve for the margin of error.
Starting with the minimum sample size formula:
$$n₀=\frac{z^2p\left(1-p\right)}{E^2}$$
We can isolate E (the margin of error) as the subject of the equation:
$$n₀=\frac{z^2p\left(1-p\right)}{E^2}$$
$${n₀}×{E}^2=z^2p\left(1-p\right)$$
$$E^2=\frac{z^2p\left(1-p\right)}{n₀}$$
$$E=\sqrt{\frac{z^2p\left(1-p\right)}{n₀}}$$
$$E=z\sqrt{\frac{p\left(1-p\right)}{n₀}}$$
Example 3
Returning to our nationwide research on international undergraduate students in Canada, we continue with the assumption that they represent 60% of the overall undergraduate population. If you survey a sample of 577 students and aim for a 95% confidence level, what is the exact margin of error for your study?
$$z_{{95\%}/2}=1.96$$
$$p=60\%$$
$$n₀=577$$
$$E=z\sqrt{\frac{p\left(1-p\right)}{n_0}}=1.96 \times \sqrt{\frac{60\% \times \left(1-60\%\right)}{577}}=4\%$$
If working with a finite population, you must first determine the adjusted n₀ using the following formula:
$$n₀=\frac{n-nN}{n-N}$$
Once you have that value, apply it to the main margin of error formula:
$$E=z\sqrt{\frac{p\left(1-p\right)}{n₀}}$$
Using the margin of error feature built into our sample size calculator empowers you to skip these tedious manual steps and instantly discover your study's margin of error.
Formula to calculate the confidence interval
Calculating a confidence interval is straightforward once you have established your margin of error. You can compute the confidence interval using the baseline formulas below:
Confidence interval = Point estimate ± Margin of error
The upper boundary of the confidence interval = Point estimate + Margin of error
The lower boundary of the confidence interval = Point estimate - Margin of error
For the population mean (μ), the confidence interval is expressed as:
x̄ - E < μ < x̄ + E
Here, x̄ - E represents the lower limit, while x̄ + E represents the upper limit.
Similarly, the confidence interval for the population proportion (P) is written as:
p - E < P < p + E
Example 4
Suppose you are researching the average program costs for international students in Canada. You select a random sample of 1,000 students. Based on your survey data, you estimate the average program cost to be CAD 20,000, with a calculated margin of error of CAD 5,000. How do you find the confidence interval for this average program cost?
Upper limit = x̄ + E = CAD 20,000 + CAD 5,000 = CAD 25,000
Lower limit = x̄ - E = CAD 20,000 - CAD 5,000 = CAD 15,000
Therefore, the complete confidence interval is:
x̄ - E < μ < x̄ + E
CAD 15,000 < μ < CAD 25,000



