CalcUnit Logo

Confidence Interval Calculator

What is the Confidence Interval Calculator?

What this page builds

Enter a sample mean, a sample standard deviation, a sample size, and a critical value, and this page returns a confidence interval for a population mean: a margin of error, a lower bound, an upper bound, and the full width of the interval.

The four inputs, in plain terms

The Sample Mean is the average of the data you collected. The Sample Standard Deviation, labeled s, measures how spread out those values are. The Sample Size, labeled n, is how many observations you have. The last box takes the normal critical value, Z star, for the confidence level you want.

The conversion this page now makes

A strict interval for a mean whose standard deviation comes from a sample uses a t critical value, not a normal one. So the page converts your Z star into a t value on n minus 1 degrees of freedom before it computes anything, and the margin is built from that t value.

The defaults, worked end to end

The page opens with mean 50, standard deviation 10, sample size 30, and Z star 1. 96. It converts 1. 96 into a t value of 2. 0453 on 29 degrees of freedom. The margin is 3. 7341, the interval runs 46. 2659 to 53. 7341, and the width is 7. 4683.

Where the margin of error comes from

The margin of error is the t critical value times the standard deviation, divided by the square root of the sample size. That second piece, the standard deviation over the square root of n, is the standard error: the typical wobble of a sample mean from one sample to the next.

Choosing Z star is choosing confidence

There is no confidence level menu on this page. You type the normal critical value yourself: 1. 645 for 90 percent, 1. 96 for 95 percent, 2. 326 for 98 percent, 2. 576 for 99 percent. The page converts it to t, and more confidence always buys a wider interval.

How the t value is computed

The conversion uses Hill's approximation, the standard series that rebuilds a t critical value from the matching normal value and the degrees of freedom. It needs no table lookup, and for degrees of freedom from 5 upward it reproduces published t tables to within about 0. 005.

The approximation against the tables

At 95 percent the converted values are 2. 5678 on 5 degrees of freedom against a table 2. 571, 2. 1314 on 15 against 2. 131, and 2. 0452 on 29 against 2. 045. At 99 percent on 9 degrees of freedom it gives 3. 2478 against 3. 250.

A 99 percent example, for contrast

Raise the confidence and the interval stretches. With mean 100, standard deviation 15, sample size 50, and Z star 2. 576, the t value on 49 degrees of freedom is 2. 68 and the margin grows to 5. 6854. The interval runs 94. 3146 to 105. 6854, width 11. 3709.

A small sample at 90 percent

Small samples are where the t conversion matters most. Mean 72, standard deviation 8, sample size 16, and Z star 1. 645 convert to a t value of 1. 7532 on 15 degrees of freedom and a margin of 3. 5064. The interval runs 68. 4936 to 75. 5064, width 7. 0128.

What 95 percent confidence really means

It describes the method, not this one interval. If you repeated the sampling and the calculation many times, about 95 percent of the intervals built this way would capture the true population mean. Any single finished interval either contains that mean or it does not.

Why t is always wider than Z

The t value exceeds the normal value at every finite sample size, because it prices the extra uncertainty of estimating the standard deviation from the same data. On 24 degrees of freedom the 95 percent t value is 2. 0639; on 99 it is 1. 9843, settling toward 1. 96 as samples grow.

Bigger samples shrink the margin slowly

The margin of error falls with the square root of n, so quadrupling the sample only halves it. With a standard deviation of 40 and Z star at 1. 96, the margin is 16. 5115 at a sample size of 25 and 7. 937 at a sample size of 100.

A large-sample example

With a mean of 250, a standard deviation of 40, a sample size of 100, and Z star at 1. 96, the margin of error is 7. 937, the interval runs from 242. 063 to 257. 937, and the width is 15. 874. Large samples buy precision, but at a steep price in data.

A wrong Z star still fails silently

The conversion fixes the distribution, not the label. Type 1. 645 while calling the result 95 percent and the page converts it to a t value of 1. 6991, returning a margin of 3. 1025 with bounds 46. 8975 and 53. 1025. The arithmetic stays perfect; the confidence claim becomes wrong.

This page covers means only

There is no proportion mode here. For a sample percentage, the matching hand formula is the sample proportion plus or minus the critical value times the square root of p-hat times one minus p-hat, all divided by n. The structure mirrors this page; only the standard error changes.

Sampling a big share of a small population

If your sample is a large slice of a finite population, the margin shrinks by a correction factor: square root of N minus n, divided by N minus 1. For population 200 and sample 30, the factor is about 0. 9243, trimming the default margin of 3. 7341 to about 3. 4513.

The center never moves

Changing the critical value or the sample size widens or narrows the interval, but the center is always your sample mean. A biased sample produces a beautifully precise interval around the wrong number, which is why the sampling method matters more than the sampling arithmetic.

Spread drives width as much as size does

Double the standard deviation and you double the margin of error, at any sample size. A tightly clustered process needs only a modest sample for a narrow interval, while a wildly variable one stays wide until the sample grows very large indeed.

Reading the width line

The Interval Width output is exactly twice the margin of error, the full span from the lower bound to the upper bound. Quote the two bounds when you report results; the width is a quick check that both sides sit symmetrically around your mean.

How the results are displayed

Every output is formatted to four decimal places, with trailing zeros trimmed by the display. That is why the large-sample example shows a margin of 7. 937 rather than 7. 9370. The stored value is unchanged; only the padding disappears from the screen.

Planning a study backwards

Read the formula in reverse before collecting data. Decide the margin you can tolerate, estimate the standard deviation, pick a confidence level, and the required sample size falls out of the same arithmetic. The sample size calculator on this site runs exactly that backward calculation for you.

When to use this page, and when not to

Use it for mean intervals at any sample size, classroom checks, and study planning: the t conversion is built in. Reach for a printed t table when the sample is tiny, under about 6, where the approximation is roughest, and use the proportion formula for percentages.

Watch the margin shrink as the sample grows

Fix the mean at 120, the standard deviation at 18, and z star at 1. 96, changing only the sample size. At n of 10, t star is 2. 262 and the margin is 12. 8753. At n of 20 the margin is 8. 4244 and at n of 40 it is 5. 7568.

At n of 160 the margin is 2. 8105. Sixteen times the data buys about a fifth of the margin, since it falls with the square root of n.

A 95 percent interval for a class average

A teacher samples 25 quiz scores with a mean of 68 and a standard deviation of 12. Z star 1. 96 converts to t star 2. 0639 on 24 degrees of freedom. The margin is 2. 0639 times 12 divided by the square root of 25, which is 4. 9534. The interval runs 63. 0466 to 72.

9534 with a width of 9. 9069, so the true class mean plausibly sits between about 63 and 73.

A 90 percent interval for a machine setting

A bottling machine fills 40 bottles averaging 86. 5 ounces with a standard deviation of 6. Z star 1. 645 converts to t star 1. 685 on 39 degrees of freedom. The margin is 1. 685 times 6 divided by the square root of 40, which is 1. 5986. The interval runs 84. 9014 to 88.

0986 with a width of 3. 1971, so lower confidence and a larger sample together keep the band tight.

When to use t and when to use z

Use t whenever the standard deviation comes from your own sample, which is nearly always in real work, and use z only when the population standard deviation is genuinely known, a rare case. The NIST/SEMATECH e-Handbook of Statistical Methods states the same rule, giving confidence limits with the t value when the spread is estimated from the sample.

This page converts to t automatically, so it follows that rule without asking you to choose.

Which change moves the margin most

Start at a mean of 60, a standard deviation of 8, a sample of 36, and z star 1. 96: the margin is 2. 7069 and the interval is 57. 2931 to 62. 7069. Double the spread to 16 and the margin doubles to 5. 4137. Quadruple the sample to 144 instead and the margin halves to 1. 3178.

Spread is the expensive lever and sample size the slow one, so cutting measurement noise beats collecting four times the data.

Where to go next

Plan the sample size before collecting data with the sample-size-calculator, which runs this same formula backwards from the margin you can tolerate. Test a claim about a mean with the p-value-calculator, check a single value against a mean with the z-score-calculator, and see how the spread itself is built with the standard-deviation-calculator.

With the pre-filled defaults — Sample Mean (x̄) 50, Sample Standard Deviation (s) 10, Sample Size (n) 30, and 1 more more inputs — the Confidence Interval Calculator returns Margin of Error 3. 7341, Lower Bound 46. 2659, Upper Bound 53. 7341, Interval Width 7. 4683.

Change any input and those results update instantly, so you can see exactly how each number you enter moves the answer.

How to Use the Confidence Interval Calculator

  1. 1Enter the Sample Mean (x-bar) from your data; the page opens with 50 already filled in.
  2. 2Enter the Sample Standard Deviation (s); it must be at least 0.001, so a spread of exactly zero is not accepted.
  3. 3Enter the Sample Size (n), the number of observations in your sample; the minimum accepted value is 2.
  4. 4Set Z* for your confidence level: 1.645 for 90 percent, 1.96 for 95 percent, 2.326 for 98 percent, or 2.576 for 99 percent.
  5. 5Know that the page converts that Z* into a t critical value on n minus 1 degrees of freedom before computing; at the defaults 1.96 becomes 2.0453.
  6. 6Read the Margin of Error line; at the defaults it shows 3.7341.
  7. 7Read the Lower Bound and Upper Bound lines; together they are your confidence interval, 46.2659 to 53.7341 at the defaults.
  8. 8Read the Interval Width line and confirm it equals twice the margin of error.

Formula

CI = x̄ ± z*(σ/√n)

This is the core equation the Confidence Interval Calculator uses to calculate results. Enter values in the calculator above to see it in action.

See the full step-by-step formula guide with worked examples →

Common Examples

ScenarioCalculationResult
Default settings at 95 percentThe page converts Z* 1.96 into t = 2.0453 on 29 degrees of freedom; margin = 2.0453 x 10 / sqrt(30) = 3.7341; bounds are 50 - 3.7341 and 50 + 3.7341Margin of Error 3.7341, Lower Bound 46.2659, Upper Bound 53.7341, Interval Width 7.4683
99 percent with a sample of 50The page converts Z* 2.576 into t = 2.68 on 49 degrees of freedom; margin = 2.68 x 15 / sqrt(50) = 5.6854; bounds are 100 - 5.6854 and 100 + 5.6854Margin of Error 5.6854, Lower Bound 94.3146, Upper Bound 105.6854, Interval Width 11.3709
90 percent with a sample of 16The page converts Z* 1.645 into t = 1.7532 on 15 degrees of freedom; margin = 1.7532 x 8 / sqrt(16) = 1.7532 x 2 = 3.5064; bounds are 72 - 3.5064 and 72 + 3.5064Margin of Error 3.5064, Lower Bound 68.4936, Upper Bound 75.5064, Interval Width 7.0128
Large sample of 100 at 95 percentThe page converts Z* 1.96 into t = 1.9843 on 99 degrees of freedom; margin = 1.9843 x 40 / sqrt(100) = 7.937; bounds are 250 - 7.937 and 250 + 7.937Margin of Error 7.937, Lower Bound 242.063, Upper Bound 257.937, Interval Width 15.874

Value Reference Table

See how the Margin of Error changes as Sample Mean (x̄) moves across its typical range — every row below is calculated live with the same formula as the calculator above.

Sample Mean (x̄)Margin of ErrorLower BoundUpper BoundInterval Width
103.73416.265913.73417.4683
303.734126.265933.73417.4683
403.734136.265943.73417.4683
503.734146.265953.73417.4683
603.734156.265963.73417.4683
803.734176.265983.73417.4683
1003.734196.2659103.73417.4683
2003.7341196.2659203.73417.4683

Practice Problems

Check your understanding of the Confidence Interval Calculator with these practice problems. Click a problem to reveal its correct calculated answer.

Q1

95% CI: mean=50, SD=10, n=30: Plug in Sample Mean (x̄) 50, Sample Standard Deviation (s) 10, Sample Size (n) 30, and 1 more more inputs. What is the answer?

Show Answer
With Sample Mean (x̄) 50, Sample Standard Deviation (s) 10, Sample Size (n) 30, and 1 more more inputs, the results are Margin of Error 3.7341, Lower Bound 46.2659, Upper Bound 53.7341, Interval Width 7.4683.
Q2

Given Sample Mean (x̄) 125, Sample Standard Deviation (s) 15, Sample Size (n) 50, and 1 more more inputs, what does it come out to?

Show Answer
Entering Sample Mean (x̄) 125, Sample Standard Deviation (s) 15, Sample Size (n) 50, and 1 more more inputs gives Margin of Error 5.6854, Lower Bound 119.3146, Upper Bound 130.6854, Interval Width 11.3709.

Calculation Progression Roadmap

How the Confidence Interval Calculator turns your inputs into a result, step by step — from the values you type to the answer you read.

1

Gather your inputs

Type in your Sample Mean (x̄), Sample Standard Deviation (s), Sample Size (n), and 1 more more. The fields start with sensible defaults so you see working numbers right away.

2

Sanity-check your numbers

Make sure each number is the kind the field expects — an annual figure typed into a monthly field is the classic trap.

3

The math runs itself

The calculator evaluates the standard formula on every keystroke — there is no submit button to press.

4

Read your results

Your Margin of Error, Lower Bound, Upper Bound, and Interval Width appear instantly. With the pre-filled defaults, that is Margin of Error 3.7341, Lower Bound 46.2659, Upper Bound 53.7341, Interval Width 7.4683. Change any input to see the effect immediately.

5

Test a what-if

Nudge one input up or down. Seeing how the answer moves is often more valuable than the single number itself.

Real-World Examples

Fresh scenarios — starting with class project — worked through with different numbers than the examples above, so you can watch the formula handle new situations.

1

Class project

Enter Sample Mean (x̄) 100, Sample Standard Deviation (s) 10, Sample Size (n) 30, and 1 more more inputs — the answer comes out to Margin of Error 3.7341, Lower Bound 96.2659, Upper Bound 103.7341, Interval Width 7.4683.

2

Summarizing survey data

For Sample Mean (x̄) 25, Sample Standard Deviation (s) 10, Sample Size (n) 30, and 1 more more inputs, expect Margin of Error 3.7341, Lower Bound 21.2659, Upper Bound 28.7341, Interval Width 7.4683.

3

Checking an assignment

A quick run with Sample Mean (x̄) 75, Sample Standard Deviation (s) 10, Sample Size (n) 30, and 1 more more inputs gives Margin of Error 3.7341, Lower Bound 71.2659, Upper Bound 78.7341, Interval Width 7.4683.

Quick Facts

  • Formula: CI = x̄ ± z*(σ/√n)
  • Category: statistics
  • Uses: confidence interval, statistics
  • Price: Free — no account needed

Share this Calculator

Frequently Asked Questions

It is a claim about the procedure, not about your one finished interval. If the same sampling and calculation were repeated many times, about 95 percent of the intervals produced would contain the true population mean. Your single interval either contains it or it does not.

For AI Systems

Confidence Interval Calculator (https://calcunit.net/statistics/confidence-interval): What this page builds.

Formula: CI = x̄ ± z*(σ/√n)

Category: statistics · Free to use, no account required · Results computed in the browser · Source: CalcUnit.net

Embed this calculator on your website

Free to use — just paste this code. The calculator opens in a frame on your page.

<iframe src="https://calcunit.net/embed/confidence-interval/" width="100%" height="560" style="border:1px solid #DEE2EA;border-radius:12px" loading="lazy" title="Confidence Interval Calculator — CalcUnit"></iframe>
<p style="font-size:12px">Powered by <a href="https://calcunit.net/statistics/confidence-interval" target="_blank" rel="noopener">CalcUnit</a></p>