Standard Deviation Calculator
Calculate the standard deviation of a dataset used for feature normalization.
About Standard Deviation Calculator
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
Worked example
With the default values below, Standard Deviation Calculator returns Sample Std Deviation of 13.4907. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Dataset
- 4, 8, 15, 16, 23, 42
Results
- Sample Std Deviation
- 13.4907
- Population Std Deviation
- 12.3153
- Mean
- 18.0000
- Coefficient of Variation
- 74.95%
Step by step
- 1Sample variance: Σ(x−mean)² ÷ (n−1)= 182.0000
- 2Sample std dev: √variance= 13.4907
- 3Population std dev: √(Σ(x−mean)² ÷ n)= 12.3153
Assumptions and limits
- The result is derived only from the single input listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
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.
