# Sample size calculator with standard deviation

> The sample size needed to estimate a mean is n = (z × σ ÷ E)², rounded up. With a standard deviation of 15, a margin of error of 3 and 95% confidence (z = 1.96), n = (1.96 × 15 ÷ 3)² = 96.04, so 97 people. For a proportion with no prior estimate, p = 0.5 and a 5% margin give 385.

Source: https://www.calterix.com/en-us/calculator/standard-deviation/sample-size/ · Updated 11/06/2026 · en-US

## Sample size formula for a mean

```
n = (z × σ ÷ E)²
z: score for the confidence level, σ: standard deviation, E: margin of error
```
Example: (1.96 × 15 ÷ 3)² = 9.8² = 96.04, rounded up to 97.

The standard deviation has to come from somewhere before the study starts: a pilot sample, last year's data, or a published study. If you have a list of pilot values, get σ from the [standard deviation calculator](https://www.calterix.com/en-us/calculator/standard-deviation/) first, using the sample version.

Halving the margin of error quadruples the sample, because E is squared in the denominator. A margin of 1.5 instead of 3 needs 385 people instead of 97.

## Sample size for a proportion

```
n = z² × p × (1 − p) ÷ E²
```
p and E as decimals: 1.96² × 0.5 × 0.5 ÷ 0.05² = 384.16, rounded up to 385.

Surveys and polls estimate a share, such as the percent of voters who favor a measure. p × (1 − p) peaks at p = 0.5, so 50% is the safe choice when no estimate exists. An expected 30% with a 4% margin needs 505 responses at 95% confidence.

## Choosing the confidence level and z-score

| Confidence | z-score | Mean: σ 15, E 3 | Proportion: p 50%, E 5% |
| --- | --- | --- | --- |
| 90% | 1.645 | 68 | 271 |
| 95% | 1.96 | 97 | 385 |
| 99% | 2.576 | 166 | 664 |

Two-sided z-scores from the standard normal distribution. Sample sizes rounded up, checked by hand.

95% is the usual default in research and market surveys. 99% costs about 70% more respondents than 95% for the same margin.

## Small populations: the finite correction

```
n adjusted = n ÷ (1 + (n − 1) ÷ N)
```
N is the population size. Use the unrounded n, then round up at the end.

When the sample is a large share of the whole group, fewer responses are needed. A survey of a company with 1,000 employees at 95% confidence and a 5% margin needs 278 answers instead of 385. For populations in the hundreds of thousands, the correction barely moves the result.

## Worked examples

- Average delivery time, σ = 15 minutes, margin 3 minutes, 95%: n = 97 orders.
- Same study at 99% confidence: (2.576 × 5)² = 165.89, so 166 orders.
- Customer satisfaction share, no prior estimate, margin 5%, 95%: 385 responses.
- Same survey among 1,000 customers only: 278 responses.

> The formulas assume a simple random sample. Response rates, clustering, or subgroups need a bigger sample; plan for the number of completed responses, not invitations. Percent margins are easier to check with the [percentage calculator](https://www.calterix.com/en-us/calculator/percentage/).

## Frequently asked questions

### How do you calculate sample size with standard deviation?

Multiply the z-score by the standard deviation, divide by the margin of error, square the result and round up. With σ = 15, E = 3 and 95% confidence, n = 97.

### What sample size do I need for 95% confidence and a 5% margin?

385 for a proportion when no prior estimate exists, using p = 0.5.

### What z-score goes with 95% confidence?

1.96. For 90% use 1.645 and for 99% use 2.576.

### Why round the sample size up?

Rounding down would give a margin of error slightly larger than the target, so 96.04 becomes 97.

### Do I need a bigger sample for a bigger population?

Only up to a point. Past a few tens of thousands, the population size barely changes n; the finite correction matters when the sample is a large share of the group.
