Confidence Interval Calculator — Step-by-Step Solutions
The Confidence Interval Calculator computes confidence intervals for population means and proportions. It supports z-based intervals for large samples, t-based intervals for small samples, proportion intervals using the normal approximation, and required sample size calculations.
Enter your sample statistics and desired confidence level to get the interval bounds, margin of error, and step-by-step formula breakdown.
Your calculations will appear here
How to Use the Confidence Interval Calculator
- Choose the interval type: CI for Mean (Z) when you know the population standard deviation, CI for Mean (T) when you only have the sample standard deviation, CI for Proportion for survey percentages, or Required Sample Size to plan how many responses you need.
- For the mean modes, enter the sample mean, the standard deviation and the sample size n. For a proportion, enter the number of successes and the sample size.
- Enter the confidence level as a decimal, for example 0.95 for 95% confidence. 0.90 and 0.99 are also common.
- The result shows the lower bound, the upper bound, the margin of error and the critical value used. The working shows the standard error and each step.
Formula and Theory
A confidence interval gives a range of plausible values for an unknown population quantity. A 95% interval is built by a procedure that captures the true value in 95% of repeated samples. It does not mean there is a 95% probability that the true value lies in this particular interval.
Every interval has the form estimate plus or minus margin of error, where the margin equals a critical value times the standard error. For a mean with known sigma the standard error is sigma / sqrt(n) and the critical value is a z-score (1.96 for 95%). With an unknown sigma, use the sample standard deviation s and a t critical value with n - 1 degrees of freedom, which is wider for small samples.
For a proportion the standard error is sqrt(p-hat x (1 - p-hat) / n), where p-hat is the sample proportion. This simple Wald interval works well for large samples where p-hat is not close to 0 or 1.
Three things shrink an interval: a larger sample, less variable data, or a lower confidence level. Raising the confidence level always widens the interval.
Worked Examples
Example 1: Mean with known standard deviation (z interval)
Problem: A sample of 100 has mean 50. The population standard deviation is 10. Find the 95% confidence interval.
Solution: Standard error = 10 / sqrt(100) = 1. Margin of error = 1.96 x 1 = 1.96. Interval = 50 plus or minus 1.96.
Answer: 48.04 to 51.96
Example 2: Mean with unknown standard deviation (t interval)
Problem: A sample of 25 has mean 50 and sample standard deviation 12. Find the 95% confidence interval.
Solution: Standard error = 12 / sqrt(25) = 2.4. Degrees of freedom = 24, so t = 2.0639. Margin of error = 2.0639 x 2.4 = 4.9534. Interval = 50 plus or minus 4.9534.
Answer: 45.05 to 54.95
Example 3: Proportion
Problem: In a poll of 100 people, 60 say yes. Find the 95% confidence interval for the proportion.
Solution: p-hat = 60 / 100 = 0.6. Standard error = sqrt(0.6 x 0.4 / 100) = sqrt(0.0024) = 0.04899. Margin of error = 1.96 x 0.04899 = 0.0960. Interval = 0.6 plus or minus 0.0960.
Answer: 50.4% to 69.6%
Example 4: Required sample size for a target margin
Problem: How many people are needed for a margin of error of 3 percentage points at 95% confidence, with p = 0.5?
Solution: n = z^2 x p(1 - p) / E^2 = 1.96^2 x 0.25 / 0.03^2 = 0.9604 / 0.0009 = 1067.1, rounded up.
Answer: n = 1,068
Frequently Asked Questions
What does a 95% confidence interval mean?
Should I use the z interval or the t interval?
Why is a 99% interval wider than a 95% interval?
How do I make a confidence interval narrower?
Can I use this for a small sample proportion?
Do overlapping intervals mean no significant difference?
Related Statistics Calculators
Probability Calculator
Calculate probability of events, complements, unions, and intersections. Free online probability calculator for statistics.
Standard Deviation Calculator
Calculate standard deviation, variance, mean, and more for any dataset. Supports population and sample statistics. Free online tool.
Z-Score Calculator
Calculate z-scores, find values from z-scores, and determine probabilities. Free online z-score calculator with bell curve visualisation.
Binomial Calculator
Calculate binomial probabilities, cumulative distributions, and expected values. Free online binomial distribution calculator with bar chart.
Normal Distribution Calculator
Calculate probabilities for normal distributions. Find areas under the bell curve, percentiles, and inverse values. Free online tool.
Correlation Calculator
Calculate Pearson correlation coefficient, R-squared, and regression line. Free online correlation calculator with scatter plot.