Skip to content
CalculatorZilo Logo
  • Home
  • CalculatorsExpand
    • Browse all calculators
    • Education
    • Real Estate
    • Chemistry
  • Finance
  • Math
  • Health & Fitness
  • Science
  • About
  • Contact
CalculatorZilo Logo
Home / Math Calculators / Confidence Interval Calculator
Statistics Calculators

Confidence Interval Calculator

Published onSeptember 25, 2025 Updated onOctober 25, 2026 9:03 am

A sample mean is one draw from a noisy process, so reporting it as if it were the population mean overstates what you know. A confidence interval fixes that: it reports the range of population values your sample actually supports, at a confidence level you choose. This calculator handles the three jobs that come up in practice: an interval for a mean, an interval for a proportion, and the sample size you need before you collect data at all.

Confidence Interval Calculator
Mean, proportion, and sample size, with automatic z or t selection and full working

95% confidence interval
[–, –]
How it was calculated

    Quick Answer

    Quick answer: A sample of 30 with mean 25 and standard deviation 2 gives a 95% confidence interval of [24.2843, 25.7157]: standard error 0.3651, z critical value 1.96, margin of error 0.7157. Drop the sample to 10 and the tool switches to the t-distribution automatically, because small samples carry more uncertainty than z admits.

    Key takeaways

    • Mean interval: sample mean plus or minus critical value x (s / sqrt(n)). Below n = 30 the tool uses t with n – 1 degrees of freedom; at 30 and above it uses z.
    • Proportion interval: p-hat plus or minus z x sqrt(p-hat(1 – p-hat) / n), with an automatic check that the normal approximation is safe for your counts.
    • Sample-size mode runs the math backwards: n = (z x sigma / E) squared for a mean, always rounded up.
    • 95% confident describes the method, not this one interval: about 95% of intervals built this way, over repeated sampling, contain the true value.
    On this page
    • Quick Answer
    • How to use the confidence interval calculator
    • The three formulas this tool runs
    • Worked examples, all three modes checked against the tool
    • Reading an interval without fooling yourself
    • What competing calculators miss
    • Frequently Asked Questions
    • Add This Calculator to Your Website
    • References

    How to use the confidence interval calculator

    Pick the tab that matches your question. Mean is the default: enter the sample mean, the sample size, and the sample standard deviation, choose a confidence level, and press Calculate. The result names the distribution it used, z or t, the critical value, the standard error, and the margin of error, with the working listed step by step.

    Proportion takes successes and total sample size instead, the shape of survey and quality data: 60 yes answers out of 100 responses, 14 defects out of 400 parts. Sample size reverses the problem for planning: give it the margin of error you need and your best estimate of spread or proportion, and it returns the smallest whole sample that delivers that precision. If your question is whether a result clears a significance threshold rather than where the true value sits, the statistical significance calculator covers the hypothesis-testing side of the same data.

    The three formulas this tool runs

    Every mode is the same idea, point estimate plus or minus a margin of error, with the margin built from the right standard error and critical value.

    Mean: CI = x-bar +/- crit x (s / sqrt(n)), where crit is t with n – 1 degrees of freedom when n is below 30, and z at n = 30 or more.
    Proportion: CI = p-hat +/- z x sqrt(p-hat(1 – p-hat) / n), where p-hat = successes / n.
    Sample size (mean): n = (z x sigma / E) squared, rounded up. Sample size (proportion): n = p(1 – p) x (z / E) squared, rounded up.

    The z or t choice is where simple calculators quietly go wrong. When the population standard deviation is unknown and estimated from a small sample, the estimate itself is uncertain, and the t-distribution prices that in with heavier tails and larger critical values. At 9 degrees of freedom the 95% t value is 2.262 against z at 1.96, a 15% wider margin. Using z on a sample of 10 does not make the interval a bit optimistic; it makes it wrong by construction. The National Institute of Standards and Technology makes the same point in its NIST/SEMATECH e-Handbook chapter on confidence intervals: intervals must widen when the standard deviation is estimated from limited data. As n grows the t values converge on z, which is why the switch at 30 costs nothing and protects everything below it. The probability foundations under both distributions are the same ones the compound probability calculator uses for combined events.

    Confidence levelz critical valuet at df = 9t at df = 29
    80%1.2821.3831.311
    90%1.6451.8331.699
    95%1.9602.2622.045
    98%2.3262.8212.462
    99%2.5763.2502.756

    Two patterns in that table drive most practical decisions. Higher confidence always means a wider interval, because the critical value grows. And small samples pay twice: fewer observations in the standard error and a larger t multiplier on top.

    Worked examples, all three modes checked against the tool

    The Mean tab is pre-filled with the first case below, and the Proportion and Sample size tabs are pre-filled with theirs, so each example reproduces exactly.

    Mode and inputsKey stepsResult
    Mean: x-bar 25, n 30, s 2, 95%SE = 2 / sqrt(30) = 0.3651; z = 1.96; margin = 0.7157[24.2843, 25.7157]
    Mean, small sample: x-bar 100, n 10, s 15, 95%SE = 15 / sqrt(10) = 4.7434; t (df 9) = 2.262; margin = 10.7296[89.2704, 110.7296]
    Proportion: 60 successes, n 100, 95%p-hat = 0.6; SE = 0.0490; margin = 1.96 x 0.0490 = 0.0960[0.5040, 0.6960]
    Sample size, mean: E 3, sigma 12, 95%n = (1.96 x 12 / 3) squared = 61.47, round upn = 62
    Sample size, proportion: E 0.05, p 0.5, 95%n = 0.25 x (1.96 / 0.05) squared = 384.16, round upn = 385

    The small-sample row is the one to remember. An older generation of calculators applied z = 1.96 there and reported a margin of 9.2971, an interval roughly 13% too narrow, stated with confidence the data had not earned. The t row is wider because honesty about a sample of 10 is wider. When a planning question depends on a condition being met first, the same careful conditioning shows up in the conditional probability calculator, which renormalizes probabilities the way the t correction rescales uncertainty here.

    [24.2843, 25.7157]
    95% CI, mean 25, n 30, s 2
    2.262
    t value at df 9, 95% (z would say 1.96)
    [0.5040, 0.6960]
    95% CI for 60 successes in 100
    385
    Sample for +/- 0.05 on a proportion at 95%

    Reading an interval without fooling yourself

    Three misreadings account for most confidence interval mistakes in reports and papers. First, the probability misreading: a 95% interval is not a 95% probability that the true value sits inside this specific interval. The true value is fixed; the interval either contains it or not. The 95% describes the procedure: repeat the sampling many times and about 95% of the intervals produced contain the truth. Second, the precision illusion: a narrow interval from a biased sample is precisely wrong. Intervals quantify sampling error only, not bad questions, self-selected respondents, or a broken sensor. Third, the overlap shortcut: two intervals overlapping does not prove the difference between groups is insignificant, and non-overlap is a stricter test than most people intend. Compare differences directly when the difference is the question.

    Planning rule of thumb. Halving the margin of error takes about four times the sample, because n sits under a square root in the standard error. Going from 100 responses to a margin half as wide means roughly 400, which is why the sample-size tab belongs at the start of a study, not the end.

    What competing calculators miss

    The strongest competitor found for this keyword, MiniWebTool, is genuinely good: it offers raw-data entry and automatic t or z selection. HeLovesMath covers more exotic interval types but spreads them across a cluttered page. Across the top results, the same three gaps repeat.

    Gap 1: no sample-size solver. Most tools answer where the true value might be, but not the planning question of how much data to collect. This page runs the calculation backwards in the same place, for means and proportions, with the conservative p = 0.5 option one click away.

    Gap 2: silent z on small samples. Several simple tools apply 1.96 at every sample size. On a sample of 10 that understates the margin by about 13%, as the worked example shows. Here the distribution used is printed on the result, with its degrees of freedom, so the choice is auditable.

    Gap 3: no approximation warning on proportions. The normal approximation behind the proportion interval needs both n x p-hat and n x (1 – p-hat) at 5 or more. Tools that skip the check will happily return intervals for 2 successes in 9 trials. This tool runs the check and warns you when the data are too thin for the method.

    Frequently Asked Questions

    Use t when the population standard deviation is unknown and estimated from the sample, especially below n = 30. The t critical values are larger, which widens the interval to reflect the extra uncertainty of a small sample. This calculator switches automatically: t with n – 1 degrees of freedom below 30, z at 30 and above, and it prints which one it used on every result.

    It describes the procedure, not this one interval. If you repeated the sampling and interval calculation many times, about 95% of the intervals produced would contain the true population value. The true value is fixed and this specific interval either contains it or does not; the 95% is the long-run success rate of the method.

    A higher confidence level uses a larger critical value: 2.576 at 99% against 1.96 at 95% and 1.645 at 90%. The larger critical value multiplies the standard error into a larger margin of error. More confidence requires a wider net. The only way to gain confidence without width is more data.

    The amount added to and subtracted from the point estimate to form the interval: critical value times standard error. For a mean with x-bar 25, s 2, and n 30 at 95%, the standard error is 0.3651 and the margin of error is 1.96 x 0.3651 = 0.7157, giving the interval [24.2843, 25.7157].

    Use the Proportion tab with successes and sample size. The interval is p-hat +/- z x sqrt(p-hat(1 – p-hat) / n). For 60 successes in 100 at 95%: p-hat = 0.6, standard error = 0.0490, margin = 0.0960, interval [0.5040, 0.6960]. The method needs both n x p-hat and n x (1 – p-hat) at 5 or more, and the tool checks this and warns you if it fails.

    Use the Sample size tab. For a mean: n = (z x sigma / E) squared. For a proportion: n = p(1 – p) x (z / E) squared, with p = 0.5 as the conservative choice when you have no prior estimate. The tool always rounds up: 61.47 becomes 62, and 384.16 becomes 385, because a fraction of an observation cannot be collected.

    No. It works from summary statistics: mean, sample size, and standard deviation for the mean mode, and successes plus sample size for the proportion mode. If you have raw observations, compute their mean and standard deviation first, then enter those. Summary input is what makes the small-sample t correction and the sample-size solver exact.

    Yes. The interval only accounts for random sampling error. A biased sample, a leading survey question, non-response, or a miscalibrated instrument all produce intervals that are mathematically correct and practically wrong. Treat the interval as the uncertainty from sampling, and judge the data collection separately.

    Add This Calculator to Your Website

    Embed the Confidence Interval Calculator on your own site. Pick a size to preview it live, then copy the code.

    Powered by Calculator Zilo

    References

    1. NIST/SEMATECH, e-Handbook of Statistical Methods, section 7.1.4, “What are confidence intervals?”: the federal reference for interval construction and for widening intervals when the standard deviation is estimated from limited data. NIST/SEMATECH e-Handbook: What are confidence intervals?. Accessed October 2026.
    2. Illowsky, B. and Dean, S., Introductory Statistics 2e (OpenStax, Rice University): the standard textbook treatment of confidence intervals for means and proportions and of sample-size determination. OpenStax: Introductory Statistics 2e. Accessed October 2026.
    3. Student (William Sealy Gosset), “The probable error of a mean,” Biometrika 6(1), 1908: the original paper introducing the t-distribution for small samples. Biometrika: The probable error of a mean (1908). Accessed October 2026.
    4. Neyman, J., “Outline of a theory of statistical estimation based on the classical theory of probability,” Philosophical Transactions of the Royal Society A 236, 1937: the foundational paper for confidence intervals as a procedure with a long-run coverage rate. Royal Society: Neyman on statistical estimation (1937). Accessed October 2026.
    5. US Census Bureau, “American Community Survey: accuracy of the data”: a large-scale applied example of published margins of error and how a major statistical agency computes and reports them. US Census Bureau: American Community Survey. Accessed October 2026.

    Related calculators

    Statistics CalculatorsSample Mean Calculator: Free Stats Tool OnlineThe sample mean is the average of a subset: add the values, divide by how many there are.Statistics CalculatorsStandard Deviation Probability CalculatorGiven a normal distribution’s mean and standard deviation, this calculator finds the probability of falling...Statistics CalculatorsLinear Regression CalculatorLinear regression finds the straight line that fits your paired data best: the line whose squared misses, added up, are smaller than any other line's.Statistics CalculatorsStatistics CalculatorPaste a dataset and this calculator returns the full descriptive picture: count, sum, mean, median, mode,...Statistics CalculatorsMean Median Mode Calculator Give this calculator any list of numbers and it returns the mean, median and mode together, with every step...Statistics CalculatorsCorrelation Coefficient Calculator Paste two columns of numbers into a spreadsheet and you can see they move together, but your eye cannot tell you how strongly, whether the pattern could be luck, or what line best fits it.

    We use cookies to analyze traffic. You can accept or decline cookies below. Learn more

    calculatorzilo

    CalculatorZilo

    Free calculators for everyday life. No signup, no cost, just answers.

    Categories

    Finance Math Health & Fitness Education Science Real Estate Chemistry Browse all calculators

    Popular tools

    Mortgage Payment Calculator BMI Walking Calculator Salary Per Minute Calculator Percentage Off Calculator

    Company

    About Us Contact Us Privacy Policy Terms and Conditions
    Disclaimer Cookie Policy DMCA Policy Affiliate Disclosure FAQ Accessibility Statement

    © 2026 CalculatorZilo • Free calculators for everyone

    • Home
    • Calculators
      • Browse all calculators
      • Education
      • Real Estate
      • Chemistry
    • Finance
    • Math
    • Health & Fitness
    • Science
    • About
    • Contact
    Search