Sample Size Calculator
Sample Size Calculator
| Margin (± points) | Responses needed | Invitations |
|---|---|---|
| ±1 | — | — |
| ±2 | — | — |
| ±3 | — | — |
| ±4 | — | — |
| ±5 | — | — |
| ±7 | — | — |
| ±10 | — | — |
Check a sample you already have
Comparing two conversion rates? That is a power calculation with a different formula: use the A/B Test Sample Size Calculator.
How to use the Sample Size Calculator
Say how precise the answer must be
The margin of error is the ± around the percentage your survey will report. ±5 points at 95% confidence is a common choice; halving the margin roughly quadruples the sample.
Add what you know about the population
Leave the expected proportion at 50% unless an earlier survey gives you a figure. Enter the population size only when it is small enough to matter, such as a company's staff or a school's parents.
Turn responses into invitations
The result is completed responses. If you expect, say, 20% of people to answer, enter 20 and the calculator divides it out for you. To see what a sample you already collected is worth, use the box at the bottom of the calculator.
What this calculates, and what it assumes
It answers one question: how many completed responses you need to estimate a single percentage (the share of customers who would recommend you, the share of staff who use a benefit) to within a chosen margin, from a simple random sample. The formula is n = z² × p(1 − p) / e², where z is the normal critical value for the confidence level, p the expected proportion and e the margin as a fraction. At 95% confidence (z = 1.95996), p = 0.5 and e = 0.05 it comes to 384.15, and the calculator always rounds up, to 385: rounding down would leave the margin slightly wider than the one you asked for.
When the population size matters
If you are sampling from a known, limited group, the correction n / (1 + (n − 1) / N) lowers the requirement, because each person you ask is a bigger slice of everyone there is. For a 2,000-person company the 385 above drops to 323. For a country it makes no practical difference: at a population of one million the answer is 384. The calculator applies the correction whenever you enter a population and shows the uncorrected figure beside it.
Why 50% is the default
The term p(1 − p) is largest at p = 0.5, so 50% gives the biggest sample and is safe when you have no earlier estimate. If a previous survey found 22%, the requirement at ±3 points and 95% falls from 1,068 to 733 (Penn State's STAT 506 notes work both cases). The risk runs one way: if the true figure turns out nearer 50% than your guess, your margin will be wider than planned.
What the number does not cover
Subgroups. The margin applies to the whole sample. Split 1,000 responses across six countries and each country has about 167, a margin near ±7.6 points rather than the ±3.1 of all 1,000 together. Size each group you want to report on separately.
Other designs. The formula assumes a simple random sample. Cluster samples (whole classes, whole streets) usually need more, because people in the same cluster tend to answer alike. Online panels and quota samples are not random samples at all, so a margin from this formula does not strictly apply to them.
Who answers. More responses narrow random error only. If the people who reply differ from those who do not, a larger sample measures the wrong thing more precisely.
Frequently Asked Questions
-
The precision of a sample percentage depends on how many people you asked, not on how many you did not. The population enters only through the factor (N − n) / (N − 1), which is almost exactly 1 unless your sample is a noticeable share of the whole group. That is why the population box changes the answer for a company or a school and hardly at all for a city.
-
Leave it at 50%. That gives the largest sample the formula can ask for, so the margin you planned holds whatever the true figure turns out to be. Use a lower figure only when an earlier survey of the same people supports it.
-
Type 200 into "Check a sample you already have". At 95% confidence, with the proportion at 50% and a large population, the margin is about ±6.9 points. If the result came out well away from 50%, enter that figure as the expected proportion and the margin narrows.
-
No. This sizes one estimate to a margin. An A/B test compares two rates and has to be sized for statistical power as well as confidence, which takes a different formula and usually a much larger sample. Use the A/B Test Sample Size Calculator for that.
-
No. The calculation runs in your browser and the figures you enter are not sent anywhere or added to the page address.
Method & sources
How it computes
n0 = z² × p(1 − p) / e², z the exact two-sided normal quantile (80, 90, 95, 99, 99.9%). With a population N: n = n0 / (1 + (n0 − 1)/N), algebraically Penn State STAT 506's Np(1−p)/((N−1)e²/z² + p(1−p)). Always rounded up. Margin of n responses: z × √(p(1−p)/n × (N−n)/(N−1)). Invitations = n ÷ response rate, rounded up. Simple random sampling assumed.
What this tool implements
- Sample size to estimate one proportion to within ±e under simple random sampling, as given in Penn State STAT 506 Lesson 2.3; its Example 2.4 (p = 0.5 and 0.22 at ±3%, 95%) gives 1,068 and 733, which the calculator reproduces.
- p = 0.5 maximises p(1 − p) and so the sample; it is the default when no earlier estimate exists (STAT 506 Lesson 2.3, "conservative sample size").
- Results are rounded up to a whole respondent, since rounding down leaves the margin wider than asked; the calculator checks that one respondent fewer would miss the margin.
- The normal approximation is flagged when n·p or n·(1 − p) is under 5 (NIST/SEMATECH e-Handbook §7.2.4).
- Corrected 2026-11-04: ±3% at 95% was printed as n ≈ 1,067 (now 1,068); a pull-quote said 385 holds for a population of one million (the correction gives 384, and the quote was removed); blank or zero inputs silently took defaults; z was rounded to three decimals. The A/B-test mode was removed in favour of the dedicated A/B Test Sample Size Calculator, and unsourced benchmarks (typical ASEAN survey sizes, platform test sizes, a 5% rule for the correction, inflation of α by peeking) were cut.
Sources
- Penn State Eberly College of Science, Department of Statistics. STAT 506 Sampling Theory and Methods, Lesson 2: Confidence Intervals and Sample Size, §2.3 Sample Size Needed for Estimating Proportion. https://online.stat.psu.edu/stat506/Lesson02.html
- Penn State Eberly College of Science, Department of Statistics. STAT 506 Sampling Theory and Methods, Lesson 1: Estimating Population Mean and Total under SRS (the finite population correction). https://online.stat.psu.edu/stat506/Lesson01.html
- NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.4 Does the proportion of defectives meet requirements? (min{Np, N(1 − p)} ≥ 5). https://www.itl.nist.gov/div898/handbook/prc/section2/prc24.htm