Standard Deviation Calculator
Calculate the standard deviation of a dataset used for feature normalization.
Inputs
Separate values with commas or spaces.
Sample Std Deviation
13.4907
Population Std Deviation
12.3153
Mean
18.0000
Coefficient of Variation
74.95%
Step by step
Sample variance: Σ(x−mean)² ÷ (n−1)
= 182.0000
Sample std dev: √variance
√182.0000
= 13.4907
Population std dev: √(Σ(x−mean)² ÷ n)
√151.6667
= 12.3153
How it works
Standard deviation is the square root of variance, expressed in the same units as the original data, which makes it more directly interpretable than variance for understanding data spread. Sample standard deviation uses the (n−1) denominator (Bessel's correction); population standard deviation uses n. In ML feature engineering, standard deviation is the key ingredient in z-score normalization (standardization): scaling a feature to zero mean and unit variance by subtracting the mean and dividing by the standard deviation.
Formula
s = sqrt(sum((x_i - mean)^2) / (n - 1))
- x_i
- Individual data values
- mean
- Arithmetic mean of the dataset
- n
- Number of values
Frequently Asked Questions
Why is standard deviation more interpretable than variance?
Variance is in squared units (e.g. dollars² if the data is in dollars), which has no direct real-world meaning, while standard deviation is back in the original units, making it directly comparable to the data itself and to the mean.
How is standard deviation used in feature scaling?
Standardization computes z = (x − mean) / std for each feature value, producing a rescaled feature with mean 0 and standard deviation 1 — this puts differently-scaled features on comparable footing for gradient-based models and distance-based algorithms.
What does the coefficient of variation tell me?
It expresses standard deviation as a percentage of the mean (std/mean × 100%), which is useful for comparing the relative variability of datasets with different units or very different average magnitudes.
Should I always use sample standard deviation for ML datasets?
In almost all practical ML scenarios, yes — your training data is a sample from a larger underlying data distribution, so the (n−1) sample formula is the statistically appropriate choice.