Sample Size Calculator
For a proportion, n = z² × p(1 − p) ÷ E². At 95% confidence (z = 1.96) with p = 0.5 and a 5% margin of error, n = 1.96² × 0.25 ÷ 0.0025, about 384.2, so you need 385. For a mean, n = (z × σ ÷ E)². Pick a calculation type and enter your figures.
Last updated by Ultra Calculator
Sample Size
How to calculate it
Mean, σ known: n = (z × σ ÷ E)² Mean, σ estimated: n = (t × s ÷ E)², with t on n − 1 degrees of freedom Proportion: n = z² × p(1 − p) ÷ E² Finite population: n′ = n ÷ (1 + (n − 1) ÷ N) Two groups: n per group = 2 × ((z + z_β) × σ ÷ δ)²
- n
- the sample size, rounded up
- z
- the critical value for the confidence level (1.96 for 95%)
- σ, s
- the standard deviation: known (σ) or estimated from past data or a pilot (s)
- t
- the t critical value for the confidence level, which depends on n itself
- E
- the margin of error you will accept
- p
- the expected proportion (0.5 if unknown)
- n′, N
- the corrected sample size and the population size
- z_β, δ
- the normal value for the chosen power (0.8416 for 80%) and the difference you want to detect
For a survey, the number to contact is the corrected n divided by the response rate. If that is more than the population, the calculator says so and gives the margin of error that contacting everyone would achieve, z × √(p(1 − p)(N − n) ÷ (n(N − 1))) for n replies. With σ estimated, t depends on n, so the calculator tries successive values of n until the formula is met.
Worked example
Survey at plus or minus 5% and 95% confidence
With p = 0.5, a margin of error of 0.05 and z = 1.96 (1.959964 to more places), n = 384.15, which rounds up to 385 responses for a large population.
| Calculation Type | Proportion |
|---|---|
| Confidence Level | 95% |
| Margin of Error (E) | 0.05 |
| Expected Proportion (p) | 0.5 |
| Calculation | Sample Size for Proportion |
|---|---|
| Required Sample Size | 385 |
| Confidence Level | 95% |
| Margin of Error | 0.05 |
| Critical Value | 1.96 |
| Unrounded Sample Size | 384.15 |
| Finite Population Correction Applied | No |
How to use this calculator
- Choose the Calculation Type and the Confidence Level. Use Mean, σ estimated when the standard deviation comes from a pilot study or past data rather than being known.
- Enter the Margin of Error (E): in your data's units for a mean, or as a decimal such as 0.05 for a proportion or survey.
- For a mean, add the Standard Deviation (σ). For a proportion or survey, check the Expected Proportion (p), which starts at 0.5.
- For the power option, enter the Standard Deviation, the Difference to Detect and the Statistical Power instead of a margin of error.
- Add the Population Size if the sample will be a sizeable share of it, and the Expected Response Rate for a survey, then read the sample size.
Frequently asked questions
How do you calculate sample size?
For a proportion, n = z² × p(1 − p) ÷ E². For a mean, n = (z × σ ÷ E)². Always round up. At 95% confidence with p = 0.5 and a 5% margin, that is about 384.15, so 385.
What sample size do I need for a survey?
For a large population at 95% confidence, about 385 responses give a margin of error of plus or minus 5 percentage points, and about 1,068 give plus or minus 3 points. These assume a simple random sample and p = 0.5.
Why use 0.5 for the expected proportion?
p(1 − p) is largest when p = 0.5, so 0.5 gives the biggest sample under this formula and is the safe choice when you don't know the answer in advance. If you expect around 10% or 90%, using that figure gives a smaller sample.
Does the population size matter?
Only when you sample without replacement and the sample would be a sizeable share of the population. With N = 1,000 the 385 above drops to 278 after the finite population correction. For a population of millions the correction makes almost no difference.
How do I allow for people who don't respond?
Divide the sample size by the expected response rate. The survey option does this with the unrounded figure: 384.15 ÷ 0.7 = 548.8, so you would contact 549 people to expect about 385 replies. That is an expected number, not a guarantee.
What is statistical power?
Power is the chance that a study detects a difference of the size you specify, if that difference really exists. 80% is a common minimum, which accepts a 20% chance of missing it. Higher power, or a smaller difference to detect, needs more participants.
Learn more
Margin of error and confidence level
The margin of error sets how precise the estimate must be, and the confidence level sets how often the method should succeed. Halving the margin of error needs about four times the sample, because n grows with 1 ÷ E².
Finite population correction
Sampling without replacement from a small population gives more information per response than the basic formula assumes. The correction n ÷ (1 + (n − 1) ÷ N) reduces the sample accordingly. It matters once the sample is more than a few per cent of N.
Power, difference and spread
For comparing two groups, the sample needed rises with the square of σ ÷ δ: halving the difference you want to detect quadruples the sample. Estimating σ well from past data matters as much as choosing the power.
- Planning how many people to survey for a customer or staff questionnaire
- Setting the number of measurements for a quality check on a mean
- Rough planning for the size of each group in a two-group experiment
- Budgeting how many invitations to send once non-response is allowed for
- Dissertation and research proposal method sections
Entering the margin of error as a percentage for a proportion
Type 0.05 for plus or minus 5 percentage points, not 5. For a proportion or survey, a margin of 1 or more is rejected with a reminder to use a decimal.
Confusing per-group and total sample size
The power option gives the number for each group. A two-group study needs the Total Sample Size.
Planning only for completed responses
If 30% of people won't reply, you need to contact more. Use the survey option with a realistic response rate.
Guessing σ too low
The sample needed for a mean grows with σ squared, so an optimistic standard deviation gives a study that is too small. Use pilot data or a defensible upper estimate.
- Run the calculation at a few margins of error to see the trade-off between precision and cost.
- Check the result afterwards with the confidence interval calculator using your real data.
- If your standard deviation is a guess, try a few values: the sample grows with its square, so a σ 20% higher needs 44% more observations.
Methodology and sources
The critical value z is the normal quantile for the confidence level: 1.645, 1.960 and 2.576 for 90%, 95% and 99%, worked out to full precision. The σ known, proportion and survey options use the z formulas above. The σ estimated option finds the smallest n for which n ≥ (t × s ÷ E)², with t from the t distribution on n − 1 degrees of freedom, so it asks for a few more observations than the σ known option. The power option uses z_β for the chosen power (0.8416 for 80%, 1.2816 for 90%) in the normal-approximation formula for a two-sided test of two equal groups. An exact calculation with the t distribution needs about one more per group: 92 rather than 91 in the example. The finite population correction is applied whenever you enter N, and sizes are rounded up to whole numbers. In the survey option, a plan that would need more contacts than the population holds is refused, with the margin of error that replies from everyone at your response rate would give instead.