Skip to content
🛠️ToolsShed

Z-Score Calculator

Calculate Z-scores, percentile ranks, and normal distribution probabilities.

About this tool

A Z-score measures how many standard deviations a data point falls from the mean in a normal distribution. This metric is fundamental in statistics for standardizing values across different scales and is essential for comparing data, identifying outliers, and understanding probability distributions. Z-scores are widely used in quality control, academic assessments, medical research, and financial analysis where you need to determine how unusual or typical a value is.

To use the calculator, enter your data point value and the mean and standard deviation of your dataset. The tool instantly computes the Z-score and displays the corresponding percentile rank—telling you what percentage of the normal distribution falls below your value. You can also input a Z-score directly to find its percentile, making it useful for hypothesis testing, confidence intervals, and probability lookups. This is particularly helpful when working with standardized test scores (like SAT or IQ), comparing performance across different metrics, or assessing manufacturing tolerances.

Keep in mind that Z-scores assume your data follows a normal (bell-curve) distribution, so results may not be accurate for skewed datasets. The calculator also provides insight into tail probabilities, helping you understand extreme values. Whether you're a student learning statistics, a researcher analyzing experimental data, or a professional evaluating quality metrics, this tool simplifies complex probability calculations into instant, actionable insights.

Frequently Asked Questions

Code Implementation

import math

def erf(x: float) -> float:
    """Abramowitz & Stegun approximation of the error function."""
    sign = 1 if x >= 0 else -1
    x = abs(x)
    a1, a2, a3, a4, a5 = 0.254829592, -0.284496736, 1.421413741, -1.453152027, 1.061405429
    p = 0.3275911
    t = 1.0 / (1.0 + p * x)
    y = 1.0 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * math.exp(-x * x)
    return sign * y

def normal_cdf(z: float) -> float:
    """Cumulative distribution function of the standard normal."""
    return 0.5 * (1 + erf(z / math.sqrt(2)))

def z_score(value: float, mean: float, std_dev: float) -> float:
    """Calculate Z-score: how many SDs from the mean."""
    if std_dev <= 0:
        raise ValueError("Standard deviation must be positive")
    return (value - mean) / std_dev

# Example
x, mu, sigma = 75, 70, 5
z = z_score(x, mu, sigma)
prob = normal_cdf(z)
print(f"Z-score: {z:.4f}")          # 1.0000
print(f"Percentile: {prob*100:.2f}th")  # 84.13th
print(f"Probability: {prob:.6f}")    # 0.841345

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.