# Sample Size Calculator

- **URL:** https://codeasystem.com/calculators/statistics/sample-size-calculator/
- **Category:** statistics
- **Description:** Find how many survey responses you need for a given margin of error, with a finite-population correction option.
- **Primary output:** Sample size needed: 385 responses

## Inputs
- Confidence level (name: `confidence`, type: select)
- Margin of error (name: `moe`, type: number, example: 5)
- Population size (optional) (name: `population`, type: number, example: e.g. 10000)

## Outputs
- Sample size needed: 385 responses
- Unadjusted sample size (infinite population): 385
- Assumed response proportion: p = 0.5 (most conservative)

## Formula / methodology
```
n₀ = z² · p(1−p) / e²   (p = 0.5)   Corrected: n = n₀ / (1 + (n₀ − 1)/N)
```

For proportions, the most conservative assumption is p = 0.5, which maximizes required n regardless of the true split. We combine that with your chosen z multiplier and margin of error to get the baseline requirement n₀.

When you provide the population size N, the finite-population correction shrinks the requirement; polling 385 people out of 400 is nearly a census. Leave N blank for large or unknown populations where the correction is negligible.

## Assumptions & limitations
- Proportion-style questions (percentage splits), using the conservative p = 0.5.
- Simple random sampling without replacement.
- Responses are independent; nonresponse bias is not modeled.

## How to use
1. **Choose your precision**; ±5% suits informal research; ±3% is common for published polls.
2. **Set the confidence level**; 95% is standard; keep it unless stakeholders specify otherwise.
3. **Optionally add the population size**; Known, modest populations earn a meaningful discount via the correction factor.

## Example
At 95% confidence and a ±5% margin of error you need 385 responses for a large population; for a town of 10,000 the correction trims it to 371.

Result for these inputs:

```
Sample size needed: 385 responses
```

## About this calculator
### Why p = 0.5 is the safe default

Required n peaks when opinions split evenly. Planning with 50/50 guarantees your margin holds no matter the actual result; a 70/30 question would need fewer responses than calculated, never more.

### Sample size does not scale with population

Counterintuitively, a national poll and a city poll need nearly the same n (~385–1,067 depending on margin). Precision depends on absolute response count, not the fraction of the population sampled; until populations get small and the correction kicks in.

- ±5% at 95% → 385 responses.
- ±3% at 95% → 1,068 responses.
- Small N: correction can cut requirements substantially.

## FAQs
### What margin of error should I pick?

±5% is fine for internal decisions; ±3% for anything public-facing; ±1% gets expensive fast; responses needed grow with 1/e².

### Do these counts include nonresponse?

No; this is completes needed. Divide by your expected completion rate to find invitations to send.

### What if my population is unknown or huge?

Leave the population field blank. Beyond roughly 20× the sample size, the correction changes nothing material.

### Why does 99% confidence need more responses?

Higher confidence demands a bigger z multiplier (2.576 vs 1.96), and n grows with z²; about 663 vs 385 responses at ±5%.

## Related calculators
- [Confidence Interval Calculator](https://codeasystem.com/calculators/statistics/confidence-interval-calculator/)
- [Conversion Rate Calculator](https://codeasystem.com/calculators/marketing/conversion-rate-calculator/)
- [CTR Calculator](https://codeasystem.com/calculators/marketing/ctr-calculator/)

---
Last updated: 2026-08-23 · Version: 1.0.0 · [HTML version](https://codeasystem.com/calculators/statistics/sample-size-calculator/)
