If you are just a beginner in statistics then you probably find the confidence intervals with normal distribution formulas. But in actual, the confidence intervals are calculated using t-distribution especially when you are working with small samples.

A confidence interval explains to you about the certainty level for one particular statistic. It can also be used to find the margin of error. It will tell you how confident you are when calculating results from a survey and what would happen if you take survey of the entire population. Confidence intervals are internally connected to the confidence levels.

To understand the confident intervals, this is necessary to gain insights on confidence levels too. Confidence levels are generally expressed in percentage. It means you should repeat the experiment plenty of times to match the actual results. In case of confidence level, you are very much sure about the prediction. Next comes confidence interval to keep your eyes on.

If you don’t know anything about the population behavior, you should use the t-distribution to find the confidence intervals. In majority of cases, you are not sure of population parameters otherwise you would not be looking at statistics. Basically, it will tell you how much are you confident in your outcomes.

\[\large If\;n<30,\;then\;Confidence\;Interval = x\pm t_{\frac{\alpha}{2}}\left ( \frac{\sigma }{\sqrt{n}} \right )\]

Where,

n = Number of terms

x = Sample Mean

σ = Standard Deviation

$z_{\frac{\alpha }{2}}$ = Value corresponding to $\frac{\alpha }{2}$ in z table

$t_{\frac{\alpha }{2}}$ = Value corresponding to $\frac{\alpha }{2}$ in t table

$\alpha$ =1- $\frac{Confidence\;Level}{100}$.

With one survey or experiment, you can never be 100 percent sure but you should repeat the experiments as needed. Even if you are more than 90 percent sure, it is good enough in statistics. The concept is frequently used in our real-life situations too.