Math calculator

Sample Size Calculator

This sample size calculator tells you how many responses a survey needs the moment you set your confidence level and margin of error. Pick 90, 95, or 99 percent confidence, choose how tight you want the margin, and you'll see the sample size right away. Add a population size and it applies the finite-population correction, and a live chart shows how big your sample is next to the whole group. It's the quick way to plan a poll or study.

  • 90, 95, 99 percent
  • Adjustable margin
  • Finite population
  • Custom proportion
  • Live sample view

Last updated June 18, 2026 Method: n = z² p(1-p) / e² Reviewed by the Calcowa math team

Confidence level
Sample vs population sample shaded mint
Sample size needed
385 responses
z-score
1.96
Before finite
385
Sampling rate
Formula used

n = 1.96² × 0.5(1 - 0.5) / 0.05² = 385

The formula

What is the sample size formula?

For a large population, the sample size is n = z² × p(1 - p) / e². Here z is the score for your confidence level, p is the expected proportion, and e is the margin of error as a decimal. At 95% confidence with a 5% margin and p set to 50%, that comes out to 385 responses.

When your group is small and known, you don't need that full number. The finite-population correction trims it: n = n₀ / (1 + (n₀ - 1) / N), where N is the population. For 1,000 people, the 385 drops to about 278. That's the calculator's two-step approach, and it's why a small population needs a smaller sample.

n = z² p(1-p) / e²
sample population
A sample drawn from the whole group
Step by step

How do you calculate sample size?

It's a short routine once you've got your settings. Here's the full sequence:

  1. 1

    Pick a confidence levelChoose 90, 95, or 99 percent. That sets the z-score: 1.645, 1.96, or 2.576.

  2. 2

    Choose a margin of errorDecide how tight you want the result, like plus or minus 5 percent, and write it as a decimal.

  3. 3

    Set the proportionUse 50% if you don't know it, since that gives the safe maximum sample.

  4. 4

    Apply the main formulaWork out n = z² × p(1 - p) / e² and round up to a whole number.

  5. 5

    Correct for a small groupIf the population is small, divide by (1 + (n - 1)/N). If it's large, skip this.

The trade-off

Confidence, margin, and why precision costs

There's always a trade-off between precision and effort. Bumping confidence from 95% to 99% raises the z-score, and that pushes the sample size up by roughly 70%. Tightening the margin hits even harder, because the sample grows with the square of the precision: halving the margin from 5% to 2.5% quadruples the sample. That's why polls settle on 95% confidence and a 3 to 5 percent margin, since it's the sweet spot where the numbers stay practical. If you're studying spread instead, the Standard Deviation Calculator and the Z-Score Calculator pick up where this leaves off.

Reference

Common sample sizes

These assume a large population and a 50% proportion, the safe default. Notice how a tighter margin and a higher confidence level both drive the sample up.

SettingsSample sizeGood to know
90% confidence, 5% margin 271 z = 1.645, the lightest common standard
95% confidence, 5% margin 385 The everyday survey default
95% confidence, 3% margin 1,068 Tighter margin needs a bigger sample
95% confidence, 1% margin 9,604 Very precise, very large
99% confidence, 5% margin 664 z = 2.576, the most cautious
FAQ

Frequently asked questions

Does a bigger population need a bigger sample?

Not by much, and that surprises people. Once a population is large, the required sample barely moves, so polling a whole country needs about the same sample as polling a large city. What really drives the sample size is your confidence level and margin of error, not the population. The finite correction only matters for small, known groups.

For a large population, the sample size is n = z² × p(1 - p) / e², where z is the score for your confidence level, p is the expected proportion, and e is the margin of error as a decimal. For a finite population of size N, you then correct it with n = n₀ / (1 + (n₀ - 1) / N). This sample size calculator runs both for you.

Most surveys use 95% confidence and a 5% margin of error, which is the standard you'll see in polls. A higher confidence level (99%) or a tighter margin (3% or 1%) gives more reliable results but needs a much larger sample. The 90% level is lighter and cheaper when precision isn't critical.

The margin of error is how far your survey result might sit from the true value, expressed as a plus or minus percentage. A 5% margin means a poll showing 60% support is really somewhere between 55% and 65%. Shrinking the margin makes the result tighter, but it raises the sample size sharply, since the size grows with the square of the precision.

Setting p to 50% gives the largest possible sample size, so it's the safe default when you don't know the proportion in advance. The term p(1 - p) is biggest at 0.5, which means you'll never undershoot. If you already know the proportion is near 10% or 90%, you can enter it to get a smaller, still-valid sample.

Not always. For a large population (tens of thousands or more), the finite-population correction barely changes the answer, so you can leave it blank. For a small, known group, like the 400 employees at a company, entering the population shrinks the required sample noticeably, since you're sampling a bigger fraction of the whole.

The z-score is how many standard deviations cover your confidence level. The common ones are 1.645 for 90%, 1.96 for 95%, and 2.576 for 99%. A higher confidence level means a larger z, which pushes the sample size up. This calculator picks the matching z when you choose a confidence level, or you can type a custom one.

Keep going

Related calculators

Working through statistics? These pair well with the sample size calculator.

Planning a survey?

Try the calculator above, or browse every math tool in the hub.

Math tools