Confidence Interval Calculator

Professional confidence interval calculator for means (z/t) and proportions (Wilson, Wald, Agresti–Coull). Mobile-first, WCAG 2.1 AA compliant, and optimized for speed.

Full original guide (expanded)

Confidence Interval Calculator

Build two-sided confidence intervals for means and proportions using z or t critical values with clear steps.

Data Source and Methodology

Authoritative source: National Institute of Standards and Technology (NIST), Engineering Statistics Handbook, Section 8: Confidence Intervals (revision 2012). Direct link.

Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.

The Formula Explained

Two-sided confidence interval for a mean with known σ (z):

$$ \bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}} $$

Two-sided confidence interval for a mean with unknown σ (t):

$$ \bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}} $$

Wald interval for a proportion p:

$$ \hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $$

Wilson score interval for a proportion p:

$$ \frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}} $$

Agresti–Coull interval:

$$ \tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}} $$

Glossary of Variables

  • x̄ — sample mean.
  • σ — population standard deviation (known).
  • s — sample standard deviation (unknown σ case).
  • n — sample size; df = n − 1 for t.
  • z, t — critical values for the standard normal and Student’s t distributions.
  • x — number of successes; n — number of trials; p̂ = x/n.
  • SE — standard error; ME — margin of error; CI — confidence interval.

How It Works: A Step-by-Step Example

Scenario: A team measures the compression strength (MPa) of 25 samples: x̄ = 10.2, s = 3.1. Construct a 95% CI for the mean strength (σ unknown).

  1. df = 24; confidence level 95% ⇒ α = 0.05 ⇒ use t critical t0.975,24 ≈ 2.064.
  2. SE = s / √n = 3.1 / 5 = 0.62.
  3. ME = t × SE = 2.064 × 0.62 ≈ 1.2797.
  4. CI = x̄ ± ME = 10.2 ± 1.2797 ⇒ [8.9203, 11.4797].

Frequently Asked Questions (FAQ)

How do I choose the confidence level?

95% is standard; 90% yields narrower intervals, 99% wider. Choose based on risk tolerance and domain norms.

What if my data are skewed or have outliers?

For means with small n, t-intervals assume approximate normality of the sampling distribution. Consider transformations or robust methods if skew/outliers are extreme.

Is the Wilson interval always better than Wald?

Wilson has superior coverage, especially near boundaries or at small n. Wald is simple but can be unreliable when np or n(1−p) are small.

Can I paste raw data?

Yes. Use the “Paste raw data” panel. We compute x̄ and s, which replace manual entries for mean-based intervals.

Do results round values?

We compute with full precision and display to a sensible number of decimals. You can interpret or round per your reporting standards.

Are intervals one- or two-sided?

Currently two-sided. One-sided intervals will be added in a future update.


Audit: Complete
Formula (LaTeX) + variables + units
This section shows the formulas used by the calculator engine, plus variable definitions and units.
Formula (extracted LaTeX)
\[','\]
','
Formula (extracted LaTeX)
\[\bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}\]
\bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}
Formula (extracted LaTeX)
\[\bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}}\]
\bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}}
Formula (extracted LaTeX)
\[\hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\]
\hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}
Formula (extracted LaTeX)
\[\frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}}\]
\frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}}
Formula (extracted LaTeX)
\[\tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}}\]
\tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}}
Formula (extracted text)
Two-sided confidence interval for a mean with known σ (z): $ \bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}} $ Two-sided confidence interval for a mean with unknown σ (t): $ \bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}} $ Wald interval for a proportion p: $ \hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $ Wilson score interval for a proportion p: $ \frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}} $ Agresti–Coull interval: $ \tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}} $
Variables and units
  • No variables provided in audit spec.
Sources (authoritative):
Changelog
Version: 0.1.0-draft
Last code update: 2026-01-19
0.1.0-draft · 2026-01-19
  • Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido on 2026-01-19
Profile · LinkedIn

Confidence Interval Calculator

Build two-sided confidence intervals for means and proportions using z or t critical values with clear steps.

Data Source and Methodology

Authoritative source: National Institute of Standards and Technology (NIST), Engineering Statistics Handbook, Section 8: Confidence Intervals (revision 2012). Direct link.

Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.

The Formula Explained

Two-sided confidence interval for a mean with known σ (z):

$$ \bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}} $$

Two-sided confidence interval for a mean with unknown σ (t):

$$ \bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}} $$

Wald interval for a proportion p:

$$ \hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $$

Wilson score interval for a proportion p:

$$ \frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}} $$

Agresti–Coull interval:

$$ \tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}} $$

Glossary of Variables

  • x̄ — sample mean.
  • σ — population standard deviation (known).
  • s — sample standard deviation (unknown σ case).
  • n — sample size; df = n − 1 for t.
  • z, t — critical values for the standard normal and Student’s t distributions.
  • x — number of successes; n — number of trials; p̂ = x/n.
  • SE — standard error; ME — margin of error; CI — confidence interval.

How It Works: A Step-by-Step Example

Scenario: A team measures the compression strength (MPa) of 25 samples: x̄ = 10.2, s = 3.1. Construct a 95% CI for the mean strength (σ unknown).

  1. df = 24; confidence level 95% ⇒ α = 0.05 ⇒ use t critical t0.975,24 ≈ 2.064.
  2. SE = s / √n = 3.1 / 5 = 0.62.
  3. ME = t × SE = 2.064 × 0.62 ≈ 1.2797.
  4. CI = x̄ ± ME = 10.2 ± 1.2797 ⇒ [8.9203, 11.4797].

Frequently Asked Questions (FAQ)

How do I choose the confidence level?

95% is standard; 90% yields narrower intervals, 99% wider. Choose based on risk tolerance and domain norms.

What if my data are skewed or have outliers?

For means with small n, t-intervals assume approximate normality of the sampling distribution. Consider transformations or robust methods if skew/outliers are extreme.

Is the Wilson interval always better than Wald?

Wilson has superior coverage, especially near boundaries or at small n. Wald is simple but can be unreliable when np or n(1−p) are small.

Can I paste raw data?

Yes. Use the “Paste raw data” panel. We compute x̄ and s, which replace manual entries for mean-based intervals.

Do results round values?

We compute with full precision and display to a sensible number of decimals. You can interpret or round per your reporting standards.

Are intervals one- or two-sided?

Currently two-sided. One-sided intervals will be added in a future update.


Audit: Complete
Formula (LaTeX) + variables + units
This section shows the formulas used by the calculator engine, plus variable definitions and units.
Formula (extracted LaTeX)
\[','\]
','
Formula (extracted LaTeX)
\[\bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}\]
\bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}
Formula (extracted LaTeX)
\[\bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}}\]
\bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}}
Formula (extracted LaTeX)
\[\hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\]
\hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}
Formula (extracted LaTeX)
\[\frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}}\]
\frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}}
Formula (extracted LaTeX)
\[\tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}}\]
\tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}}
Formula (extracted text)
Two-sided confidence interval for a mean with known σ (z): $ \bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}} $ Two-sided confidence interval for a mean with unknown σ (t): $ \bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}} $ Wald interval for a proportion p: $ \hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $ Wilson score interval for a proportion p: $ \frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}} $ Agresti–Coull interval: $ \tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}} $
Variables and units
  • No variables provided in audit spec.
Sources (authoritative):
Changelog
Version: 0.1.0-draft
Last code update: 2026-01-19
0.1.0-draft · 2026-01-19
  • Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido on 2026-01-19
Profile · LinkedIn

Confidence Interval Calculator

Build two-sided confidence intervals for means and proportions using z or t critical values with clear steps.

Data Source and Methodology

Authoritative source: National Institute of Standards and Technology (NIST), Engineering Statistics Handbook, Section 8: Confidence Intervals (revision 2012). Direct link.

Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.

The Formula Explained

Two-sided confidence interval for a mean with known σ (z):

$$ \bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}} $$

Two-sided confidence interval for a mean with unknown σ (t):

$$ \bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}} $$

Wald interval for a proportion p:

$$ \hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $$

Wilson score interval for a proportion p:

$$ \frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}} $$

Agresti–Coull interval:

$$ \tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}} $$

Glossary of Variables

  • x̄ — sample mean.
  • σ — population standard deviation (known).
  • s — sample standard deviation (unknown σ case).
  • n — sample size; df = n − 1 for t.
  • z, t — critical values for the standard normal and Student’s t distributions.
  • x — number of successes; n — number of trials; p̂ = x/n.
  • SE — standard error; ME — margin of error; CI — confidence interval.

How It Works: A Step-by-Step Example

Scenario: A team measures the compression strength (MPa) of 25 samples: x̄ = 10.2, s = 3.1. Construct a 95% CI for the mean strength (σ unknown).

  1. df = 24; confidence level 95% ⇒ α = 0.05 ⇒ use t critical t0.975,24 ≈ 2.064.
  2. SE = s / √n = 3.1 / 5 = 0.62.
  3. ME = t × SE = 2.064 × 0.62 ≈ 1.2797.
  4. CI = x̄ ± ME = 10.2 ± 1.2797 ⇒ [8.9203, 11.4797].

Frequently Asked Questions (FAQ)

How do I choose the confidence level?

95% is standard; 90% yields narrower intervals, 99% wider. Choose based on risk tolerance and domain norms.

What if my data are skewed or have outliers?

For means with small n, t-intervals assume approximate normality of the sampling distribution. Consider transformations or robust methods if skew/outliers are extreme.

Is the Wilson interval always better than Wald?

Wilson has superior coverage, especially near boundaries or at small n. Wald is simple but can be unreliable when np or n(1−p) are small.

Can I paste raw data?

Yes. Use the “Paste raw data” panel. We compute x̄ and s, which replace manual entries for mean-based intervals.

Do results round values?

We compute with full precision and display to a sensible number of decimals. You can interpret or round per your reporting standards.

Are intervals one- or two-sided?

Currently two-sided. One-sided intervals will be added in a future update.


Audit: Complete
Formula (LaTeX) + variables + units
This section shows the formulas used by the calculator engine, plus variable definitions and units.
Formula (extracted LaTeX)
\[','\]
','
Formula (extracted LaTeX)
\[\bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}\]
\bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}
Formula (extracted LaTeX)
\[\bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}}\]
\bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}}
Formula (extracted LaTeX)
\[\hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\]
\hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}
Formula (extracted LaTeX)
\[\frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}}\]
\frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}}
Formula (extracted LaTeX)
\[\tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}}\]
\tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}}
Formula (extracted text)
Two-sided confidence interval for a mean with known σ (z): $ \bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}} $ Two-sided confidence interval for a mean with unknown σ (t): $ \bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}} $ Wald interval for a proportion p: $ \hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $ Wilson score interval for a proportion p: $ \frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}} $ Agresti–Coull interval: $ \tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}} $
Variables and units
  • No variables provided in audit spec.
Sources (authoritative):
Changelog
Version: 0.1.0-draft
Last code update: 2026-01-19
0.1.0-draft · 2026-01-19
  • Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido on 2026-01-19
Profile · LinkedIn

Confidence Interval Calculator

Build two-sided confidence intervals for means and proportions using z or t critical values with clear steps.

Data Source and Methodology

Authoritative source: National Institute of Standards and Technology (NIST), Engineering Statistics Handbook, Section 8: Confidence Intervals (revision 2012). Direct link.

Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.

The Formula Explained

Two-sided confidence interval for a mean with known σ (z):

$$ \bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}} $$

Two-sided confidence interval for a mean with unknown σ (t):

$$ \bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}} $$

Wald interval for a proportion p:

$$ \hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $$

Wilson score interval for a proportion p:

$$ \frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}} $$

Agresti–Coull interval:

$$ \tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}} $$

Glossary of Variables

  • x̄ — sample mean.
  • σ — population standard deviation (known).
  • s — sample standard deviation (unknown σ case).
  • n — sample size; df = n − 1 for t.
  • z, t — critical values for the standard normal and Student’s t distributions.
  • x — number of successes; n — number of trials; p̂ = x/n.
  • SE — standard error; ME — margin of error; CI — confidence interval.

How It Works: A Step-by-Step Example

Scenario: A team measures the compression strength (MPa) of 25 samples: x̄ = 10.2, s = 3.1. Construct a 95% CI for the mean strength (σ unknown).

  1. df = 24; confidence level 95% ⇒ α = 0.05 ⇒ use t critical t0.975,24 ≈ 2.064.
  2. SE = s / √n = 3.1 / 5 = 0.62.
  3. ME = t × SE = 2.064 × 0.62 ≈ 1.2797.
  4. CI = x̄ ± ME = 10.2 ± 1.2797 ⇒ [8.9203, 11.4797].

Frequently Asked Questions (FAQ)

How do I choose the confidence level?

95% is standard; 90% yields narrower intervals, 99% wider. Choose based on risk tolerance and domain norms.

What if my data are skewed or have outliers?

For means with small n, t-intervals assume approximate normality of the sampling distribution. Consider transformations or robust methods if skew/outliers are extreme.

Is the Wilson interval always better than Wald?

Wilson has superior coverage, especially near boundaries or at small n. Wald is simple but can be unreliable when np or n(1−p) are small.

Can I paste raw data?

Yes. Use the “Paste raw data” panel. We compute x̄ and s, which replace manual entries for mean-based intervals.

Do results round values?

We compute with full precision and display to a sensible number of decimals. You can interpret or round per your reporting standards.

Are intervals one- or two-sided?

Currently two-sided. One-sided intervals will be added in a future update.


Audit: Complete
Formula (LaTeX) + variables + units
This section shows the formulas used by the calculator engine, plus variable definitions and units.
Formula (extracted LaTeX)
\[','\]
','
Formula (extracted LaTeX)
\[\bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}\]
\bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}
Formula (extracted LaTeX)
\[\bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}}\]
\bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}}
Formula (extracted LaTeX)
\[\hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\]
\hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}
Formula (extracted LaTeX)
\[\frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}}\]
\frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}}
Formula (extracted LaTeX)
\[\tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}}\]
\tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}}
Formula (extracted text)
Two-sided confidence interval for a mean with known σ (z): $ \bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}} $ Two-sided confidence interval for a mean with unknown σ (t): $ \bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}} $ Wald interval for a proportion p: $ \hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $ Wilson score interval for a proportion p: $ \frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}} $ Agresti–Coull interval: $ \tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}} $
Variables and units
  • No variables provided in audit spec.
Sources (authoritative):
Changelog
Version: 0.1.0-draft
Last code update: 2026-01-19
0.1.0-draft · 2026-01-19
  • Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido on 2026-01-19
Profile · LinkedIn

Confidence Interval Calculator

Build two-sided confidence intervals for means and proportions using z or t critical values with clear steps.

Data Source and Methodology

Authoritative source: National Institute of Standards and Technology (NIST), Engineering Statistics Handbook, Section 8: Confidence Intervals (revision 2012). Direct link.

Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.

The Formula Explained

Two-sided confidence interval for a mean with known σ (z):

$$ \bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}} $$

Two-sided confidence interval for a mean with unknown σ (t):

$$ \bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}} $$

Wald interval for a proportion p:

$$ \hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $$

Wilson score interval for a proportion p:

$$ \frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}} $$

Agresti–Coull interval:

$$ \tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}} $$

Glossary of Variables

  • x̄ — sample mean.
  • σ — population standard deviation (known).
  • s — sample standard deviation (unknown σ case).
  • n — sample size; df = n − 1 for t.
  • z, t — critical values for the standard normal and Student’s t distributions.
  • x — number of successes; n — number of trials; p̂ = x/n.
  • SE — standard error; ME — margin of error; CI — confidence interval.

How It Works: A Step-by-Step Example

Scenario: A team measures the compression strength (MPa) of 25 samples: x̄ = 10.2, s = 3.1. Construct a 95% CI for the mean strength (σ unknown).

  1. df = 24; confidence level 95% ⇒ α = 0.05 ⇒ use t critical t0.975,24 ≈ 2.064.
  2. SE = s / √n = 3.1 / 5 = 0.62.
  3. ME = t × SE = 2.064 × 0.62 ≈ 1.2797.
  4. CI = x̄ ± ME = 10.2 ± 1.2797 ⇒ [8.9203, 11.4797].

Frequently Asked Questions (FAQ)

How do I choose the confidence level?

95% is standard; 90% yields narrower intervals, 99% wider. Choose based on risk tolerance and domain norms.

What if my data are skewed or have outliers?

For means with small n, t-intervals assume approximate normality of the sampling distribution. Consider transformations or robust methods if skew/outliers are extreme.

Is the Wilson interval always better than Wald?

Wilson has superior coverage, especially near boundaries or at small n. Wald is simple but can be unreliable when np or n(1−p) are small.

Can I paste raw data?

Yes. Use the “Paste raw data” panel. We compute x̄ and s, which replace manual entries for mean-based intervals.

Do results round values?

We compute with full precision and display to a sensible number of decimals. You can interpret or round per your reporting standards.

Are intervals one- or two-sided?

Currently two-sided. One-sided intervals will be added in a future update.


Audit: Complete
Formula (LaTeX) + variables + units
This section shows the formulas used by the calculator engine, plus variable definitions and units.
Formula (extracted LaTeX)
\[','\]
','
Formula (extracted LaTeX)
\[\bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}\]
\bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}
Formula (extracted LaTeX)
\[\bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}}\]
\bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}}
Formula (extracted LaTeX)
\[\hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\]
\hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}
Formula (extracted LaTeX)
\[\frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}}\]
\frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}}
Formula (extracted LaTeX)
\[\tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}}\]
\tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}}
Formula (extracted text)
Two-sided confidence interval for a mean with known σ (z): $ \bar{x} \pm z_{1-\alpha/2} \cdot \frac{\sigma}{\sqrt{n}} $ Two-sided confidence interval for a mean with unknown σ (t): $ \bar{x} \pm t_{1-\alpha/2,\;n-1} \cdot \frac{s}{\sqrt{n}} $ Wald interval for a proportion p: $ \hat{p} \pm z_{1-\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $ Wilson score interval for a proportion p: $ \frac{\hat{p} + \frac{z^2}{2n} \pm z \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}} {1 + \frac{z^2}{n}} $ Agresti–Coull interval: $ \tilde{p} = \frac{x + \tfrac{z^2}{2}}{n + z^2}, \quad \text{CI} = \tilde{p} \pm z \sqrt{\frac{\tilde{p}(1-\tilde{p})}{\,n + z^2\,}} $
Variables and units
  • No variables provided in audit spec.
Sources (authoritative):
Changelog
Version: 0.1.0-draft
Last code update: 2026-01-19
0.1.0-draft · 2026-01-19
  • Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido on 2026-01-19
Profile · LinkedIn
Formulas

(Formulas preserved from original page content, if present.)

Version 0.1.0-draft
Citations

Add authoritative sources relevant to this calculator (standards bodies, manuals, official docs).

Changelog
  • 0.1.0-draft — 2026-01-19: Initial draft (review required).