Surveys · Margin of error · A/B tests

Sample Size Calculator

Use this sample size calculator to find how many responses your survey needs, how accurate your current sample is, or how many visitors an A/B test needs. Set your confidence level, margin of error and population, and the answer updates as you type.

  • 3 calculators in 1
  • Finite population correction
  • Any confidence level
  • Free, private, no sign-up
Confidence level 95% is the research standard

5% is common. Use 3% for tighter results.

Leave blank if it is very large or unknown.

Keep 50% if unsure. It gives the safest sample.

Email surveys often get 10% to 30%.

Sample size needed

370

responses at 95% confidence, ±5% margin, population 10,000

Without population correction385
Invitations to send370
Share of population3.7%

Sample size by margin of error

Halving your margin to ±2.5% would need 1,333 responses.

Why it is different

Why this sample size calculator does more

Most sample size tools give one number and stop. This one shows how that number changes, plans for non-response and covers A/B tests too, so you can choose a sample with confidence.

  • Three calculators in one

    Switch between survey sample size, margin of error and A/B test sample size without leaving the page.

  • Finite population correction

    Small groups need fewer responses. The tool adjusts the sample automatically when you enter a population size.

  • Response-rate planning

    Enter your expected response rate to see how many invitations to send, not just how many replies you need.

  • Live sensitivity chart

    See instantly how the sample grows as the margin of error shrinks or the effect size gets smaller.

  • Exact Z-scores

    Use any confidence level, such as 92.5%. The Z-score comes from an exact inverse normal formula, not a short lookup list.

  • Private and shareable

    Everything runs in your browser. Copy a ready-to-paste result or share a link that reopens your exact inputs.

Step by step

How to use the sample size calculator

Pick a mode above, then follow these steps. Results update as you type.

  1. Choose a confidence levelSelect 95% for most research. Pick 90% for quick checks or 99% when mistakes are costly.
  2. Set your margin of errorDecide how far your result may drift from the true value. Plus or minus 5% suits most surveys.
  3. Add your population sizeEnter the number of people you could survey. Leave it blank if the group is very large or unknown.
  4. Adjust proportion and response rateKeep 50% unless past data says otherwise. Then add your expected response rate to plan invitations.
  5. Compare and shareTap a row in the chart to test another margin. Finally, copy the result or share a link with your team.
Formula

How to calculate sample size

Sample size depends on three things: how confident you want to be, how precise the result must be, and how varied the answers are likely to be. First, the calculator finds the sample for a very large population. Then it applies the finite population correction if you entered a population size.

Sample size n₀ = Z² × p(1 − p) / e²
Finite population n = n₀ / (1 + (n₀ − 1) / N)
Margin of error e = Z × √(p(1 − p) / n) × √((N − n) / (N − 1))
Sample for a mean n₀ = (Z × σ / E)²
A/B test, per variant n = [Z₁₋α/₂√(2p̄(1−p̄)) + Z₁₋β√(p₁(1−p₁) + p₂(1−p₂))]² / (p₂ − p₁)²

Here, Z is the Z-score for your confidence level, p is the expected proportion, e is the margin of error and N is the population size. In the A/B formula, p₁ is the baseline rate, p₂ is the target rate and β sets the power.

Worked example: survey of 10,000 customers

Confidence level 95%
Z = 1.96
Expected proportion and margin of error
p = 0.5, e = 0.05
Sample for a large population: 1.96² × 0.25 / 0.0025
384.16
Correct for N = 10,000: 384.16 / (1 + 383.16 / 10,000)
369.98
Round up
370 responses
Invitations at a 30% response rate
1,234

So you need 370 completed responses. Because only about 3 in 10 people reply, you should invite at least 1,234 customers.

Quick reference

Sample size table at 95% confidence

Use this table for a fast answer. It assumes a 50% proportion, which gives the largest and safest sample.

Population±10%±5%±3%±1%
10050809299
50081218341476
1,00088278517906
5,000953578803,289
10,000963709654,900
50,000963821,0458,057
100,000963831,0568,763
1,000,000973841,0669,513
Unlimited973851,0689,604

Notice how the sample barely changes once the population passes about 20,000 people.

Choosing inputs

How to choose the confidence level and margin of error

The confidence level tells you how often your method would capture the true value if you repeated the survey many times. A higher level needs a larger Z-score and therefore a larger sample.

Confidence levelZ-scoreTypical use
80%1.282Early exploration
90%1.645Internal business decisions
95%1.960Academic and market research
98%2.326High-stakes surveys
99%2.576Medical and safety studies

The margin of error has an even bigger effect. Halving it roughly quadruples the sample, because the margin appears squared in the formula. For example, moving from ±5% to ±2.5% takes a large-population survey from 385 to 1,537 responses.

Sample size for A/B tests

A/B tests work differently. Instead of a margin of error, you choose the smallest lift worth detecting and the power, which is the chance of spotting that lift if it is real. Small lifts on low conversion rates need far more traffic, so check the sensitivity chart before you launch. If you are also working with averages or spread, the standard deviation calculator and Z-score calculator can help.

Benefits

Benefits of getting your sample size right

The right sample saves money and makes your findings easier to trust.

  • Avoid weak studies. Too few responses produce wide margins and results that may not hold up.

  • Cut wasted budget. Extra responses beyond your target add cost but very little accuracy.

  • Defend your method. Copy the result with its inputs for a thesis, report or ethics review.

  • Plan fieldwork. Know how many invitations to send before you start collecting data.

  • Run A/B tests that finish. Estimate test length from your daily traffic and avoid stopping too early.

  • Report results honestly. State the margin of error so readers know how precise each figure is.

FAQ

Sample size calculator FAQs

Clear answers to the questions researchers, students and marketers ask most.

For most surveys, 385 responses give a margin of error of plus or minus 5% at 95% confidence, however large the population is. Smaller populations need fewer responses. For example, a population of 1,000 needs about 278.

Multiply the squared Z-score by p(1 - p), then divide by the squared margin of error. With 95% confidence (Z = 1.96), p = 0.5 and a 5% margin, that gives 384.16, which rounds up to 385. Then apply the finite population correction if your population is small.

The margin of error is the range above and below your result that likely contains the true value. A result of 60% with a 5% margin at 95% confidence means the true figure is probably between 55% and 65%.

A proportion of 50% gives the largest value of p(1 - p), so it produces the safest and most conservative sample size. Use a different value only when earlier data suggests the likely result.

Only when the population is small. Above about 20,000 people the required sample barely changes. At 95% confidence and a 5% margin, 100,000 people need 383 responses while 1,000,000 need 384.

95% is the standard for academic, market and medical research. Use 90% for quick internal decisions and 99% when mistakes are costly. A higher confidence level always needs a larger sample.

It depends on your baseline conversion rate and the smallest lift you want to detect. With a 5% baseline, a 20% relative lift, 95% confidence and 80% power, you need about 8,158 visitors per variant.

Divide your required sample by the expected response rate. If you need 370 responses and expect 30% of people to reply, invite at least 1,234. The calculator does this for you automatically.

Get a sample size you can defend

Guessing leads to weak results or wasted budget. This sample size calculator gives you a clear number, the margin behind it and the invitations you need, in seconds.

Results assume simple random sampling. Clustered, stratified or weighted designs may need a design effect adjustment, so check with a statistician for complex studies.

Scroll to Top