Sample Size Calculator

Required sample size—
Z-value used—

How Sample Size Calculator is calculated: n = z² × p × (1 − p) ÷ E², with z = 1.645 (90%), 1.96 (95%) or 2.576 (99%)

What sample size do you actually need?

Sample size is the number of people you must survey before you can trust the result. Ask too few and your percentages wobble by so much that the survey tells you almost nothing. Ask too many and you burn time and money chasing precision nobody needs. The sample size calculator finds the smallest number that hits the accuracy you asked for.

The three inputs decide everything. The confidence level is how sure you want to be — 95% is the usual choice, meaning that if you repeated the survey 100 times, about 95 of the results would land inside your margin of error. The margin of error is how close the survey answer must be to the truth, usually 5%. The population proportion is your best guess at the share you are measuring; 50% is the safe default because it needs the biggest sample.

This calculator takes those three inputs and returns the required sample size, rounded up, plus the z-value it used. It runs entirely in your browser, so nothing is uploaded and nothing is stored.

How the sample size formula works

The formula is n = z² × p × (1 − p) ÷ E². The z is the standard score for your confidence level: 1.645 for 90%, 1.96 for 95% and 2.576 for 99%. The p is the population proportion as a decimal, and E is the margin of error as a decimal. Square the z, multiply by p times one-minus-p, and divide by the squared margin of error.

Run the default case through it. At 95% confidence, a 5% margin of error and a 50% proportion: n = 1.96² × 0.5 × 0.5 ÷ 0.05² = 3.8416 × 0.25 ÷ 0.0025 = 384.16. You cannot survey 0.16 of a person, so the answer is always rounded up — to 385 people. Rounding down would leave you just short of the accuracy you asked for, which is why the ceiling matters.

The proportion p is the input people think about least, yet it drives the answer. The product p × (1 − p) is largest at p = 0.5, where it equals 0.25, and it shrinks as p moves towards 0 or 1. At p = 0.3 it is 0.21, which needs a smaller sample. That is why 50% is the conservative default: if you do not know the true share, assume 50% and you will never come up short.

Confidence level, margin of error and proportion, explained

The confidence level is the input people get wrong most often, because 95% sounds like a grade and it is not. It does not mean there is a 95% chance your one survey is right. It means the method works 95 times out of 100 across many surveys. Picking 99% instead of 95% sounds safer, and it is — but it costs you. At a 5% margin of error and 50% proportion, 99% confidence needs 664 people against 385 at 95%, a jump of more than 70% for a modest gain in certainty.

The margin of error is where the money goes. Halving it from 5% to 2.5% does not double the sample — it quadruples it, because the margin sits squared in the denominator. That is the single most useful fact in survey planning: small gains in precision cost a lot of interviews. A 3% margin at 90% confidence and 50% proportion needs 752 people, nearly double the 385 that a 5% margin needs at 95%.

The proportion is your best prior guess. If you already know roughly 30% of customers prefer your product, type 30% and the calculator will ask for 323 people at 95% confidence and a 5% margin, instead of 385. Only do this when you have real evidence for the guess; if the true share turns out to be near 50%, a sample sized for 30% will miss its target. When in doubt, leave it at 50%.

A worked example: surveying 385 people

Say a shop wants to know what share of its customers would use a home-delivery service. It wants 95% confidence and a margin of error of 5%, and it has no prior guess, so it uses 50%. The formula gives n = 1.96² × 0.25 ÷ 0.0025 = 384.16, rounded up to 385 customers. If the survey then finds 60% in favour, the shop can report 60% plus or minus 5% — the true share is very likely between 55% and 65%.

Now change one input at a time and watch the sample move. Raise the confidence to 99% and the same survey needs 664 people, because the z-value rises from 1.96 to 2.576 and z is squared in the formula. Tighten the margin to 3% at 90% confidence and it needs 752 people, because a smaller margin sits squared underneath. Drop the proportion to 30% at 95% and 5% and it needs only 323 people.

These three moves show the whole trade-off. Confidence and precision both cost interviews, and the cost grows fast because both inputs are squared. The practical rule is to pick the loosest margin and the lowest confidence you can honestly defend, then let the calculator tell you the number. Most published surveys use 95% and 5% for exactly this reason: 385 is affordable, and the accuracy is good enough to act on.

Who uses a sample size calculator, and why

Market researchers use it before a single question is asked, because the sample size fixes the survey budget. Interviewers are paid per response, so the difference between 385 and 664 people is a real line in the budget. The calculator turns a vague plan into a firm quote: this many interviews, this much money, this much accuracy.

Students use it for dissertations and class projects, where the examiner will ask how the sample was chosen. A number pulled from thin air does not survive that question; a number from the standard formula, with the confidence level and margin stated, does. It also stops the common error of surveying 30 friends and treating the result as if it described a whole city.

Clinics, schools and small businesses use it for feedback forms and satisfaction surveys. A clinic that wants to know if patients are happy with waiting times does not need to ask everyone — 385 responses at 95% confidence and a 5% margin describe the whole patient list well enough to act on. A percentage calculator then turns the raw counts into the shares the report actually quotes.

Sample size vs margin of error: the trade-off

Sample size and margin of error are two sides of one bargain, and the formula shows exactly how they trade. The margin of error shrinks with the square root of the sample, not with the sample itself. Quadrupling the sample from 100 to 400 only halves the margin; going from 400 to 1,600 halves it again. Each extra point of precision costs more than the last, which is why huge samples are rare outside national polls.

This is also why tiny samples are worse than useless for percentages. With 25 responses, a 95% margin of error is around 20 points — a result of 60% really means somewhere between 40% and 80%. Nobody can run a business on that. With 100 responses the margin is about 10 points, and with 385 it is 5. The jump from 25 to 385 is where a survey stops being an anecdote and starts being evidence.

The comparison that matters is against a probability calculator: the sample size formula tells you how many people to ask, and probability tells you how likely a given split is by chance alone. Together they answer the two questions every survey faces — how many is enough, and could this result just be luck?

Common sample size mistakes

The first mistake is surveying whoever is easiest to reach and calling the result representative. The formula assumes a random sample. If you only ask your own followers, your regulars, or people who happen to be online, the maths still gives you a number — but the number describes the wrong group. A biased sample of 385 is worse than a random sample of 100, because the bias does not shrink as the sample grows.

The second mistake is forgetting the response rate. If you need 385 completed surveys and only half the people you contact reply, you must contact about 770. Plan for the replies you will actually get, not the invitations you send. Response rates of 10 to 20% are normal for email surveys, so the contact list is often five to ten times the target sample.

The third mistake is sizing for the whole survey and then slicing it. A sample of 385 gives a 5% margin for the total, but if you split it into five age groups of about 77 each, every subgroup has a margin near 11%. If the subgroups matter, size the sample for the smallest group you need to report, not for the total.

The fourth mistake is rounding down. The formula gives 384.16, and the answer is 385, never 384. Rounding down leaves you a fraction short of the accuracy you promised yourself. The calculator rounds up automatically, so the number you see is the number to use.

How to use this sample size calculator

Pick your confidence level first: 95% is the standard choice, 90% if you can live with a little less certainty, 99% when the decision is high-stakes. Then set the margin of error — 5% is the usual default, 3% when you need tighter numbers, 10% for a quick pulse check. Leave the population proportion at 50% unless you have solid evidence for another value.

The results update live. The headline number is the required sample size, rounded up to whole people, with the z-value used shown below it. Treat that number as a minimum: survey at least that many, and contact extra people to allow for non-response.

Everything runs in your browser. No account, no upload, no data sent anywhere. Once you know how many people to ask, an average calculator can summarise the ratings they give you, and a standard deviation calculator can show how much they disagreed with each other.

Frequently Asked Questions

At 95% confidence, a 5% margin of error and a 50% proportion, the formula gives 1.96² × 0.25 ÷ 0.0025 = 384.16, which rounds up to 385 people. At 99% confidence the same survey needs 664 people, because the z-value rises from 1.96 to 2.576.

Use 50%. The product p × (1 − p) is largest at 50%, so it gives the biggest — safest — sample size. If the true share turns out to be 30% or 70%, your sample is still large enough. Only use another value when you have solid prior evidence for it.

It quadruples. The margin of error sits squared in the denominator of n = z²p(1 − p) ÷ E², so halving E multiplies the sample by four. For example, at 95% confidence and 50% proportion, a 5% margin needs 385 people and a 2.5% margin needs 1,537.

No. The formula assumes a random sample from the population you want to describe. If you only survey your own followers or whoever is easiest to reach, the result describes that group, not the whole population — and no sample size, however large, fixes that bias.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.