Confidence Interval Calculator

Find a confidence interval for a population mean or a proportion. Enter your sample statistics, pick 90%, 95%, 99% or a custom confidence level, and this confidence interval calculator returns the interval, the margin of error, the standard error and the critical value. Everything runs in the browser.

  • Mean (z or t)
  • Proportion with Wilson
  • 90 / 95 / 99% presets
  • Stays on your device

Mean interval: x̄ ± critical value × s / √n. Use t when you only have the sample standard deviation, and z when the population standard deviation is known.

Confidence interval formulas

  • Mean, σ known: x̄ ± z × σ / √n
  • Mean, σ unknown: x̄ ± t × s / √n, with n − 1 degrees of freedom
  • Proportion: p̂ ± z × √(p̂(1 − p̂) / n)
  • Margin of error: critical value × standard error

Worked example

A sample of 25 widgets has a mean weight of 50 g and a sample standard deviation of 10 g. The standard error is 10 / √25 = 2. The 95% t critical value with 24 degrees of freedom is 2.064, so the margin of error is 4.13 g and the 95% confidence interval is 45.87 g to 54.13 g. Switching to 99% widens it to about 44.3 g to 55.7 g.

Related statistics tools

Need the sample standard deviation first? Use the standard deviation calculator. To test a claim instead of estimating a range, the p-value calculator turns a z, t or chi-square statistic into a p-value. For the spread of a data set and outliers, try the IQR calculator, and for a quick average use the mean median mode calculator.

Frequently asked questions

What is a confidence interval?

A confidence interval is a range of values built from sample data that is likely to contain the true population value. A 95% confidence interval means that if you repeated the study many times, about 95% of the intervals built this way would contain the true mean or proportion.

How do I calculate a confidence interval for a mean?

Compute the standard error s / √n, multiply it by the critical value for your confidence level to get the margin of error, then add and subtract that margin from the sample mean. With a mean of 50, s = 10 and n = 25 at 95%, the t critical value is 2.064, the margin of error is 4.13, and the interval is (45.87, 54.13).

Should I use a z or a t interval?

Use a z interval when the population standard deviation σ is known. Use a t interval when you only have the sample standard deviation s, which is the usual case. The t interval is wider for small samples and approaches the z interval as n grows.

What are the critical values for 90%, 95% and 99% confidence?

For z, the critical values are 1.645 for 90%, 1.960 for 95% and 2.576 for 99%. For t, the value depends on the degrees of freedom (n − 1). For example, with 24 degrees of freedom the 95% t value is 2.064.

How do I find a confidence interval for a proportion?

Find p̂ = x / n, then the margin of error is z × √(p̂(1 − p̂) / n). With 60 successes out of 100 at 95%, p̂ is 0.60, the margin of error is 9.6%, and the interval is about 50.4% to 69.6%. This calculator also shows the Wilson interval, which is more reliable for small samples.

What is the margin of error?

The margin of error is half the width of the confidence interval: the critical value times the standard error. It is the plus-or-minus figure you see in poll results. A larger sample or a lower confidence level makes it smaller.

What does a 95% confidence level really mean?

It describes the method, not one interval. It does not mean there is a 95% chance that the true value lies in the one interval you computed. It means the procedure captures the true value in about 95% of repeated samples.

How does sample size change the interval?

The margin of error shrinks with the square root of n. To cut the margin of error in half you need about four times as many observations. A higher confidence level makes the interval wider.

Is my data saved or uploaded?

No. The confidence interval calculator runs entirely in your browser. Your numbers are not sent to a server or stored, and there is no account.