Free tool · no sign-up

Free sample size calculator

Work out how many responses you need for a survey or test to hit a given confidence level and margin of error. Runs in your browser; nothing leaves your device.

50% is the most conservative / largest sample.
⚡ Free sample size calculator by DataHub Pro

Embed this free tool on your site

Copy this snippet — it drops the calculator straight into any page, with a small credit link back to us. Free to use anywhere.

<iframe src="https://www.datahubpro.co.uk/sample-size-calculator?embed=1" width="100%" height="560" style="border:1px solid #eee;border-radius:12px" loading="lazy" title="Free Sample Size Calculator by DataHub Pro"></iframe>

How it works

No black box — here's exactly what the calculator does.

1 · Pick confidence and margin

Choose your confidence level (how sure you want to be) and your margin of error (how precise the result needs to be). Tighter values need a larger sample.

2 · Use the safe default distribution

A 50% response distribution gives the largest, most conservative sample, so it's the safe default when you don't know how responses will split.

3 · Apply the formula

It computes the base sample as n0 = z² × p(1 − p) / e², where z is the z-score for your confidence level, p is the distribution as a fraction and e is the margin of error as a fraction.

4 · Correct for a small population

If you enter a population, the finite-population correction shrinks the number — small groups need fewer responses to represent the whole.

FAQ

How do I calculate sample size?

Use n = z² × p × (1 − p) / e², where z is the z-score for your confidence level, p is the expected response proportion (0.5 is the safest default) and e is your margin of error as a decimal. If your population is small, apply the finite-population correction to reduce the number.

What sample size do I need for 95% confidence and a 5% margin of error?

For a large population, about 385 responses. That comes from a z-score of 1.96, a 50% response distribution and a 0.05 margin of error. A smaller population needs fewer responses.

What is margin of error?

The margin of error is how far your sample result might differ from the true population value. A 5% margin means the real figure is likely within 5 percentage points of what your sample shows, at your chosen confidence level.

Got the responses in a spreadsheet?

DataHub Pro analyses survey and test data and writes the report — from your spreadsheet, in minutes.

Try DataHub Pro free →

Embed this tool on your site — free

Drop the Sample Size Calculator into your own blog post, intranet or client portal. It runs entirely in the visitor's browser, costs nothing, needs no account, and keeps working whether or not they ever visit us. All we ask is the credit line.

Sample Size Calculator Free tool by DataHub Pro