Sample Size Calculator

Estimate sample size for a proportion or mean.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter a confidence level, a margin of error and an expected proportion to see how many respondents you need. 95% confidence with a ±5% margin needs 385.

How to use

1
Step 1
Enter the confidence level as a percent between 0 and 100 (90, 95, 99 or any other).
2
Step 2
Enter the margin of error as a decimal, such as 0.05 for ±5%.
3
Step 3
Enter the expected proportion (0.5 if unknown).
4
Step 4
Press Calculate.

How it works

The formula is n = z² · p(1 − p) ÷ e², rounded up. p = 0.5 gives the largest and safest answer. z comes from the inverse normal for your confidence level, so any level works. For 95% confidence and e = 0.05: 1.95996² × 0.25 ÷ 0.0025 = 384.15, which rounds up to 385.

n = z² · p(1 − p) ÷ e²      z = 1.6449 (90%), 1.9600 (95%), 2.5758 (99%)

Worked example

A tighter margin at higher confidence

Input
99% confidence, margin 0.03, p = 0.5
Output
1,844
Walkthrough
2.57583² × 0.25 ÷ 0.03² = 6.63490 × 0.25 ÷ 0.0009 = 1,843.03, rounded up to 1,844.

Limitations

  • The margin of error must be between 0 and 1: enter 0.05, not 5.
  • The confidence level must be strictly between 0 and 100.
  • For proportions only. The expected proportion p must be strictly between 0 and 1 (0 and 1.2 are errors). It assumes a large population, with no finite-population correction.

Questions

What sample size gives ±5% at 95% confidence?
385.
What sample size gives ±3% at 99% confidence?
1,844.
What if I expect a proportion of 0.2?
At 90% confidence and ±5%, you need 174.
Why use p = 0.5?
It maximises p(1 − p), so it gives the largest, safest sample size.
Can I use a confidence level other than 90, 95 or 99?
Yes. 80% confidence with ±5% and p = 0.5 needs 165; 97% needs 471.

Features

  • Any confidence level
  • Conservative p = 0.5 default
  • Rounded up
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Rectangle area as product of dimensions

    Khan Academy

    Foundational area thinking across math tools.

    Watch on YouTube
  • Standard Deviation vs Standard Error

    StatQuest with Josh Starmer

    Avoids mixing SD and SE when reading results panels.

    Watch on YouTube