About Sample Size Calculator
This sample size calculator is free, needs no sign-up and runs in your browser, so nothing you type is uploaded. It answers four common questions. How many people do I need to survey to estimate a proportion within a margin of error? What margin of error does my sample give? How many observations do I need to estimate a mean? And how many visitors does an A/B test need to detect a given change in a conversion rate?
For surveys you set the confidence level (90%, 95% or 99%), the margin of error, the expected proportion (50% is the cautious choice) and, if your population is small, the population size. The calculator applies the finite population correction, so surveying 1,000 people from a population of 1,000 is not asked for 385 responses. The step-by-step panel writes the formula with your numbers, and a bell curve shows the confidence level the margin is based on.
The A/B mode is a power calculation for comparing two proportions. You give the baseline conversion rate, the smallest change worth detecting (relative or absolute), the power and the significance level, and it returns the number of people per group, using the same normal-approximation formula as R’s power.prop.test. It is a fixed-sample plan and it does not cover sequential testing or multiple variants.
How to use Sample Size Calculator
- Choose what to calculate: survey size, margin of error, a mean, or an A/B test.
- For a survey, set the confidence level, the margin of error in percentage points and the expected proportion. Use 50% if you are unsure.
- If your population is small, type its size to apply the finite population correction.
- For an A/B test, enter the baseline rate, the change to detect, the power and the significance level.
- Read the result, then open the working to copy the formula into your methods section.
Features
- Survey sample size for a proportion at 90%, 95% or 99% confidence.
- Margin of error for a given sample size, with finite population correction.
- Sample size to estimate a mean from the standard deviation and the margin of error.
- A/B test sample size per group from baseline rate, minimum detectable change, power and significance.
- Finite population correction when the population is known and small.
- A bell curve of the confidence level and step-by-step KaTeX working.
The formulas
The survey formula is Cochran’s. With p = 0.5 it gives the largest sample, which is why it is the safe default. The finite population correction shrinks the sample when it is a sizeable share of the population. The A/B formula balances the two error rates: the significance level and the power.
proportion n0 = z² · p(1 − p) / E²
mean n0 = (z · σ / E)²
finite N n = n0 / (1 + (n0 − 1) / N)
A/B (each group) n = (z_α √(2 p̄ q̄) + z_β √(p1 q1 + p2 q2))² / (p1 − p2)²
always round upWorked examples
Survey, 95% confidence, ±5 points, p = 50%, very large population gives n0 = 384.15, so 385 responses
Cochran (1977): 384.16, rounded up to 385.
Same survey, population of 1,000 and of 10,000 gives 278 and 370 responses
Matches the Krejcie and Morgan (1970) table, which lists 278 for 1,000 and 370 for 10,000.
1,000 responses, 95% confidence, p = 50% gives margin of error ±3.099 points
Mean, σ = 15, margin ±2, 95% confidence gives 217 observations (n0 = 216.08)
A/B test, 50% to 75%, power 90%, α = 0.05 two-sided gives 77 per group (n = 76.71 unrounded)
Matches the R documentation example power.prop.test(p1 = .50, p2 = .75, power = .90), n = 76.7.
Survey sample size by margin of error (p = 50%, large population)
| Margin of error | 90% confidence | 95% confidence | 99% confidence |
|---|---|---|---|
| 10 points | 68 | 97 | 166 |
| 7 points | 139 | 196 | 339 |
| 5 points | 271 | 385 | 664 |
| 4 points | 423 | 601 | 1037 |
| 3 points | 752 | 1068 | 1844 |
| 2 points | 1691 | 2401 | 4147 |
| 1 points | 6764 | 9604 | 16588 |
Good to know
What the survey formula assumes
It assumes a simple random sample and that people who are invited actually answer. Real surveys have non-response and design effects from clustering or weighting, which raise the sample you need. Divide the answer by your expected response rate to know how many people to invite, and treat the result as a minimum.
Limits of the A/B estimate
The A/B figure is for a single comparison of two conversion rates in a fixed-size test. It uses the normal approximation, so it is less accurate for very small rates or tiny samples. It does not adjust for several variants, repeated peeking at results or sequential designs. Stopping a test early when it first crosses 0.05 inflates false positives.
Privacy: how it works
- All formulas run in your own browser tab. Nothing you type is sent to Ulkaa or to any other server.
- There is no account and nothing is stored once you close the tab.
Tips
- If you do not know the expected proportion, use 50%. It gives the largest sample and so a safe margin.
- Smaller margins are expensive: moving from ±5 to ±2.5 points roughly quadruples the sample.
- For an A/B test, decide the smallest change that would matter to the business. Detecting tiny lifts takes very large samples.
- A population much larger than the sample barely changes the answer. The correction matters when the sample is more than about 5% of the population.
Frequently asked questions
Is it really free?
Yes. There is no price, no trial and no credit card. Ulkaa Tool does the work with your own device, so there is no server bill to pass on to you.
Do I need an account?
No. There is no sign-up and no login. Open the page and use it. An Ulkaa account is not needed for anything on this tool.
Does it run in my browser?
Yes. Your numbers are processed by code running in your browser tab, on your own device.
Is my data uploaded?
No. Your numbers are never sent to Ulkaa or to anyone else. You can check this yourself by watching the Network tab in your browser developer tools while you use the tool.
How big a sample do I need for a survey?
For a ±5 point margin at 95% confidence and a large population you need 385 completed responses. For ±3 points you need 1,068, and for ±1 point 9,604. A small population needs fewer.
What is the finite population correction?
When the sample is a sizeable share of a small population, each answer tells you more, so you need fewer responses. The correction n = n0 / (1 + (n0 − 1)/N) captures that.
Why is 50% the default proportion?
p(1 − p) is largest at 50%, so it gives the biggest sample. If you pick it you will have enough responses whatever the true proportion turns out to be.
What are power and significance in the A/B mode?
Significance (α) is the false positive rate you accept when there is no real difference. Power is the chance of detecting a real difference of the size you chose. 80% power and α = 0.05 are the common defaults.
Relative or absolute change for an A/B test?
Absolute change is in percentage points (10% to 12% is 2 points). Relative change is a share of the baseline (10% to 12% is a 20% lift). The calculator accepts either and shows the resulting rate.
How do I plan for people who do not respond?
Divide the required sample by your expected response rate. If you need 385 responses and expect 20% to reply, invite about 1,925 people.
Popular Sample Size Calculator pages
- Survey Sample Size CalculatorSet a confidence level, a margin of error and your population size to find how many responses to collect.
- Margin of Error CalculatorType the sample size and get the margin of error for a survey result.
- Sample Size for a Mean CalculatorEnter the standard deviation and the margin of error you can accept to find the number of observations.
- A/B Test Sample Size CalculatorEnter your baseline conversion rate and the smallest lift you care about to find the sample per group.