Skip to main content
engineering

Confidence Interval Calculator

Compute confidence intervals using z or t distribution with margin of error, SE, and visual interval bar

By Christopher FloiedPublished Updated

The example below uses these same controls. Shared inputs stay in the URL fragment; anyone with the link can read them.

Compute confidence intervals using z or t distribution.

Lower Bound
46.2659
Upper Bound
53.7341
Margin of Error
±3.7341
Critical t(α/2)
2.0452
CI = x̄ ± t(α/2, n-1) × s/√n
CI = 50 ± 2.0452 × 10/5.4772
CI = (46.2659, 53.7341)

95% Confidence Interval

46.266x̄ = 5053.734

Interpretation: We are 95% confident the true population mean lies between 46.2659 and 53.7341. Standard error = 1.8257, df = 29.

Sampling Distribution with Confidence Interval

Tip: hover to read values, click to pin a point for export

Learn with a worked scenario

Two-sided z or t confidence intervals for a population mean from summary data.

Question

Mean 52, sample SD 8, n = 25; choose a 95% t interval.

  1. SE = 8 / √25 = 1.6.
  2. For 24 degrees of freedom, t* ≈ 2.0639.
  3. 52 ± 2.0639 × 1.6 gives approximately 48.6978 to 55.3022.

The interval is about [48.6978, 55.3022], in the original measurement units.

Precision: The bounds, margin of error, standard error and critical value are shown to 4 decimals, and the interval bar's end labels to 3. Intermediate values are not rounded.

Load this example in the calculator

Try a variation

Increase n from 25 to 100, holding the mean at 52 and the SD at 8. How does the 95% t interval change? Predict the answer before you reveal it.

Predict, then reveal

It narrows to about 50.4126 to 53.5874. The standard error halves from 1.6 to 0.8, and with 99 degrees of freedom t* falls slightly to about 1.9842, so the margin of error drops from about 3.3022 to about 1.5874.

Change one input and compare
nSEApproximate 95% interval
251.648.6978 to 55.3022
1000.850.4126 to 53.5874
Load the variation in the calculator

Check the assumptions

  • Use t when the population SD is unknown and you supply a sample SD.
  • The sampling design and mean-based model must be suitable.
  • Confidence describes repeated-sample coverage of the method.

Common mistake: Interpreting the interval as containing 95% of individual observations.

Method reference: NIST/SEMATECH statistical handbook. These examples illustrate the method; they do not validate every possible input.

How to Use This Calculator

1

Enter your input values

Fill in all required input fields for the Confidence Interval Calculator. Follow the units and input format printed next to each field. Where a unit selector is available, choose the units that match your data.

2

Review your inputs

Double-check that all values are correct and match the units or format shown for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.

3

Read the results

The Confidence Interval Calculator computes the output in your browser and displays the results, with units clearly labeled, as soon as they are ready — no data sent to a server.

4

Explore parameter sensitivity

Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.

Formula Reference

95% CI

CI = mean ± 1.96 × (s/√n)

Variables: 1.96 = z-score for 95% confidence

Standard Error

SE = s / √n

Variables: Decreases with larger sample size

When to Use This Calculator

  • •Use the Confidence Interval Calculator to check your hand calculations on homework or exam problems — comparing its result with your own working helps identify arithmetic errors before they propagate.
  • •Use it during the early design phase to rapidly iterate on parameters and narrow down feasible configurations before committing time to detailed finite element simulations or full design packages.
  • •Use it when reviewing a colleague's calculation or checking a vendor's data sheet for plausibility — a quick sanity check can prevent costly downstream errors.
  • •Use it to generate reference data for a technical report or presentation without manual computation, ensuring consistent, reproducible numbers throughout the document.
  • •Use it in the field when a quick estimate is needed and a full engineering software package is not available.

About This Calculator

The Confidence Interval Calculator is a precision engineering calculation tool designed for students, engineers, and technical professionals. Compute confidence intervals using z or t distribution with margin of error, SE, and visual interval bar All calculations are performed using established engineering formulas from the relevant scientific literature and standards. Follow the units printed beside each field. Where a unit selector is provided, the selected unit is converted internally. Results are computed in your browser without sending data to a server, which keeps your inputs private. This calculator is intended as a supplementary tool for learning and design exploration; always verify results against authoritative references for safety-critical applications.

The Theory Behind It

A confidence interval (CI) is a range of values constructed from sample data that is likely to contain a population parameter with a specified probability. A 95% CI for the mean is the interval [x̄ − margin, x̄ + margin] where the margin is z_(α/2)·σ/√n (known σ) or t_(α/2, df)·s/√n (unknown σ). The interpretation is frequentist: if we repeated the sampling and CI construction many times, 95% of the intervals would contain the true mean. A single computed CI either contains the true mean or it doesn't — we can't say the true mean 'is in this specific interval with 95% probability.' Confidence level choices: 90% (z = 1.645), 95% (z = 1.960), 99% (z = 2.576). Higher confidence requires wider intervals. The width of the CI depends on: (1) sample size n (larger n = narrower CI, width scales as 1/√n); (2) variability (larger σ or s = wider CI); (3) confidence level (higher confidence = wider CI). Sample size for desired margin e: n ≥ (z·σ/e)² for known σ, or n ≥ (t·s/e)² for unknown σ (iterative since t depends on df). CIs for proportions, differences of means, and regression coefficients follow the same logic with different formulas.

Real-World Applications

  • •Clinical trial results: 95% CI on treatment effect size shows the likely range of the true treatment effect, with statistical significance if 0 is not in the interval.
  • •Quality control process capability: CI on process mean and standard deviation helps assess whether the process meets specifications.
  • •Measurement lab reports: measurement results typically include a 95% CI (or equivalent standard uncertainty) for quantification of measurement error.
  • •Polling and survey reporting: 'the candidate leads by 5 ± 3 percentage points' is a 95% CI on the difference in support.
  • •A/B testing in software engineering: CIs on conversion rates, click-through rates, and other metrics determine whether a change has a statistically meaningful effect.

Frequently Asked Questions

What is a confidence interval?

A confidence interval is a range of values likely to contain a population parameter with a specified probability (confidence level). A 95% CI means that if we repeated the sampling process many times, 95% of the resulting intervals would contain the true parameter. The width depends on sample size, variability, and confidence level — larger samples and lower variability give narrower intervals.

What's the formula for a CI on the mean?

With known σ: CI = x̄ ± z_(α/2)·σ/√n. With unknown σ: CI = x̄ ± t_(α/2, n−1)·s/√n. For 95% CI with large sample: margin ≈ 1.96·σ/√n. For n = 100, σ = 10: margin = 1.96·10/10 = 1.96. The interval is x̄ ± 1.96, covering the true mean with 95% probability (in the frequentist sense).

How do I determine sample size for a desired margin?

For margin e with known σ: n ≥ (z·σ/e)². For 95% CI with σ = 10 and desired margin e = 2: n ≥ (1.96·10/2)² = 96.04, round up to 97. With unknown σ, the calculation is iterative because t depends on df which depends on n, but the result is similar for moderate-to-large samples. For pilot studies, use a preliminary σ estimate or conservative upper bound.

Can I say 'the true value is 95% likely to be in the interval'?

Technically no, in frequentist statistics. The true value is fixed (unknown but constant), and the interval is random. The correct interpretation is: 'if we repeated the process, 95% of the intervals would contain the true value.' In Bayesian statistics, a 95% credible interval does have the interpretation 'true value is 95% likely to be in the interval,' but with different construction (using prior distributions). Most practical work conflates these interpretations informally.

What's a confidence interval for a proportion?

For a binomial proportion p estimated as p̂ from a sample of size n: CI = p̂ ± z_(α/2)·√(p̂·(1−p̂)/n). For 95% CI with p̂ = 0.4 and n = 200: margin = 1.96·√(0.4·0.6/200) = 1.96·0.0346 = 0.068. The interval is [0.332, 0.468]. Better methods for extreme p̂ near 0 or 1 exist (Wilson, exact binomial CIs) and are preferred for small samples.

Related Calculators

References & Further Reading

Add the live Confidence Interval Calculator to your site. Free to embed, with a link back to MegaCalc.