
Web Scripts & Software
DEV3 Sample Size & Margin of Error Calculator — Source Code (React + Tailwind)
from $29
Live demoBusiness tool
Free, no sign-up. Runs in your browser; nothing is uploaded. Buy the source code: $29 Regular / $69 Extended
Use 50 when unsure: it gives the largest, safest sample.
Leave empty for a very large population.
Shows how many invitations to send.
With 385 responses you can be 95% confident the true percentage is within ±5 points of your result.
| Margin of error | 90% | 95% | 99% |
|---|---|---|---|
| ±1% | 6,764 | 9,604 | 16,588 |
| ±2% | 1,691 | 2,401 | 4,147 |
| ±3% | 752 | 1,068 | 1,844 |
| ±4% | 423 | 601 | 1,037 |
| ±5% | 271 | 385 | 664 |
| ±7.5% | 121 | 171 | 295 |
| ±10% | 68 | 97 | 166 |
Proportion: n = z²·p(1−p) / e². Mean: n = (z·σ / e)². Finite population: n = n₀ / (1 + (n₀ − 1)/N). Margin of error: e = z·√(p(1−p)/n)·√((N−n)/(N−1)). A/B: n = (zα·√(2p̄(1−p̄)) + zβ·√(p₁(1−p₁)+p₂(1−p₂)))² / (p₂−p₁)². The z-score comes from an exact normal quantile. These assume a simple random sample; real surveys with weighting or clusters need a larger size.
Need Sample Size & Margin of Error Calculator as a full app for your business? Your own branding, your own data, your own users. Built in about a week, from $99. Send your requirements or SOW; you get a fixed quote and a delivery date.
The sample size & margin of error calculator stays free to use online. If you want the code to run, edit and ship in your own project, get the full source from the DEV3 Marketplace. Instant download, 6 months of support.
Run the whole business in one ready-made app. Buy once, own the source, and try each one live first.

Web Scripts & Software
from $29
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Web Scripts & Software
from $99
Live demo
Web Scripts & Software Mobile app
from $99
Live demo
Web Scripts & Software
from $99
Live demo
Web Scripts & Software Mobile app
from $99
Live demo
Web Scripts & Software
from $99
Live demoToo few responses and your survey result is noise. Too many and you waste time and budget. This calculator finds the sample size for a chosen confidence level and margin of error, the margin of error you get from a sample you already have, and the visitors per variant for an A/B test.
For a proportion the base size is n = z² · p · (1 − p) / e². With p = 50%, 95% confidence (z = 1.96) and e = 5% this gives 384.16, rounded up to 385. For a mean the formula is n = (z · σ / e)². For a finite population the result is divided by 1 + (n − 1) / N.
Enter the baseline conversion rate and the minimum detectable effect, then alpha (usually 0.05) and power (usually 0.8). The tool uses the standard two-proportion sample size formula. Detecting a relative lift of 20% on a 5% baseline (5% to 6%) at α = 0.05 two-sided and 80% power needs 8,158 visitors per variant, about 16,300 in total.
All calculations run in your browser and nothing is stored.
For a very large population, 95% confidence and a ±5 point margin of error need 385 responses. ±3 points needs 1,068 and ±1 point needs 9,604. Smaller populations need fewer.
It is the plus-or-minus range around a survey result inside which the true population value probably lies, at your chosen confidence level. A result of 60% with ±5 points means roughly 55% to 65%.
p = 50% gives the largest variance, so it gives the largest and safest sample size when you have no prior estimate. If you know the true figure is nearer 10% or 90%, the required sample drops.
Only when the sample is a big share of the population (over about 5%). The finite population correction then reduces the required sample. For populations above 100,000 it makes almost no difference.
Divide the sample size you need by your expected response rate. If you need 385 replies and expect 20% to respond, invite about 1,925 people.
It depends on the baseline rate, the smallest lift you care about, alpha and power. Detecting a small lift on a low conversion rate can need tens of thousands of visitors per variant, which this tool calculates.