How this calculator works
- Step 1Estimatex̄ or p̂Your sample’s mean or share.
- Step 2Standard errorσ ÷ √nHow much the estimate varies from sample to sample.
- Step 3Margin± z × SEz sets how sure you want to be.
A confidence interval is your estimate plus and minus a margin of error. A 90% level means intervals made this way contain the true value 90% of the time.
Worked example: the textbook mean
- Interval
x̄ ± z × σ ÷ √n
- Standard error3 ÷ √360.50
- z for 90%1.645
- Marginz × 0.5±0.82
- Interval67.18 to 68.82
The textbook gives (67.18, 68.82), the same to two decimals.
A proportion
- Normal interval81.0% – 87.4%The textbook method: p̂ ± z × √(p̂(1 − p̂) ÷ n).
- Wilson interval80.7% – 87.1%Better behaved for small samples and extreme shares.
More confidence, wider interval
To halve the margin at the same confidence, you need four times the sample.
Assumptions and limits
- Random sampleEach member picked independently.
- Known σMean mode uses z, not t.
- Large enoughWarnings appear for small samples.
- Not one interval’s chanceThe level describes the method.
Related statistics tools
An interval shows how precise an estimate is. Planning a study and testing a result are the steps around it.
To plan how many responses you need, use the sample size calculator. For the spread of raw data, try the standard deviation calculator, and to compare two means, the t-test calculator.
Common mistakes
Mistake: Using z with a small sample and its own s.
Instead: Use a t-interval, which is wider.
Mistake: Saying the true value is 90% likely inside.
Instead: Say 90% of such intervals capture it.
Mistake: Ignoring a biased sample.
Instead: No interval fixes a poor sampling method.
Checking the method
A separate script re-works every golden value with Python's inverse normal and a quadratic solve, and reproduces both OpenStax examples.
Read how we test our calculators, or browse more maths calculators.