Sample Size Calculator

Choose what you want to find. For a required sample size, enter the margin of error you accept; for the margin of error of a sample, enter the sample size. You get the z value, Cochran's formula step by step, and a table for other margins.

Free Runs in your browser Checked Tuesday, November 10, 2026

Confidence level
What to find

For example 5 for ±5 percentage points. It must be more than 0 and less than 100.

The share of the population with the trait. Use 50% when you do not know it: that gives the largest sample.

Leave empty for a very large population. For a small population, the finite population correction lowers the sample size.

Result

Required sample size — Rounded up to a whole number.
Before the population correction — Cochran's n₀, shown when a population size is given.
Margin of error of the sample — The ± value at the chosen confidence level.
z value for the confidence level — From the standard normal distribution.

How it is worked out

Sample size for other margins of error

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Choose the Confidence level, usually 95%, and What to find.
  2. For a required sample size, type the Margin of error E you accept, and the Expected proportion p. For the margin of a sample, type the Sample size n instead.
  3. Add the Population size N if the population is small. Leave it empty for a very large one.
  4. Read Required sample size or Margin of error of the sample, then How it is worked out.

Cochran's formula for a proportion

The sample size needed to estimate a proportion with a margin of error E at confidence level C is n₀ = z² × p × (1 − p) ÷ E². The z value is the point of the standard normal distribution below which the share (1 + C) ÷ 2 lies: 1.9600 for 95%. The product p × (1 − p) is largest when p is 50%, which is why 50% is the safe choice when the proportion is not known.

It rests on the normal approximation to the sampling distribution of a proportion, which the NIST e-Handbook of Statistical Methods also uses when it sizes samples for proportions.

n₀ = z² × p × (1 − p) ÷ E²
n = n₀ ÷ (1 + (n₀ − 1) ÷ N)   (population correction)
E = z × √(p × (1 − p) ÷ n)   (margin of error of a sample)

Population correction and the margin of a sample

When the population N is small, a smaller sample reaches the same margin of error, so the answer is reduced by the correction. The correction matters only when n₀ is a large share of N.

Given a sample of n people, the margin of error follows from the same formula, solved for E. The result is the ± value to report with the proportion.

What the calculator does not cover

  • Sampling designs other than simple random sampling, such as clusters, strata or weights, and design effects.
  • Non-response, and the sample size needed for a comparison between two groups or for a statistical power.
  • Means and other statistics than a proportion.

Worked example: 95%, p = 50%, E = 5%

The z value for 95% is 1.9600, so n₀ = 1.9600² × 0.5 × 0.5 ÷ 0.05² = 384.15, which rounds up to 385 people.

If the population is only 1,000 people, the correction gives 384.15 ÷ (1 + 383.15 ÷ 1,000) = 277.73, so 278 people are enough.

Sample size
Margin of error 1% 9,604
Margin of error 5% 385
Margin of error 10% 97
Population 1,000, margin 5% 278

Frequently asked questions

Why do I use 50% for the proportion?

The product p × (1 − p) is largest at 50%, so a sample size calculated with 50% is large enough for any true proportion. If you know the proportion, a smaller value gives a smaller, still valid, sample.

What does the margin of error mean?

It is the ± range around the estimated proportion within which the true value is expected to lie at the chosen confidence level. A 5% margin at 95% confidence means that about 95 out of 100 such samples would give a result within 5 points of the true value.

Why is the sample size smaller for a small population?

Once a sample is a large share of the population, each person adds less new information. The finite population correction accounts for this, so the required sample is smaller than n₀.

Which confidence level should I choose?

95% is the most common choice. A higher level, such as 99%, needs a larger sample for the same margin; a lower level, such as 90%, needs a smaller one but gives a wider uncertainty.

Does the calculator include non-response?

No. Add the share of people you expect not to respond to the sample size yourself, by dividing the size by the expected response rate.

Are the numbers I enter sent to a server?

No. The calculation runs in your browser, and nothing you type is sent to us.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.