ProMathTools
ProMathTools

Confidence Interval Calculator – Mean & Proportion

Mean intervals with z or t (or raw data) and proportion intervals with Wald and Wilson score methods — plus margin of error and a plain-language interpretation.

How it works

A confidence interval estimates an unknown mean or proportion from sample data. For a mean, use σ with a z critical value when the population standard deviation is known, or sample s with a t critical value (df = n − 1) when it is not. You can also paste raw data to compute x̄ and s automatically. For proportions, the calculator reports both the classic Wald interval and the Wilson score interval, which behaves better for small n or extreme proportions.

Required Inputs & Typical Use Cases

Use mean mode for lab measurement intervals, survey means, or textbook z/t problems. Use proportion mode for poll results, conversion rates, or binomial success counts. Choose 90/95/98/99% presets or a custom level to match your assignment.


The Formula

Mean (σ known): x̄ ± z* · (σ/√n)
Mean (s known): x̄ ± t*_{n−1} · (s/√n)
Proportion (Wald): p̂ ± z* · √(p̂(1−p̂)/n)
Proportion (Wilson): score interval centered at (p̂ + z²/(2n)) / (1 + z²/n)
  • x̄

    Sample mean

  • σ

    Known population standard deviation

  • s

    Sample standard deviation

  • p̂

    Sample proportion x/n

  • z*, t*

    Critical values from normalInv / tInv


Worked Example

  1. Mean, σ known, 95%

    x̄ = 100, σ = 15, n = 36 → z* ≈ 1.959964, SE = 2.5, interval ≈ 95.1001 to 104.8999.

  2. Same with s and t

    df = 35, t* ≈ 2.030108, margin of error ≈ 5.0753.


Tips, Assumptions & Limitations

  • Preset levels: 90, 95, 98, 99 — or enter a custom percent.
  • Paste raw data to estimate x̄ and s for a t-interval automatically.
  • Prefer Wilson over Wald for small n or proportions near 0 or 1.
  • A 95% interval does not mean there is a 95% chance the true mean is inside this one interval; it describes long-run coverage.
  • Common mistake: using z with sample s, or forgetting df = n − 1 for t.

Use a z critical value when the population standard deviation σ is known. Use a t critical value with df = n − 1 when you only have the sample standard deviation s.

For proportions, the Wald interval p̂ ± z√(p̂(1−p̂)/n) can be poor for small n or extreme p̂. The Wilson score interval is generally more accurate near 0 or 1 and for smaller samples.

If the same sampling process were repeated many times, about 95% of the resulting intervals would contain the true parameter. It is not the probability that this one interval contains the parameter.

Yes. In mean mode, choose raw data to compute x̄ and sample s automatically, then build a t-interval with df = n − 1.

Margin of error is the critical value times the standard error. Adding and subtracting it from the point estimate gives the interval endpoints.

z* comes from the inverse standard normal (Acklam), and t* from the inverse Student-t CDF with df = n − 1. For example, normalInv(0.975) ≈ 1.959964 and tInv(0.975, 35) ≈ 2.030108.

Related Calculators

Sample Size CalculatorT-Test CalculatorZ-Score CalculatorStandard DeviationCorrelation CoefficientLinear RegressionCovariance CalculatorMeanMedian ModeVarianceMean Absolute Deviation

Related Guides


How this calculator works

In statistics, we often want to know something about a large group (a population) but can only study a smaller part of it (a sample). A confidence interval helps us make an educated guess about the population based on our sample data. It gives us a range of values where the true population parameter, like the mean, is likely to be found.

Explanation

A confidence interval is a statistical tool that provides an estimated range of values which is likely to include an unknown population parameter. Instead of giving a single number (a point estimate), it offers an interval, reflecting the uncertainty inherent in using sample data to infer about a larger population. The 'confidence level' (e.g., 95% or 99%) tells us how often this type of interval would capture the true population parameter if we repeated our sampling process many times.

Formula

The general formula for a confidence interval for a population mean (when using a Z-score) is: CI = X̄ ± Z * (s / √n) Where:
CI = Confidence Interval
X̄ = Sample Mean
Z = Z-score corresponding to your chosen confidence level (e.g., 1.96 for 95% CI)
s = Sample Standard Deviation
n = Sample Size The term (s / √n) is known as the Standard Error of the Mean, and Z * (s / √n) is the Margin of Error.

Worked example

Imagine a coffee shop wants to estimate the average amount of coffee consumed by its customers daily. They survey 50 customers (sample size, n=50) and find the average consumption (sample mean, X̄) is 3.5 cups, with a standard deviation (s) of 0.8 cups. To calculate the 95% confidence interval, we use a Z-score of 1.96. Standard Error = 0.8 / √50 ≈ 0.1131 Margin of Error = 1.96 * 0.1131 ≈ 0.2217 Lower Bound = 3.5 - 0.2217 = 3.2783 Upper Bound = 3.5 + 0.2217 = 3.7217 So, the 95% confidence interval for the average daily coffee consumption is approximately [3.28, 3.72] cups. This means we are 95% confident that the true average coffee consumption for all customers falls within this range.

How to use this tool

Using our Confidence Interval Calculator is straightforward. Simply enter your 'Sample Mean', 'Sample Standard Deviation', and 'Sample Size' into the respective fields. Then, choose your desired 'Confidence Level' (e.g., 90, 95, or 99). The calculator will instantly display the Z-score used, the standard error, the margin of error, and both the lower and upper bounds of your confidence interval. This helps you quickly understand the estimated range for your population mean.

Frequently asked questions

What's the difference between a confidence interval and a prediction interval?
A confidence interval estimates a population parameter (like the mean), while a prediction interval estimates the range for a single future observation or outcome. Confidence intervals are about the average of a group; prediction intervals are about individual values.
Can I use this calculator for any confidence level?
Our calculator currently supports the most common confidence levels: 90%, 95%, and 99%. For other specific confidence levels, you would need to find the corresponding Z-score from a Z-table or statistical software and use a more advanced calculator.
Does a wider confidence interval mean my estimate is less accurate?
A wider confidence interval means there's more uncertainty in your estimate of the population parameter. While it gives you a higher chance of capturing the true value (e.g., 99% vs. 95%), it provides a less precise estimate. Narrower intervals are generally preferred for precision, but they come with a lower confidence level.

Read the full guide →

About UsBlogChrome ExtensionFAQsTerms and ConditionsPrivacy PolicySitemap
EmailLinkedInFacebook

© 2025-2026 PromathTools. All rights reserved.

Built by KruskalCode – SaaS & Automation Experts · EverydayDevTools