Get the right sample size with a Sample Size Calculator
A Sample Size Calculator computes the number of participants needed to estimate a population parameter with a chosen confidence level and margin of error. You also specify an expected standard deviation (or a proportion baseline), and the calculator returns a practical “N” for planning.
Because sample size drives cost and accuracy, getting it right early prevents underpowered studies and wasted recruitment effort.
What “sample size” actually controls
Sample size affects how close your estimate is to the true population value. Larger samples reduce random error, making your results more precise. In planning, you choose a confidence level and a tolerable error, then compute the minimum N that meets those targets.
- Confidence level: How often your interval would contain the true value (e.g., 95%).
- Margin of error: The maximum expected difference between your estimate and the true value (e.g., ±3%).
- Variability: How spread out the data are. Higher variability requires larger N.
Two common scenarios: mean vs. proportion
Most “sample size” questions fall into two families. Use the mean formulas when you’re estimating an average (e.g., average time, weight, score). Use the proportion formulas when you’re estimating a percentage or rate (e.g., share satisfied, defect rate).
1) Sample size for estimating a population mean
When you want a confidence interval for a mean and you know (or can estimate) the population standard deviation, the classic planning formula uses the normal quantile.
Key variables
- z: z-score for the confidence level (e.g., 1.96 for 95%).
- σ: expected population standard deviation.
- E: margin of error you want (in the same units as the mean).
Formula (large-sample / known σ)
N = \(\left(\frac{z \cdot \sigma}{E}\right)^2\)
Then round up to the next whole number because you can’t sample a fraction of a person.
2) Sample size for estimating a population proportion
When you’re estimating a proportion p (a fraction between 0 and 1), variability depends on p. The planning formula uses p and (1 − p), plus the z-score and desired margin of error.
Key variables
- p: expected proportion (e.g., 0.50 if you’re unsure).
- E: margin of error (in proportion units, e.g., 0.03 for ±3%).
Formula
N = \(\frac{z^2 \cdot p(1-p)}{E^2}\)
If you don’t know p, using p = 0.5 is conservative because it maximizes p(1 − p), creating the largest required N.
How to choose the confidence level and margin of error
Most planning errors happen when teams pick targets that don’t match the decision they’re trying to make. A confidence level like 90%, 95%, or 99% trades off precision and risk. A smaller margin of error demands more participants.
- Use 95% confidence for many business and research contexts.
- Use a margin of error that matches how much error you can tolerate in decisions.
- Remember: halving E roughly quadruples N for both mean and proportion formulas.
Interpreting the output: what “N” means
The computed N is the minimum sample size needed for the specified assumptions. It does not guarantee you’ll get perfect results, because real-world data can violate assumptions (nonresponse bias, skewed distributions, measurement error).
In practice, plan for nonresponse by inflating N. A common approach is to divide by your expected response rate. For example, if you expect a 80% response rate, you’d sample N / 0.80.
Worked example: estimating a proportion
Suppose a company wants to estimate the share of customers who would recommend them. They choose 95% confidence and a margin of error of ±3% (E = 0.03). If they expect p = 0.50 (conservative), the required sample size becomes large enough to support that precision.
Using the proportion formula, you compute N from z² · p(1−p) / E², then round up. The result tells you how many customers to survey to claim that the true proportion is within ±3 percentage points about 95% of the time.
Worked example: estimating a mean
Imagine you’re measuring average processing time in minutes. You expect a standard deviation of 12 minutes from historical data. You want the mean within ±2 minutes at 95% confidence.
Plug z = 1.96, σ = 12, and E = 2 into N = (z·σ/E)². After rounding up, you get the minimum number of observations to estimate the mean with the targeted precision.
How the calculator below works
This Sample Size Calculator computes N using standard planning formulas for either a mean or a proportion. Select the scenario, enter your confidence level, margin of error, and variability inputs, and it returns the minimum required sample size.
It also includes basic input validation (so you don’t get misleading results from negative values or impossible proportions).
Frequently Asked Questions
What is a Sample Size Calculator used for?
A Sample Size Calculator is used to estimate the minimum number of participants needed so your confidence interval has a specified margin of error at a chosen confidence level. It supports planning by linking precision targets to cost and recruitment, helping you avoid underpowered studies and overly small samples.
Why does margin of error change sample size so much?
Margin of error appears in the denominator squared in both mean and proportion sample size formulas. That means tighter precision requires disproportionately more participants. For example, reducing E by half typically increases N by about four times, assuming the same confidence level and variability.
What margin of error should I choose?
Choose margin of error based on how much error your decision can tolerate. If a business decision changes when estimates move by more than 3 percentage points, use E = 0.03 for proportions. For means, pick an E in the same units as your outcome.
Should I use p = 0.5 if I don’t know the proportion?
Yes, p = 0.5 is commonly used when you lack a prior estimate because it maximizes p(1−p). That makes the required sample size conservative. If you later learn p is far from 0.5, you can reduce sample size for new studies or refine planning.
Do I need to add more for dropouts or nonresponse?
Often, yes. The formulas give the minimum effective sample size. If you expect nonresponse or unusable data, inflate N by dividing by your expected response rate. For example, with 80% response, collect N/0.80 to maintain the target precision.
Bottom line
A well-chosen Sample Size Calculator output gives you a defensible minimum N for the precision you need. Use the mean formulas for averages and the proportion formulas for rates, then round up and adjust for nonresponse when necessary.
Start with realistic inputs from prior data or pilots, and treat the result as a planning baseline—not a guarantee.