Calculator Tools
Sample Size Calculator
Calculate the required sample size for a survey or measurement, or reverse the calculation to find the margin of error from a fixed sample size.
Mode
Confidence level
Sets the critical z value used in every mode.
z = ±1.96
Required sample size
385
Confidence 95% · p = 50% · e = ±5%
Critical z
±1.96
Raw n (before rounding)
384.1459
Raw n (no FPC)
384.1459
Rounded up sample (no FPC)
385
Step by step
- Step 1: Apply Cochran's proportion formulan = z² × p × (1 − p) / e² = 1.96² × 0.5 × 0.5 / 0.05² = 384.1459
- Step 2: Round up to the next whole respondentRequired sample = ⌈384.1459⌉ = 385 respondents.
Margin of error sensitivity
Required sample size at the chosen confidence and p = 50% for a large population.
| Margin of error | Required sample size |
|---|---|
| ±1% | 9,604 |
| ±2% | 2,401 |
| ±3% | 1,068 |
| ±4% | 601 |
| ±5% | 385 |
| ±7% | 196 |
| ±1% | 97 |
Reference
When to use each mode
Pick Proportion when you are estimating a percentage (yes/no questions, voter share, click-through rate). Pick Mean when you are estimating an average of a continuous measurement (height, time, dollars). Pick Margin of error when the sample size is fixed and you want to know the confidence interval width.
Why p = 50% is the default
The factor p × (1 − p) is largest when p is 0.5. Plugging in 50% gives the most conservative (largest) sample size, which guarantees the desired margin of error even if your prior estimate of p turns out to be wrong. Use a different p when you have strong prior information, such as a previous survey.
Finite population correction
The base formulas assume an infinite population. When you sample from a small known group (employees, students, registered users), applying n = n0 / (1 + (n0 − 1) / N) reduces the required sample size. The correction has almost no effect once N is much larger than n0, which is why most online calculators ignore it.
Common confidence levels
- 90% · z = 1.6449
- 95% · z = 1.9600 (most common for survey research)
- 99% · z = 2.5758
- 99.9% · z = 3.2905
Calculations run entirely in your browser. Nothing you type is uploaded.
How to use
- Pick a mode. Proportion is for percentage estimates (survey yes/no), Mean is for continuous measurements (height, time, money), and Margin of error is the reverse calculation from a fixed sample size.
- Choose the confidence level. 95% is the standard for survey research and uses z = 1.96; the row of preset chips covers 80, 85, 90, 95, 99, and 99.9 percent, and Custom accepts any value between 0 and 100 percent.
- Enter the inputs. In Proportion mode, the expected proportion defaults to 50 percent for the most conservative result and the margin of error is in percentage points. In Mean mode, enter the estimated standard deviation and the desired margin in the same units.
- Optionally enter the population size. Leave it blank for very large or unknown populations; supply it to activate the finite population correction, which lowers the required sample size when N is small.
- Read the headline number. The required sample is always rounded up. The sensitivity table shows how the answer changes if you loosen or tighten the margin of error.
- Click Copy summary to grab a one-line description with the inputs, the critical z value, and the result, ready to paste into a study protocol, an A/B test brief, a lab report, or a chat message.
About this tool
Sample Size Calculator answers the two questions every survey designer, A/B tester, and field researcher hits when they start a study. The first question is how many respondents or measurements are needed to estimate a value within a given margin of error, and the second is the reverse: given a sample you already have, what margin of error does that buy at the chosen confidence level. The Proportion mode uses Cochran's formula n = z² × p × (1 − p) / e², which is the standard textbook formula for percentage estimates and is what every published sample size calculator computes; it accepts an expected proportion p (default 50% for the most conservative result), a margin of error e in percentage points, and an optional population size N that activates the finite population correction n = n0 / (1 + (n0 − 1) / N) for surveys aimed at a small known group such as employees, students, or registered users. The Mean mode uses the normal approximation n = (z × σ / e)², where σ is your best estimate of the standard deviation of individual measurements and e is the desired margin of error in the same units. Both modes round up to the next whole respondent or measurement, because you cannot sample 384.16 people. The Margin of error mode does the reverse calculation: it takes a fixed sample size and returns the achievable margin at the chosen confidence level, also accepting an optional population to back out the finite population correction. The critical z value is derived from Peter Acklam's rational approximation of the standard normal inverse CDF, accurate to about 1.15 × 10⁻⁹ in the body of the distribution, so common choices match published values to four decimal places (95% gives ±1.9600, 99% gives ±2.5758, 90% gives ±1.6449). A built-in sensitivity table shows how the required sample grows or shrinks as the margin of error tightens, which is how field teams decide whether to push for ±3% or settle for ±5%. Step-by-step working is shown next to every result so the calculation can be copied into a methodology section, a stats homework page, a clinical trial protocol, or a marketing brief. Useful for survey design, A/B test planning, opinion polling, customer research, clinical trials, quality control sampling, field studies, election polling, market research, academic statistics homework, and any moment you need a defensible answer to "how many do we need?" Everything runs locally in your browser; nothing you type is uploaded.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
A/B Test Significance Calculator
Two-proportion z-test for A/B and split tests with p-value, lift, and confidence interval.
Open tool
CalculatorZ-Score Calculator
Convert raw values to z-scores, p-values, and percentiles, plus inverse lookup.
Open tool
CalculatorStandard Deviation Calculator
Sample and population SD, variance, quartiles, outliers, and step by step working.
Open tool
CalculatorMean Median Mode Calculator
Mean, median, mode, range, standard deviation, and five number summary from any list.
Open tool
CalculatorPercentage Calculator
Four percentage calculators: percent of, what percent, change, and discount.
Open tool
CalculatorPermutation and Combination Calculator
nPr, nCr, factorial, n^r, and multiset coefficient with exact step-by-step working.
Open tool