Written and maintained by CASRAI Editorial Board
Published
On this page
To normalize z score values across a dataset means converting raw measurements into dimensionless standard scores indicating how many standard deviations an observation falls from the mean. Known interchangeably as z score normalization, z score normalisation, z-score normalisation, z-score normalization, or z normalization, this linear transformation rescales continuous variables to a distribution with a mean of 0 and a standard deviation of 1. By re-centering data around zero, researchers can directly compare scores across disparate instruments, populations, or measurement units.
Definition in One Paragraph: What Is Z-Score Normalization?
Z-score normalization is a univariate transformation that rescales raw continuous data by subtracting the arithmetic mean from each observation and dividing the deviation by the standard deviation. This maps observations onto the standard normal distribution (Z ~ N(0, 1)). Unlike min-max scaling, z-score normalization does not compress values into a bounded interval; it preserves original relative distances, skewness, and kurtosis, ensuring genuine distribution shapes and extreme tail values remain identifiable for statistical evaluation.
Formula with Every Symbol Explained: Population and Sample Z Normalization
The mathematical formulation of z-score normalization depends on whether the transformation operates on a complete closed population or a finite empirical sample.
Population Z-Score Normalization Formula
When parameters for the entire target population are known, the formula is:
z = (x – μ) / σ
- z: Standardized z-score (number of standard deviations the raw score lies from the population mean).
- x: Individual raw observation.
- μ (mu): Population mean: μ = (Σ x) / N.
- σ (sigma): Population standard deviation: σ = √[ (Σ (x – μ)²) / N ].
- N: Total population size.
Sample Z-Score Normalisation Formula
In empirical research, population parameters are rarely known, requiring sample statistics:
z = (x – x̄) / s
- z: Sample standardized z-score.
- x: Individual sample observation.
- x̄ (x-bar): Sample mean: x̄ = (Σ x) / n.
- s: Sample standard deviation: s = √[ (Σ (x – x̄)²) / (n – 1) ].
- n: Sample size.
Using n – 1 degrees of freedom corrects downward variance bias before running a z-test vs. t-test or fitting linear models.
Worked Example with Real Numbers and Arithmetic Shown
Consider an experiment measuring response times (milliseconds) across n = 5 participants:
Dataset: [12, 15, 18, 21, 24]
Step 1: Compute Sample Mean (x̄)
Σ x = 12 + 15 + 18 + 21 + 24 = 90; x̄ = 90 / 5 = 18.0 ms
Step 2: Compute Deviations and Squared Deviations
- x = 12: (12 – 18) = -6.0; (-6.0)² = 36.0
- x = 15: (15 – 18) = -3.0; (-3.0)² = 9.0
- x = 18: (18 – 18) = 0.0; (0.0)² = 0.0
- x = 21: (21 – 18) = +3.0; (+3.0)² = 9.0
- x = 24: (24 – 18) = +6.0; (+6.0)² = 36.0
Sum of squared deviations: Σ (x – x̄)² = 36.0 + 9.0 + 0.0 + 9.0 + 36.0 = 90.0
Step 3: Compute Sample Standard Deviation (s)
s² = 90.0 / (5 – 1) = 22.5; s = √22.5 ≈ 4.7434 ms (rounded to 4.74 ms)
Step 4: Compute Standardized Z-Scores
Apply z = (x – x̄) / s to each raw point:
- x = 12: z = (12 – 18) / 4.7434 ≈ -1.26
- x = 15: z = (15 – 18) / 4.7434 ≈ -0.63
- x = 18: z = (18 – 18) / 4.7434 = 0.00
- x = 21: z = (21 – 18) / 4.7434 ≈ +0.63
- x = 24: z = (24 – 18) / 4.7434 ≈ +1.26
The sample standardized dataset is [-1.26, -0.63, 0.00, +0.63, +1.26]. (If treated as an exhaustive population with N = 5, σ = √18 ≈ 4.24 ms, yielding population scores [-1.41, -0.71, 0.00, +0.71, +1.41]. Keeping degrees of freedom explicit avoids pipeline discrepancies.)
Interpretation: What the Normalized Z-Score Means
A normalized z-score communicates both sign (direction relative to mean) and magnitude (distance in standard deviations).
| Z-Score Range | Relative Position | Theoretical Percentile (Normal Dist.) | Statistical Interpretation |
|---|---|---|---|
| z = 0.00 | Equal to mean (x = x̄) | 50.0th percentile | Exact center of distribution. |
| -1.00 ≤ z ≤ +1.00 | Within 1 SD of mean | 15.87th to 84.13th percentile | Central density (~68.27% under the empirical rule). |
| -2.00 ≤ z < -1.00 or +1.00 < z ≤ +2.00 | Between 1 and 2 SDs | 2.28th–15.87th or 84.13th–97.72nd | Moderate deviation (~95.45% within ±2 SDs). |
| -3.00 ≤ z < -2.00 or +2.00 < z ≤ +3.00 | Between 2 and 3 SDs | 0.13th–2.28th or 97.72nd–99.87th | Substantial deviation; tail region. |
| |z| > 3.00 | More than 3 SDs from mean | < 0.13th or > 99.87th percentile | Potential univariate outlier per NIST guidelines. |
Per the NIST/SEMATECH e-Handbook of Statistical Methods (Section 1.3.5.17), observations with |z| > 3 indicate potential univariate outliers. In small samples, however, extreme values inflate s and shift x̄ toward themselves, masking outliers. When severe contamination is suspected, NIST recommends computing the robust Modified Z-score: M_i = 0.6745(x_i – x̃) / MAD, where x̃ is the median and MAD is the Median Absolute Deviation, using |M_i| > 3.5 as the outlier threshold.
Assumptions and Common Mistakes in Z-Score Normalization
- Assuming Normal Distribution Is Mandatory: Standardized scores can be computed on any distribution with finite mean and non-zero variance. Chebyshev’s inequality guarantees that ≥75% of observations fall within |z| ≤ 2 and ≥88.9% within |z| ≤ 3 for any distribution. Normality is required only when converting scores to cumulative probabilities or p-values.
- Conflating Sample (n – 1) and Population (n) Scaling: Packages apply different defaults. SciPy’s
zscoredefaults to population scaling (ddof=0), while R’sscale()and Excel’sSTDEV.Suse sample scaling (ddof=1). Mixing conventions across workflows introduces discrepancies. - Data Leakage Across Partitions: In machine learning, compute mean and standard deviation solely on training data, then apply those fixed parameters to validation and test sets. Calculating parameters across the full dataset causes data leakage.
- Zero Variance / Constant Features: If an attribute has identical values across all rows, s = 0, causing division-by-zero errors. Preprocessing pipelines must detect and remove invariant columns before scaling.
- Sensitivity to Outliers: Because mean and standard deviation have a 0% breakdown point, extreme anomalies distort all normalized values. Inspect distributions prior to standardization.
How to Report It: APA 7th Edition Example
The Publication Manual of the American Psychological Association (7th ed., 2020) provides standardized conventions for reporting z-scores in scientific manuscripts:
- Italicize: Format the statistic symbol as an italicized lowercase z.
- Spacing: Include spaces around mathematical operators (e.g., z = 1.26).
- Negative Signs: Place the minus sign directly against the number without space (e.g., z = -1.26).
- Precision: Report z-scores to two decimal places. Report p-values without a leading zero when bounded by 1.0 (e.g., p = .021).
APA Manuscript Reporting Example:
“To compare test scores across cohorts with differing evaluation metrics, raw performance measures were standardized via sample z-score normalization (M = 0.00, SD = 1.00). Control group participants performed within typical cohort bounds (z = 0.63), whereas treatment group participants exhibited accelerated completion speeds significantly exceeding cohort averages (z = 2.45, p = .014).”
How to Calculate It in Excel, R, and Python
Modern data workflows utilize built-in functions to execute z-score normalization across multidimensional datasets.
Calculating Z-Scores in Microsoft Excel
Standardize values in column A (cells A2:A6) using either the STANDARDIZE function or direct formulas, as outlined in our guide on normalizing data in Excel:
# Method 1: Dedicated STANDARDIZE function
=STANDARDIZE(A2, AVERAGE($A$2:$A$6), STDEV.S($A$2:$A$6))
# Method 2: Direct formula using sample standard deviation
=(A2 - AVERAGE($A$2:$A$6)) / STDEV.S($A$2:$A$6)
Z Score Normalisation in R
Base R provides the vectorised scale() function, which applies sample standard deviation (n – 1) by default:
# Input vector
x <- c(12, 15, 18, 21, 24)
# Z-score standardization using base R scale()
z_scores <- as.vector(scale(x))
print(round(z_scores, 2))
# Output: [1] -1.26 -0.63 0.00 0.63 1.26
Z Normalization in Python
Python scientific libraries support both statistical and machine learning applications:
import numpy as np
from scipy import stats
from sklearn.preprocessing import StandardScaler
data = np.array([12, 15, 18, 21, 24])
# SciPy: specify ddof=1 for sample standard deviation (n - 1)
z_sample = stats.zscore(data, ddof=1)
print("Sample z:", np.round(z_sample, 2))
# Output: [-1.26 -0.63 0. 0.63 1.26]
# SciPy default ddof=0 computes population z-score (N)
z_pop = stats.zscore(data, ddof=0)
print("Population z:", np.round(z_pop, 2))
# Output: [-1.41 -0.71 0. 0.71 1.41]
# Scikit-learn StandardScaler (uses ddof=0)
scaler = StandardScaler()
scaled = scaler.fit_transform(data.reshape(-1, 1)).flatten()
print("StandardScaler:", np.round(scaled, 2))
Frequently Asked Questions (FAQ)
How does z-score normalization differ from min-max normalization?
Z-score normalization centers data at mean 0 with unit variance, leaving values unbounded and preserving relative outlier distances. Min-max normalization scales values into a strictly bounded interval (typically [0, 1]). Z-score normalization is preferred for Gaussian data or outlier-sensitive algorithms, whereas min-max scaling suits neural network inputs requiring fixed boundaries.
Can you normalize a z-score when data is not normally distributed?
Yes. The standardization formula requires only a finite mean and non-zero standard deviation. Standardizing non-normal data centers it at 0 and scales variance to 1, but does not alter underlying skewness or transform non-normal data into a Gaussian distribution.
What is the difference between standard deviation and standard error in z-scores?
A standard z-score divides an individual observation’s deviation by the sample standard deviation (s). When testing hypotheses regarding sample means, researchers divide by the standard error of the mean (SE = s / √n) to calculate test statistics.
What happens when a variable has zero variance during z normalization?
When all observations are identical, standard deviation is zero. Dividing by zero is undefined, resulting in NaN or runtime errors. Pipelines must detect and drop invariant variables prior to scaling.
Sources
- National Institute of Standards and Technology (NIST) / SEMATECH. (2012). e-Handbook of Statistical Methods. Section 1.3.5.17: Detection of Outliers, and Section 1.3.6.6.1: Normal Distribution. https://www.itl.nist.gov/div898/handbook/eda/section3/eda35h.htm (read 2026-11-10).
- Illowsky, B., & Dean, S. (2020). Introductory Statistics. OpenStax, Rice University. Section 6.1: The Standard Normal Distribution. https://openstax.org/books/introductory-statistics/pages/6-1-the-standard-normal-distribution (read 2026-11-10).
- International Organization for Standardization. (2022). Statistical methods for use in proficiency testing by interlaboratory comparison (ISO Standard No. 13528:2022). Clause 9.4: Determination of z-scores. Geneva: ISO.
- American Psychological Association. (2020). Publication Manual of the American Psychological Association (7th ed.). Section 6.44: Statistical Symbols and Abbreviations. Washington, DC: Author. https://apastyle.apa.org/ (read 2026-11-10).
- Virtanen, P., Gommers, R., Oliphant, T. E., et al. (2020). SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods, 17(3), 261–272. Reference:
scipy.stats.zscore. https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.zscore.html (read 2026-11-10). - R Core Team. (2024). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria. Documentation:
base::scale. https://stat.ethz.ch/R-manual/R-devel/library/base/html/scale.html (read 2026-11-10).







