Home / Tools / Sample Size

Sample Size Calculator

How many people do you need? That depends on whether you are comparing groups or estimating a single number, and those are two different calculations that take different inputs. Say what you are planning and you get either the calculator built for your test, or, for a survey estimate, your sample size right here.

The sample-size family: t tests, proportions, ANOVA.

What are you planning?

Each route below says what that calculator will ask you for.

Comparing a mean to a targetSample Size for t Tests Is our average handling time below the 6-minute standard? A one-sample t test. It asks for the difference you care about and the SD you expect (or Cohen's d directly), plus power and alpha. Open the t test calculator → Comparing two group meansSample Size for t Tests Does version B take less time than version A? A two-sample t test. It asks for the two means and a common SD (or Cohen's d), power, alpha, one or two tails, and the allocation ratio if your groups are unequal. Open the t test calculator → Comparing rates or percentagesSample Size for Proportions Does the new checkout convert better than the old one? A two-proportion test. It asks for the two rates you expect (or Cohen's h), power, alpha and tails. This is the one for A/B tests, click-through and conversion. Open the proportion calculator → Comparing three or more group meansSample Size for ANOVA Do these four training programmes differ at all? A one-way ANOVA. It asks for Cohen's f (or the group means and a common SD, or eta-squared), the number of groups, power and alpha. Open the ANOVA calculator → Estimating one number from a surveyYou are already here What share of customers would recommend us, give or take 3 points? No comparison, no test, just precision. The calculator below asks for the margin of error you want, your confidence level, and your population size if it is small. Jump to the calculator ↓

I want to estimate a percentage

Try:
How precise do you need to be?
Enter 3 for a result reported as "52% ± 3 points".
What you expect to find
50% is the worst case, so it can only overshoot.
Settings
Percent. 95 is standard.
Only matters if it is small.

Nothing you type leaves your browser.

Estimating a percentage

Survey 1,068 people

To report a percentage to within 3 points at 95% confidence.

1,068 people to survey
What if you accepted a different margin… ±3 points → 1,068 people
Exact n
1067.07
Margin at that n
2.999%
z for 95%
1.960
Population
Not set
What this means
How this number is computed
The same thing in R

No data leaves your browser Verified against R's qnorm() Free, no sign-up

Estimating and comparing are different questions

This is the fork that sends people to the wrong calculator, so it is worth two minutes.

Estimating asks how precisely you can pin down one number. What share of our customers would recommend us? What is the average basket size? There is no rival hypothesis and nothing is being tested. The thing you must decide is how much imprecision you can live with, and that is your margin of error. The calculator on this page answers that question.

Comparing asks whether two or more groups genuinely differ, and it is a fundamentally harder question, because now you can be wrong in two directions: you can miss a real difference, or you can invent one that is not there. Sizing a comparison needs an effect size (how big a difference is worth catching) and a power target (your chance of catching it if it is real). A margin of error contains neither of those, which is why you cannot size a comparison from one.

EstimatingComparing
The questionHow precise is my number?Do these groups differ?
You must supplyMargin of error, confidenceEffect size, power, alpha
You get backAn intervalA decision, and a p-value
Sized byPrecisionPower
UseThis pageThe chooser at the top

A worked contrast makes it concrete. Surveying 1068 people lets you say "52% approve, give or take 3 points" and that is the whole finding. But if what you actually wanted to know is whether approval rose since last quarter, you are comparing two proportions, and 1068 per wave gives you a specific and quite different power to detect a specific size of shift. Same people, same budget, different question, different arithmetic. Size for the question you will actually be asked at the end.

What actually moves the number

The margin of error dominates everything else. This table is live: it recomputes for what you have entered.

Margin of error90% confidence95% confidence99% confidence

Look down a column rather than across a row. Moving from 95% to 99% confidence costs you about 73% more people, which is real but survivable. Halving the margin costs you four times as many. Precision is the expensive axis, and it is the one people casually tighten in a planning meeting without noticing what they just spent.

Why halving the margin quadruples the sample

The single most useful fact about sample size, and it comes straight out of the square root.

The margin of error is proportional to 1/√n. Turn that around and n is proportional to 1/E². The margin improves with the square root of effort, so the cost of precision grows with the square. At 95% confidence with p = 0.5:

MarginPeoplevs the row above
±8 points151
±4 points6014x
±2 points2,4014x
±1 point9,6044x

Each halving is a clean factor of four. Going from 8 points to 1 point, a range that sounds like a modest tightening when you say it out loud, is a 64-fold increase in fieldwork. This is why the last point of precision costs more than every earlier point combined, and why "can we just make it a bit more accurate?" is never a small request.

The same law read backwards is more cheerful: if your budget is fixed and you can only afford a quarter of the sample you wanted, you do not lose three quarters of your precision. You lose half of it. Small surveys are less useless than people assume.

Why 50% is the safe default

Every polling shop plans at p = 0.5, and the reason is a parabola.

The variance of a proportion is p(1 − p). That expression is a downward parabola: it is largest exactly at p = 0.5, where it equals 0.25, and it falls away toward both ends, reaching zero at 0 and 1. A proportion near 50% is genuinely the hardest one to pin down, because that is where individual answers disagree with each other most.

So planning at 0.5 gives you the largest sample any true proportion could possibly require. Whatever the answer turns out to be, your realised margin can only come in tighter than you promised. That is a good property for a plan to have.

If the truth isp(1−p)People needed for ±3 points at 95%
50%0.25001,068
30% or 70%0.2100897
10% or 90%0.0900385
5% or 95%0.0475203

Notice the symmetry: 30% and 70% cost exactly the same, because p(1−p) does not care which side of the middle you are on. And notice how much cheaper rare events look. If you have real prior evidence that the rate is near 5%, planning at 5% saves you 80% of the fieldwork. But you are betting on that prior. If the truth comes back at 20%, your margin will be wider than you promised, and you will have no way to fix it after the fact. Plan at 0.5 unless you have solid evidence, and if you do plan at a low rate, consider a middle value as a hedge rather than your best guess.

Does your population size matter? Usually not

The most persistent misconception in survey planning: that you need a fixed percentage of the population.

You do not. Sampling error is driven by how many people you ask, not by what share of the population they represent. To estimate within 3 points at 95% confidence you need about 1,068 people whether your population is 200,000 or 200 million. A national poll of 1,000 and a city poll of 1,000 carry the same margin. This surprises people, but it falls straight out of the formula: the population size N does not appear in n₀ = z²p(1−p)/E² at all.

The population only enters through the finite population correction, and only bites when your sample is a meaningful fraction of the whole:

PopulationPeople needed for ±3 points at 95%Share of the population
1,000,0001,0670.1%
20,0001,0145%
5,00088018%
1,00051752%
50034168%
1009292%

The correction is n = n₀ / (1 + (n₀ − 1)/N), and the intuition is exhaustion: once you have asked a large share of a small population, there is not much left to be uncertain about. At the limit, asking everybody leaves no sampling error at all. So enter a population size when you are surveying a school, a company, a customer list or a town. Leave it blank for anything national. Between those, it costs nothing to enter it and watch whether the number moves.

One caveat worth stating plainly: the correction only removes sampling error. It says nothing about non-response, a bad frame, or people telling you what they think you want to hear. Surveying 92 of 100 employees gives you a tiny sampling margin and can still be badly wrong if the 8 who declined are the 8 who were unhappy.

What this rough cut assumes

It is the standard survey formula, and standard means it takes some things on faith.

AssumptionWhat it meansIf it is wrong
Simple random samplingEveryone is equally likely to be picked, independentlyClustered or stratified designs need a design effect; multiply n by it (often 1.5 to 3)
Normal approximationThe sampling distribution is close enough to GaussianBreaks down for very small n or proportions near 0 or 1; use an exact interval instead
z, not t (for means)The critical value ignores that the SD is estimatedSlightly optimistic below about n = 60; add a few observations
You know the SD (for means)The SD you enter is the SD you will seeThe whole answer scales with it; a pilot beats a guess
Everyone respondsn is people who answer, not people you contactDivide n by your expected response rate to get the contact list size
Sampling error is the only errorThe frame is right and answers are honestNo sample size fixes bias; a bigger sample just makes you more confident about the wrong number

The last two rows are where real surveys actually go wrong. A 30% response rate means your 1,068 respondents need 3,560 invitations, and the people who ignored you may differ systematically from the people who replied. That difference is not in the margin of error, is not reduced by recruiting more, and is usually larger than the sampling error you spent all this effort optimising. The margin of error is the smallest of your problems; it is just the only one with a formula.

Questions people ask

What sample size do I need for a survey?

For a poll reporting percentages to within 3 points at 95% confidence, you need 1,068 respondents, assuming the worst case p = 0.5. Tightening to 1 point pushes it to 9,604; relaxing to 5 points drops it to 385. Population size barely matters unless it is small: 1,068 covers a population of 200,000 or 200 million alike.

Why do sample size calculators assume 50 percent?

Because p(1−p), the variance of a proportion, is maximised exactly at 0.5. Planning there gives the largest sample any true proportion could need, so your realised margin can only come in tighter than promised. If you have solid evidence the rate is near 5%, planning at 5% cuts the sample by about 80%, but you are betting on that prior: if the truth is nearer 50%, your margin will be wider than you promised and it will be too late to fix.

Does the size of my population matter?

Much less than people expect. Sampling error depends on how many you ask, not what fraction of the population they are. To get within 3 points at 95% you need about 1,068 people whether the population is 200,000 or 200 million. The finite population correction only bites when your sample is a large share of the whole: at a population of 5,000 the requirement falls to 880, and at 500 it falls to 341, because you are approaching a census. Enter a population for a school, company or customer list; leave it blank for anything national.

What is the difference between estimating and comparing?

Different questions, different arithmetic. Estimating pins down one number and is sized by the margin of error you can live with. Comparing asks whether groups differ and is sized by power: your chance of detecting a real effect of a given size. A comparison needs an effect size and a power target, which a margin of error does not contain. This page answers the estimating question; the chooser at the top routes comparisons to the t test, proportion and ANOVA calculators.

Should I use z or t to plan a sample size for a mean?

Use z, which is what this page does. The t critical value needs degrees of freedom, which need n, which is what you are solving for. That circularity is normally ignored because it barely matters: above about n = 60, t and z agree to within roughly 2%. If your answer comes back under 30, the z-based n is a little optimistic, so add a few. Once n is fixed, the margin-of-error calculator gives the exact t-based margin.

Why does halving my margin of error quadruple the sample?

Because the margin goes as 1/√n, so n goes as 1/E². Halving E means quartering 1/n, which means four times the people. At 95% with p = 0.5: 8 points needs 151, 4 points needs 601, 2 points needs 2,401, 1 point needs 9,604. Each step is a clean 4x, and the whole span from 8 points to 1 is a 64-fold increase.

Do I round the sample size up or down?

Always up. The formula returns the exact point where the margin equals your target, say 1067.07. Rounding down leaves the margin wider than you asked for; rounding up puts it a shade tighter, and you cannot recruit 0.07 of a person. This page shows the exact value and the margin your whole-person sample actually delivers, which is always slightly better than requested.

Is this the same as a power calculation?

No. This page sizes for precision (how tight is my estimate?). A power calculation sizes for detection (what is my chance of finding a real effect?). Different inputs, different questions. A survey sized for a 3-point margin has no power target because it is not testing anything. If you will run a test on the data, size it with the power analysis tool or the right calculator from the chooser above.