Confidence Interval Calculator

Find the confidence interval for a proportion or mean.

Estimate a

Enter the sample size, confidence level, and the proportion or mean data.

How this confidence interval calculator works

This calculator builds a z-based confidence interval for a population proportion or a population mean. Choose Proportion (default) or Mean, pick a confidence level, enter sample size n as an integer at least 1, and add the observed proportion or the sample mean and standard deviation. The headline is the interval, for example 95% CI: 40.20% – 59.80%. Details always show lower bound, upper bound, point estimate, margin of error, z-value, and n.

Empty on a required field is no result. n must be a whole number ≥ 1. Sample proportion is a percent from 0 through 100. In Mean mode, typed 0 for the sample mean is valid; typed 0 or empty standard deviation is no result. Confidence presets match the sample-size tool: 90% (z = 1.645), 95% (1.96, default), 99% (2.576), 99.9% (3.291). Advanced options in Proportion mode can switch to number of successes. Closing it uses the proportion again. Mean mode leaves Advanced empty.

How to use the confidence interval calculator

  1. Choose Proportion (default) or Mean, then pick a confidence level. Default is 95%.
  2. Enter sample size as a whole number at least 1. In Proportion mode enter the sample proportion as a percent. In Mean mode enter the sample mean and a standard deviation greater than 0.
  3. Read the interval in the headline, plus lower, upper, point, margin, z, and n in the details.
  4. In Proportion mode, open Advanced options only if you want to enter number of successes instead of proportion. Closing it uses the proportion again, even if the box stays checked and a successes count stays typed. Mean mode has no Advanced extras.

Advanced options, and closing them

In Proportion mode this section holds Enter number of successes instead of proportion. While open and checked, the proportion field is replaced by Number of successes (a whole number ≥ 0) and p = successes ÷ n. Closing it uses the proportion again, even if the box stays checked and a successes count stays typed. p outside 0 through 1 is no result. In Mean mode Advanced options is empty.

Confidence interval formulas

Proportion: p ± z √(p(1 − p) / n). Mean: x̄ ± z σ / √n. These are normal (z) approximations. For very small samples a t-interval would be slightly wider. The widget does not switch to t.

Proportion interval
p±zp(1−p)n
Mean interval
x¯±zσn

Worked examples

Example: n = 100, sample proportion 50%, 95%

z = 1.96. Margin = 1.96 × √(0.25 ÷ 100) = 0.098. The headline is 95.0% CI: 40.20% – 59.80%. Point estimate is 50.00%.

Example: n = 40, mean 75, σ = 12, 95%

Margin = 1.96 × 12 ÷ √40 ≈ 3.719. The interval is about 71.28 – 78.72. Typed 0 σ is no result. Typed 0 for the sample mean is valid.

Example: 50 successes out of 100

Open Advanced options in Proportion mode and tick Enter number of successes instead of proportion. Enter 50 successes and n = 100. That is the same p = 0.5 as a 50% proportion. Closing Advanced options leaves the successes field in place if the box stays checked. 120 successes out of 100 would make p > 1 and no result. A non-integer n is also no result.

Things to keep in mind

This is a z-interval, not a t-interval. Sample size must be a whole number. Closing Advanced options uses the proportion again and leaves a typed successes count out of the interval. Completed results can be saved in this browser’s local history.

Confidence interval calculator FAQ

Which fields are required?

Sample size (integer ≥ 1), a confidence level (default 95%), and either a sample proportion as a percent (Proportion) or a sample mean plus σ greater than 0 (Mean). Number of successes is an optional Proportion Advanced input. Advanced options is optional.

What happens when I close Advanced options?

Closing uses the sample proportion again, even if Enter number of successes instead of proportion stays checked and a successes count stays typed. Open the section again to use successes. Mean mode has no Advanced extras. Lower, upper, point, margin, z, and n stay visible.

Why is there no result for some n or success counts?

n must be a whole number at least 1. Successes must be a whole number ≥ 0, and successes ÷ n must sit between 0 and 1. Empty required fields are no result. Typed 0 σ in Mean mode is no result.

Is this a t-interval for small samples?

No. Intervals use the normal (z) approximation. For very small samples a t-distribution would give a slightly wider interval. The widget does not switch formulas.

How do I enter successes instead of a percent?

Only in Proportion mode. Open Advanced options and tick Enter number of successes instead of proportion. Then type the count of successes. Closing the section uses the proportion again, even if the box stays checked.

Does this confidence interval calculator store my numbers?

Completed results can be saved in this browser’s local history so you can reopen them later. They stay on your device and are not sent to our servers or to analytics.