Skip to main content
Math

Confidence Interval for the Mean Calculator

Enter the sample mean x̄, sample standard deviation s, sample size n and confidence level (e.g. 95 %) to get a two-sided confidence interval for the population mean μ — including the critical value (t* or z*), the standard error SE = s/√n, the margin of error ME, the degrees of freedom and the final [lower, upper] interval.

Distribution Distribution Default to t — the sample SD is almost never equal to the population σ.

95% confidence interval for population mean μ

[46.70, 53.30]

CI = 50 ± 3.30

Standard error (SE)

SE = s ÷ √n

t*

Two-sided critical value (t* or z*).

Degrees of freedom

df = n − 1 (used only with t).

Interpretation: if you drew many samples and built an interval each time, ~95 % (or your chosen level) would cover the true mean μ. It is NOT a 95 % probability that μ is inside this particular interval.

Formula

CI = x̄ ± t*·(s / √n), df = n − 1 z-distribution variant (population σ known): CI = x̄ ± z*·(σ / √n) t* and z* are the two-sided critical values for the chosen confidence level (e.g. 95 % → t*_{df, 0.975}).

Frequently asked

Should I use the t distribution or the z distribution?

Default to t. In practice you only have the sample standard deviation s, not the true population σ — and s itself carries sampling error, which the wider t distribution accounts for. Use z only when σ is genuinely known (rare: think calibrated instrument specs or long-established physical constants). For n ≥ 30 the two are nearly identical; at n = 10, t*_{9, 0.975} ≈ 2.262 is already ~15 % wider than z*_{0.975} ≈ 1.960.

What does "95 % confidence" actually mean?

The correct frequentist reading is: "if I repeat this sampling procedure many times and construct an interval each time, ~95 % of those intervals will cover the true mean μ." It is NOT correct to say "there is a 95 % probability that μ is inside this particular interval" — μ is a fixed constant; it is either in or out. The 95 % describes the long-run reliability of the procedure, not this single interval. If you want a probability statement about μ directly, you need a Bayesian "credible interval" instead.

How much do I need to increase n to halve the margin of error?

About four times the sample. Since ME = t*·s/√n, and t*, s are roughly fixed, ME scales as 1/√n. To halve ME, √n must double, so n must quadruple. To cut ME to one-third you need 9× the sample. This is the classic diminishing returns of statistics — going from 100 samples to 400 doubles your precision, and to 1 600 doubles it again. In practice, improving sample *quality* (reducing measurement error, avoiding biased sampling) often pays off more than blindly increasing n.

Can I still use this with a tiny sample like n = 2 or 3?

Mathematically yes (df = n − 1 ≥ 1, the t distribution is well-defined), but the interval will be enormous: t*_{1, 0.975} ≈ 12.7 for n = 2 and ≈ 4.30 for n = 3. Even an apparently precise sample mean can be miles away from the true μ. The normality assumption also becomes critical at small n — and you cannot verify it with two or three points. A practical rule is n ≥ 10 to even attempt this, n ≥ 30 for it to behave nicely. With only a handful of observations consider bootstrap resampling or Bayesian alternatives instead.

How is a confidence interval related to a t-test?

They are two sides of the same coin. Using a 95 % CI to test the hypothesis "μ = μ₀": μ₀ falls outside the interval ⟺ a two-sided t-test rejects H₀ at α = 0.05. The confidence interval is essentially the set of all μ₀ values that the t-test would not reject. This is why many statisticians prefer reporting confidence intervals over bare p-values — the interval shows both the effect size and the precision, while a p-value only answers "significant or not".

Related tools

Percentage Calculator

Percent of, percent change, and percent add/subtract in one.

GCD & LCM Calculator

Enter 2–6 positive integers to get the greatest common divisor (HCF / GCD) and least common multiple (LCM), with the Euclidean step chain shown.

Average Calculator (Mean / Median / Mode)

Enter a list of numbers to get the mean, median, mode, range plus standard deviation, variance and total.

Quadratic Equation Solver

Enter the coefficients of ax² + bx + c = 0 to find the real or complex roots, discriminant and vertex.

Password Strength (Entropy) Calculator

Estimate a password's bit entropy, brute-force time and strength tier. All computation happens in your browser.

Scientific Notation Converter

Convert between standard decimal numbers and scientific notation, with significant figures and order of magnitude.

Permutations & Combinations (nPr / nCr) Calculator

Compute permutations P(n,r), combinations C(n,r) and factorial n! — useful for probability problems, lottery odds and combinatorics homework.

Standard Deviation Calculator

Paste a list of numbers to compute mean, median, sample and population variance and standard deviation — with the working shown.

Triangle Calculator (SSS / SAS / ASA)

Solve a triangle from 3 sides, 2 sides + 1 angle, or 2 angles + 1 side — area, perimeter and remaining parts via the law of sines / cosines.

Pythagorean Theorem Calculator

Given any two sides of a right triangle (two legs, or one leg plus the hypotenuse), instantly find the third side, area, perimeter and the two non-right angles.

Circle Calculator (radius / diameter / circumference / area)

Enter any one of radius, diameter, circumference or area to get the other three — useful for design, engineering and DIY.

Roman Numeral Converter

Two-way conversion between Arabic numbers (1–3999) and Roman numerals (I, V, X, L, C, D, M) — handy for typesetting, chapter titles and homework.

Slope & Line Equation Calculator (y = mx + b from Two Points)

Enter two points (x₁, y₁) and (x₂, y₂) to instantly get the slope, y-intercept, line equation y = mx + b, distance, and midpoint — a classroom staple for algebra and coordinate geometry.

Birthday Paradox Calculator

Enter group size n to see the probability that at least two people share a birthday — the classic birthday problem.

Logarithm Calculator (log / ln / log₂ / any base)

Compute logₐ(x) for any base — natural log (ln), common log (log₁₀), binary log (log₂) and a custom base, with the change-of-base steps shown.

Z-Score (Standard Score) Calculator

Enter a value, the mean and the standard deviation to compute the z-score and the corresponding normal-distribution percentile and probabilities.

Screen Pixel Density (PPI) Calculator

Enter the screen resolution and diagonal size to get pixel density (PPI), real width/height, dot pitch and total pixel count.

Hong Kong Mark Six Odds Calculator

Enter the number of tickets / selections and see the actual probability of hitting first, second … prizes in a Mark Six (6-of-49) draw.

Decimal to Fraction Converter

Convert any decimal (including repeating decimals) to a simplified fraction and a mixed number.

Sphere Volume & Surface Area Calculator

Give a sphere any one of radius, diameter, surface area or volume and instantly get the other three — plus the great-circle circumference and area.

Cylinder Volume & Surface Area Calculator

Enter the radius and height of a cylinder to get volume (π r²h), lateral surface, base area and total surface area.

Permutations (nPr) Calculator

Compute nPr — the number of ordered arrangements of r items chosen from n — alongside n!, r! and the related combination nCr.

Prime Factorization Calculator

Factor any integer from 2 up to 10¹² into primes, see the canonical exponent form, count and list all divisors.

Geometric Mean Calculator

Compute the n-th root of the product of n positive numbers — the right average for growth rates, returns and ratios — alongside the arithmetic mean for comparison.

Fibonacci Sequence Calculator

Enter any integer n from 0 to 1500 to instantly compute F(n) and F(n−1) with BigInt precision, the consecutive-term ratio (converging to the golden ratio φ) and the first 30 terms of the sequence.

Dice Roll Probability Calculator

Pick the number of dice, sides (d4 / d6 / d8 / d10 / d12 / d20) and a target sum to compute the probability of rolling exactly that total, at least, or at most.

Arithmetic Series Calculator

Enter first term a, common difference d and number of terms n to compute the nth term aₙ and the partial sum Sₙ = n/2·(2a + (n − 1)d).

Survey Sample Size Calculator

Enter confidence level, margin of error, expected proportion (and optional population size) to compute the survey sample size you need.

Geometric Series Sum Calculator

Enter the first term a, common ratio r and number of terms n to find the sum of the first n terms of a geometric series — plus the infinite-series sum when |r| < 1.

Cone Volume & Surface Area Calculator

Enter base radius and height to get the cone volume, slant height, lateral, base and total surface area.

Music Note Frequency Calculator

Pick a note (C, C♯, D, …), octave and tuning reference A4 (440 Hz by default) and the tool returns the frequency in Hz, the wavelength in air and the MIDI note number via f = A4 × 2^((n − 69)/12).

Linear Interpolation Calculator (Lerp)

Enter two known points (x₁, y₁) and (x₂, y₂) and a target x to instantly read off y via y = y₁ + (x − x₁)(y₂ − y₁)/(x₂ − x₁) — the tool flags whether your x sits inside the two points (interpolation) or outside (extrapolation).

Trapezoid Area Calculator

Enter the two parallel sides and height of a trapezoid to get its area, midsegment length and perimeter when the legs are known.

Binomial Probability Calculator

Enter the number of trials n, the per-trial success probability p and a target number of successes k to get P(X = k), P(X ≤ k), P(X ≥ k) along with the distribution mean and standard deviation.

Pearson Correlation Coefficient Calculator

Paste two parallel data series (X and Y) and get the Pearson correlation coefficient r, r², the best-fit line slope and intercept, and the sample means and standard deviations.