📊 Statistics Calculator

🔧 Operation

📝 Data values

Paste numbers separated by commas, spaces, tabs, semicolons, or newlines. Up to 100,000 values.

📝 X and Y series

Paste the X and Y values separately. They must contain the same number of finite numbers (at least 2).

📤 Result

{{ line.label }} {{ line.value }}
mean: {{ zScoresResult.mean }}, σ (population): {{ zScoresResult.stdDevPopulation }}
#
Value
z-score
{{ line.index }}
{{ line.value }}
{{ line.z }}
{{ line.label }} {{ line.value }}
{{ line.label }} {{ line.value }}
Enter values and the result will appear here.
⚠️

ℹ️ About Statistics Calculator

What does this statistics calculator compute?

This is a four-in-one statistics calculator for numeric datasets: a mean median mode calculator, standard deviation calculator, z-score calculator, Pearson/Spearman correlation calculator, and simple linear regression calculator in one page. Paste one series for descriptive statistics or z-scores, or paste paired X/Y series for correlation and ordinary least squares regression. The calculator reports both population and sample formulas so you can match spreadsheet, classroom, quality-control, and data-science workflows.

All browser calculations run locally. The API endpoint below uses the same compiled JavaScript module on the server, so UI and API results share the same parsing rules, percentile method, and edge-case handling.

  • Describe — count, sum, mean, median, mode, min/max, range, variance, standard deviation, quartiles, percentiles, skewness, kurtosis, geometric/harmonic mean, RMS, outliers.
  • Z-scores — standardise each value as (x − mean) / σ.
  • Correlation — Pearson r and Spearman ρ for two paired series.
  • Linear regression — ordinary least squares slope, intercept, and R².

Metric definitions

  • Mean — arithmetic average: (Σ xᵢ) / n.
  • Median — middle value after sorting; the average of the two middle values for even n.
  • Mode — value(s) with the highest frequency. Empty when every value is unique.
  • Variance (population, σ²) — (Σ (xᵢ − μ)²) / N. Use when the data are the entire population.
  • Variance (sample, s²) — (Σ (xᵢ − x̄)²) / (N − 1). Bessel-corrected estimator for variance from a sample.
  • Standard deviation — square root of variance. Population σ and sample s reported separately.
  • Quartiles — Q1 / Q2 / Q3 mark the 25/50/75th percentiles. IQR = Q3 − Q1 measures the middle 50% spread.
  • Percentiles — computed by linear interpolation between sorted ranks using Type 7 / R-7, matching the default documented by R's quantile().
  • Skewness — Fisher-Pearson asymmetry: (1/n) Σ ((xᵢ − μ) / σ)³. Positive = long right tail; negative = long left tail.
  • Kurtosis (excess) — tail weight relative to a normal distribution: (1/n) Σ ((xᵢ − μ) / σ)⁴ − 3. Normal ≈ 0.
  • Geometric mean — (Π xᵢ)^(1/n); null when any value is ≤ 0 (log undefined).
  • Harmonic mean — n / Σ (1 / xᵢ); null when any value is ≤ 0.
  • Root mean square (RMS) — sqrt((Σ xᵢ²) / n).
  • Coefficient of variation — s / mean. null when mean is zero.
  • Outliers — values outside [Q1 − 1.5·IQR, Q3 + 1.5·IQR], the same fence rule described in the NIST box plot guide.
  • Z-score — (x − μ) / σ. Number of standard deviations a value lies from the mean.
  • Pearson r — linear correlation coefficient in [−1, 1]. Sensitive to outliers, undefined if either input has zero variance.
  • Spearman ρ — Pearson correlation after replacing values with average ranks, useful for monotonic relationships and tied ranks.
  • Linear regression — ordinary least squares fit minimizing Σ (yᵢ − m·xᵢ − b)². Reports slope m, intercept b, and R².

Common use cases

  • Data science exploration — first-pass summary of a numeric column to spot skew, outliers, and spread before modelling.
  • A/B testing summaries — describe control and treatment groups, compute z-scores to identify unusual sessions.
  • Quality control — track measurements against population/sample standard deviation, flag values outside 1.5·IQR fences.
  • Classroom checks — verify hand calculations for sample variance, percentile interpolation, correlation, and regression homework.
  • Finance and operations — summarize returns, lead times, latency measurements, or support volumes before exporting to a notebook.

Worked example

Enter 2, 4, 4, 4, 5, 5, 7, 9 in Describe mode. The summary should show:

  • mean = 5
  • population variance σ² = 4 → population σ = 2
  • sample variance s² = 32/7 ≈ 4.571 → sample s ≈ 2.138
  • median = 4.5, mode = {4} (4 appears 3 times, 5 only twice)
  • min = 2, max = 9, range = 7

In Correlation mode, X = 1, 2, 3, 4, 5 and Y = 2, 4, 6, 8, 10 return Pearson r = 1 and Spearman ρ = 1. In Regression mode, the same pair returns slope = 2, intercept = 0, and R² = 1.

Limitations and edge cases

  • The browser accepts finite numbers only; blank values, NaN, and Infinity are rejected instead of silently ignored.
  • Single-value samples have zero sample variance in this tool so the output remains numeric, but inferential statistics still require more data.
  • Z-scores, Pearson correlation, Spearman correlation, and linear regression are undefined when the relevant series has zero variance.
  • Geometric and harmonic means require strictly positive values; zero or negative inputs return null for those fields.
  • Outlier flags are descriptive. A 1.5·IQR fence highlights unusual values, but it does not prove an entry is wrong or should be removed.
  • Regression summarizes a straight-line association. Check a scatter plot before using the slope for prediction, and avoid extrapolating outside the observed X range.
  • The input limit is 100,000 values to keep large browser calculations responsive.

Source references

API Usage Example:

POST /api/tools/math/statistics-calculator
Content-Type: application/json

{
    "operation": "describe",
    "values": [
        2,
        4,
        4,
        4,
        5,
        5,
        7,
        9
    ]
}
Ready