Sample Size Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

What this sample size calculator does

This calculator helps you estimate how many responses you need so that your survey, poll, or A/B test results are statistically reliable. You choose a confidence level, a margin of error, and an expected proportion (or conversion rate). Optionally, you can enter the total population and a target statistical power if you are planning an experiment.

The tool then computes the minimum sample size that meets those settings. This prevents underpowered studies that produce ambiguous results and avoids collecting more data than you really need.

Key inputs: what each field means

The core sample size formula for proportions

For large populations and a proportion outcome (e.g., % who say "yes", % who convert), a standard formula for the required sample size is:

n = Z2 × p × ( 1 p ) e2

where:

The "worst case" is when p = 0.5, because the variability is highest when responses are evenly split. That is why many generic sample size tables assume 50% when you do not have prior data.

Adjusting for a finite population

If your population is not very large (for example, your entire staff, a specific email list, or all customers on a plan), you can refine the estimate using a finite population correction. After calculating the large-population sample size n, use:

nadj = n × N n + N 1

where N is your population size and nadj is the adjusted sample size. For very large N, this correction is tiny; for smaller populations, it can noticeably reduce how many responses you need.

Interpreting your results

Once you enter your inputs and run the calculator, you get a recommended sample size. In practice, you should:

If the required sample size seems very large, you can sometimes reduce it by accepting a slightly larger margin of error, using a lower confidence level, or narrowing the scope of your target group.

Worked example: employee survey with a finite population

Suppose you manage a company with 800 employees and want to estimate the percentage who support a new policy.

First, compute the large-population sample size:

n = 1.962 × 0.5 × ( 1 0.5 ) 0.052

This gives n ≈ 385 for a very large population.

Next, apply the finite population correction with N = 800:

nadj = 385 × 800 385 + 800 1

This yields an adjusted sample size of about 260 employees. Surveying 260 people instead of 385 saves effort while maintaining your desired precision and confidence.

How this relates to A/B tests and statistical power

For A/B tests, you are often trying to detect a difference between two conversion rates (for example, variant B converts at 12% instead of 10%). In this setting:

Higher power and smaller detectable differences both push the required sample size up. When planning an experiment, make sure your traffic or user base can realistically support the recommended sample size within your desired time frame.

Reference table: typical sample sizes for large populations

The table below shows approximate required sample sizes for a very large population, assuming a 50% proportion and common margins of error at typical confidence levels.

Confidence level Margin of error Approximate sample size (large population)
90% 5% ≈ 271
95% 5% ≈ 385
99% 5% ≈ 666
95% 3% ≈ 1,067
95% 2% ≈ 2,401

You can use these values as a quick sense check. The calculator refines them further based on the exact inputs you provide and any finite population adjustment.

Assumptions and limitations

This calculator is designed for proportion outcomes (yes/no, success/fail, convert/not convert) under a standard simple random sampling or simple randomized experiment. Keep in mind:

For high-stakes decisions (for example, clinical studies, major policy changes, or expensive experiments), consider consulting a statistician to tailor the design and sample size to your specific context.

Fill in the fields to calculate sample size.

Embed this calculator

Copy and paste the HTML below to add the Sample Size Calculator - Plan Surveys and A/B Tests to your website.