n-1 standard deviation

Why do we divide the equation by n-1 to find out the variance and then the standard deviation.

What we are calculating are properly known as the _ bias-adjusted _ sample variance and the _ bias-adjusted _ sample standard deviation; the adjustment of dividing by n – 1 instead of dividing by n removes the bias from the sample variance, so that the expected value of the sample variance is the population’s variance.

You can think of it as a loss of one degree of freedom: by using the calculated sample mean in the variance calculation, we lose one degree of freedom in our sample.

wiki Bessel Correction