Home › Calculators › Confidence Interval Calculator

Confidence Interval Calculator

Enter a sample mean, standard deviation and sample size, or a count of successes, and pick a confidence level. You get the interval, the margin of error and every step of the formula.

Last updated:

Estimate
%

Common choices: 90, 95, 99

e.g. people who answered yes

Enter your values to see the result.
Advertisement
Advertisement

How to use the Confidence Interval Calculator

  1. Choose Mean or Proportion depending on what you are estimating.
  2. Enter the confidence level, usually 95%.
  3. Enter your sample statistics: mean, standard deviation and n, or successes and n.
  4. Pick t or z (for means) or Wald or Wilson (for proportions).
  5. Read the interval and the margin of error, and check the steps and the table of other confidence levels.

Confidence interval formulas

Mean (σ unknown): x̄ ± t* × s / √n, with t* from the t distribution with n − 1 degrees of freedom.
Mean (σ known): x̄ ± z* × σ / √n.
Proportion (Wald): p̂ ± z* × √(p̂(1 − p̂) / n).
Proportion (Wilson score): [p̂ + z²/2n ± z √(p̂(1 − p̂)/n + z²/4n²)] / (1 + z²/n).

Example: a sample of 36 has mean 50 and standard deviation 8. SE = 8 / 6 = 1.333, t* (35 df, 95%) = 2.030, so the margin of error is 2.707 and the 95% interval is 47.29 to 52.71.

Common critical values

Confidencez*t* (df = 5)t* (df = 10)t* (df = 30)
80%1.2821.4761.3721.310
90%1.6452.0151.8121.697
95%1.9602.5712.2282.042
98%2.3263.3652.7642.457
99%2.5764.0323.1692.750
99.9%3.2916.8694.5873.646

Need to plan a survey instead? The sample size calculator works the formula backwards from the margin of error you want.

Frequently asked questions

What is a confidence interval?

A confidence interval is a range of plausible values for an unknown population value, such as a mean or a proportion, built from sample data. A 95% interval comes from a method that captures the true value in 95% of repeated samples.

How do you calculate a 95% confidence interval for a mean?

Compute the standard error s / √n, multiply it by the critical value (1.96 for z, or the t value with n − 1 degrees of freedom) to get the margin of error, then take the mean plus and minus that margin.

Should I use t or z?

Use t when the standard deviation comes from your sample, which is almost always the case. Use z only when the population standard deviation is genuinely known. For large samples the two give nearly the same answer.

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. A poll reporting 52% ± 3% has a margin of error of 3 percentage points.

What is the difference between the Wald and Wilson intervals?

The Wald interval is p̂ ± z·√(p̂(1−p̂)/n), the textbook formula. The Wilson score interval adjusts the centre and width and stays accurate for small samples or proportions near 0% or 100%, where Wald performs poorly.

Why does a higher confidence level give a wider interval?

To be more confident of capturing the true value you need a larger critical value, for example 2.576 at 99% instead of 1.96 at 95%, so the margin of error and the interval grow.

Does a 95% interval mean there is a 95% chance the true value is inside it?

Strictly no. The true value is fixed; the 95% describes the long-run success rate of the method. In practice it is read as a range you can be 95% confident contains the true value.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Sample Size CalculatorHow many survey responses you need for a given confidence level and margin of error.Standard Deviation CalculatorStandard deviation, variance, mean, median, mode and quartiles.Percentile CalculatorValue at any percentile, percentile rank of a score, quartiles, IQR and outliers.Average CalculatorMean, weighted average, median, sum, min and max of any list.Inverse Normal Distribution CalculatorinvNorm: find the x or z value for a left, right, central or two-tail area, with a shaded curve.T Distribution CalculatorStudent's t probabilities and critical values for any df, with the area shaded on the curve.T-Table (Student's t Distribution)Interactive t-table: critical t-values for any df and α, p-values, and a printable full table.Z-Table (Standard Normal Table)Interactive z-table: find the area for any z-score, or the z-score for a probability.Weighted Average CalculatorCalculate a weighted mean from values and weights, step by step.A/B Test Significance CalculatorCheck if your A/B test result is statistically significant.Z-Score CalculatorZ-score from a value, mean and SD, plus percentile and p-value; or the value from z.Probability CalculatorFind and, or, not, conditional and at-least-once probabilities from P(A) and P(B).Permutation and Combination CalculatorCalculate nPr and nCr, with or without repetition, as exact big numbers.Mean Median Mode CalculatorFind the mean, median, mode, range, min, max, sum and count of a list of numbers.Correlation Coefficient CalculatorPearson r and Spearman rank correlation with significance and interpretation.Average Order Value CalculatorAverage order value from revenue and orders, plus the revenue impact of raising AOV.Binomial Distribution CalculatorBinomial probabilities P(X = k), at most, at least or between, with mean, variance and chart.Normal Distribution CalculatorNormal probabilities P(X < x), between two values and inverse percentiles, on a shaded bell curve.Poisson Distribution CalculatorPoisson probabilities for a rate λ: exactly k, at most, at least or between, with a chart.T-Test CalculatorOne-sample, two-sample (Welch/pooled) and paired t-tests with p-value and CI.Chi-Square CalculatorChi-square goodness-of-fit and independence tests with p-value and expected counts.P-Value CalculatorOne- or two-tailed p-values from z, t, chi-square or F statistics, with critical values.Variance CalculatorSample and population variance and standard deviation with a step-by-step deviations table.Five Number Summary CalculatorMin, Q1, median, Q3, max, IQR and fences of a data set, with a box plot.Outlier CalculatorFind outliers with 1.5×/3× IQR fences, z-scores or modified z-scores; get the cleaned data.Geometric Mean CalculatorGeometric, harmonic, arithmetic and quadratic means compared, or average growth from % changes.Expected Value CalculatorExpected value, variance and standard deviation from outcomes and their probabilities.One-Way ANOVA CalculatorOne-way ANOVA for 2-10 groups: SS, df, MS, F statistic, p-value, effect size and full table.Bayes Theorem CalculatorPosterior P(A|B) from P(A), P(B|A) and P(B|not A), with a probability tree and table.Box Plot MakerPaste data to draw box-and-whisker plots with quartiles, IQR and outliers. Download PNG or SVG.Coefficient of Variation CalculatorCV % from a dataset (sample or population) with mean, SD and a two-dataset comparison.Critical Value CalculatorCritical values of z, t, chi-square and F for any alpha, tails and degrees of freedom.Dice Probability CalculatorOdds of rolling a sum (exactly, at least, at most) with any dice, plus the full distribution.Effect Size Calculator (Cohen's d)Cohen's d, Hedges' g and Glass's delta from two means, SDs and sample sizes, with CI.Frequency Table GeneratorMake a frequency, relative and cumulative frequency table from numbers or categories.Histogram MakerPaste numbers, choose bins and get a histogram, frequency table and PNG download.Margin of Error CalculatorSurvey margin of error from sample size, confidence and proportion, with population correction.Moving Average CalculatorSimple, exponential and weighted moving averages of a data series, with table and line chart.Statistical Power CalculatorPower or required sample size for t-tests, proportions and correlations, with a power curve.Shannon Entropy CalculatorEntropy of text, data or probabilities in bits, nats or hartleys with a frequency table.Odds Ratio and Relative Risk CalculatorOdds ratio, relative risk, risk difference, 95% CIs and p-values from a 2x2 table.Standard Error CalculatorStandard error of the mean from data or SD and n, plus SE of a proportion, with CIs.Descriptive Statistics CalculatorPaste data and get mean, median, mode, quartiles, SD, skewness, kurtosis and a histogram.Empirical Rule Calculator68-95-99.7 rule ranges from a mean and standard deviation, with a shaded bell curve.Average Rate of Change CalculatorAverage rate of change of f(x), two points or a data table over [a, b], with the secant line.Binomial Expansion CalculatorExpand (a + b)^n with the binomial theorem: every term, Pascal coefficients and any specific term.Combinations GeneratorList every k-combination of your items, with or without repetition, and copy or export them.Covariance CalculatorSample and population covariance of paired X and Y data, with a step table and scatter plot.Grouped Data CalculatorMean, median, mode, variance and standard deviation from class intervals and frequencies.Permutations GeneratorList all permutations of letters, words or items, with k-permutations and repeats, and export them.
See all 52 Statistics & Probability Calculators →