Confidence interval calculator

Paste a sample, or enter the mean, standard deviation and sample size, then pick the confidence level. You get the interval, the margin of error, the standard error and the critical value used.

Used with raw data. Separate numbers with commas, spaces or semicolons.
Used with mean, SD and sample size.
Used with mean, SD and sample size. The sample SD, or σ if you know it and choose z.
A whole number of at least 2.
From 50 to under 100, for example 95.
Confidence interval3.2125121 to 6.7874879
Margin of error
1.7874879
Sample mean
5
Standard deviation used
2.1380899
Sample size
8
Standard error (SD / √n)
0.75592895
Critical value t*
2.364624

Degrees of freedom: 7.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Choose raw data, or summary numbers.
  2. Enter the data (or the mean, SD and n) and the confidence level.
  3. Pick t when σ is unknown, which is the default, or z when it is known.

How it works

Margin of error = critical value × s / √n, and the interval is mean ± margin. The t critical value comes from Student’s t distribution with n − 1 degrees of freedom, evaluated with the regularised incomplete beta function and found numerically; z comes from the inverse normal. With raw data the sample SD (n − 1) is used, also for the z option.

Worked example

Sample: 2, 4, 4, 4, 5, 5, 7, 9 at 95% with t.

  • Mean = 40 / 8 = 5; sample SD = √(32 / 7) ≈ 2.1381
  • Standard error = 2.1381 / √8 ≈ 0.7559
  • t* with 7 degrees of freedom = 2.364624
  • Margin ≈ 1.7875, interval ≈ 3.2125 to 6.7875

Tips

  • Check the units: the interval has the same units as the data.
  • Small samples need t, not z; z understates the uncertainty.
  • This tool covers a mean, not a proportion or a difference of two means.

Frequently asked questions

What does a 95% confidence interval mean?

If you repeated the sampling many times and built an interval each time with this method, about 95% of those intervals would contain the true mean. It does not say there is a 95% chance that this particular interval does.

Should I use t or z?

Use t when the population standard deviation is unknown and you estimate it from the sample, which is the usual case. Use z only when σ is known. With a large sample the two critical values are almost the same.

How is the interval calculated?

The interval is the mean ± the critical value × SD / √n. For a mean of 50, SD 10 and n = 25 at 95% with t, the critical value is 2.063899 on 24 degrees of freedom, so the margin is 4.1278 and the interval 45.8722 to 54.1278.

How do I get a narrower interval?

Use a bigger sample, since the margin shrinks with the square root of n, accept a lower confidence level, or reduce variability in the measurement.

What are the assumptions?

The sample should be random and independent. For small samples the data should be roughly normal; with larger samples the central limit theorem makes this matter less.

More in Math

All tools in this category: Math ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.