Find the sample size needed for a target margin of error, with the finite population correction, rounded up.
Confidence Interval Calculator
Compute a confidence interval for a mean using Student's t by default, which is the correct basis when the deviation came from the sample.
- Free
- No sign-up
- Runs in your browser
Input
A whole number, a decimal, or a fraction such as 3/4. Arithmetic is exact, so fractions stay exact.
A whole number, a decimal, or a fraction such as 3/4. Arithmetic is exact, so fractions stay exact.
Enter 95 or 0.95 - both are read correctly.
Correct when the deviation was estimated from the sample
How many digits to show when the answer is irrational. An exact answer ignores this.
Try an example
Ready
Everything happens on this device. No upload, no account, no network request.
How to use this tool
- 1
Enter the sample mean, standard deviation and sample size.
- 2
Leave the basis on Student’s t unless you know the population standard deviation from outside this sample.
Questions about Confidence Interval Calculator
Does a 95% interval mean a 95% chance the mean is inside it?
No, and this is the most misstated idea in applied statistics. The true mean is a fixed number; the interval is what varies from sample to sample. The 95% describes the procedure: repeated on many samples, it produces an interval containing the true mean about 95% of the time. For this particular interval the mean is either in it or not. The probability statement belongs to the method, not to the result.
Why does it use t rather than z by default?
Because you almost certainly computed the standard deviation from the same sample, and that estimate carries its own uncertainty. Student’s t accounts for it by being wider: with 10 observations the critical value is 2.262 rather than the normal 1.960, about 15% wider. Using z there gives an interval that is too narrow and overstates your precision. Use z only when the population deviation is genuinely known from outside the sample, which is rare.
How are the t critical values computed?
From the exact closed forms of the t distribution for integer degrees of freedom, which terminate as finite sums - so no numerical integration or table lookup is involved. The implementation reproduces the printed critical value tables exactly and agrees with mpmath to 39 digits for 1 to 1000 degrees of freedom.
What else does this assume?
That the sample is random, and that either the data is roughly normal or the sample is large enough for the central limit theorem to apply. A convenience sample is not random, and no interval computed from it means what this one claims.
Is my data sent anywhere?
No. This runs as JavaScript in your browser tab: there is no network request carrying your numbers, nothing reaches a server log, and it keeps working with your connection off. You can confirm it in the browser’s network panel.
Related tools
Other tools you might reach for next.
Find the margin of error for a survey proportion, and say when the normal approximation behind it has broken down.
Evaluate an expression with exact fraction arithmetic, trigonometry, logarithms and factorials, reporting whether the result is exact.
Reduce a fraction to lowest terms, with its mixed number and exact decimal form including any repeating block.
Add two fractions exactly, showing the common denominator step and reducing the result.
Subtract one fraction from another exactly, showing the common denominator step.
Multiply two fractions exactly, multiplying across and reducing the result.
Divide one fraction by another exactly, by multiplying by the reciprocal.