What mean, median and mode actually measure
The mean, median and mode are the three standard measures of central tendency — three different answers to the question: what single number best represents this whole data set? They are not competitors. They are three tools, each of which answers the question well for some kinds of data and badly for others.
The mean is the arithmetic average: sum ÷ count. It uses every observation and is the basis of most statistical inference, but a single extreme value can pull it far from the bulk of the data. The median is the middle value after sorting. It ignores how far the extremes are, so it stays close to the "typical" value even when the data are skewed. The mode is the most frequent value and is the only average that works on categorical data.
For a quick example, take 4, 8, 15, 16, 23, 23, 42. Mean: 131 ÷ 7 ≈ 18.71. Median: the 4th sorted value = 16. Mode: 23 (appears twice). A "typical value" is probably 16 — the median — because the single 42 stretches the mean upward.
The complete formula sheet
Every statistic has one job, and knowing what that job is makes the numbers much easier to trust. This is the full reference for all the statistics the calculator produces.
Measures of center
| Statistic | Formula | When to use it |
|---|---|---|
| Mean (arithmetic) | x̄ = Σx ÷ n | Symmetric data without outliers. Foundation of most inference. |
| Median | middle of sorted x | Skewed data, ordinal data, any data with outliers. |
| Mode | most frequent x | Categorical data. Also useful to spot bimodality or clustering. |
| Geometric mean | (∏xᵢ)^(1/n) | Growth rates, ratios, multiplicative processes. Requires all x > 0. |
| Harmonic mean | n ÷ Σ(1/xᵢ) | Rates and per-unit ratios — speeds, price-earnings, F1 scores. Requires all x > 0. |
| Weighted mean | Σ(wᵢxᵢ) ÷ Σwᵢ | Weighted grades, survey weights, expected value. |
| RMS | √(Σxᵢ² ÷ n) | Root-mean-square — signal processing, error metrics. |
| Trimmed mean | mean after dropping p% each end | Compromise between mean and median. Common in sports judging. |
Measures of spread
| Statistic | Formula | Meaning |
|---|---|---|
| Range | max(x) − min(x) | Total span. Very sensitive to a single extreme value. |
| Q1, Q2, Q3 | 25th, 50th, 75th percentiles | The "quarter markers". Q2 is the median. |
| IQR | Q3 − Q1 | Spread of the middle 50%. Resistant to outliers. |
| Variance (population) | σ² = Σ(x−μ)² ÷ N | Average squared deviation from the mean. |
| Variance (sample) | s² = Σ(x−x̄)² ÷ (n−1) | Same, with Bessel's correction. |
| Standard deviation | σ or s = √variance | Spread in the same units as the data. |
| MAD (around mean) | Σ|x − x̄| ÷ n | Average absolute distance from the mean. |
| Median absolute deviation | median(|xᵢ − median|) | Robust spread. Often paired with the median. |
| Coefficient of variation | σ ÷ |x̄| × 100% | Relative spread. Only meaningful for ratio data. |
| Standard error of the mean | SE = s ÷ √n | Uncertainty in the sample mean estimate. |
Shape and distribution
| Statistic | Formula | Interpretation |
|---|---|---|
| Skewness | adjusted Fisher–Pearson g₁ | Asymmetry. Positive = right tail. Negative = left tail. |g₁| < 0.5 ≈ symmetric. |
| Bowley skewness | (Q3 + Q1 − 2Q2) ÷ (Q3 − Q1) | Robust quartile-based skewness. Bounded −1 to +1. |
| Kurtosis | excess (Fisher) g₂ | Tail weight vs normal. 0 = normal. Positive = heavier tails. |
| Percentiles | Pp | Value below which p% of the data fall. |
| Z-score | z = (x − x̄) ÷ s | How many SDs from the mean. |
| Outlier fences | Q1 − 1.5·IQR & Q3 + 1.5·IQR | Standard Tukey outlier test. |
Inference
| Statistic | Formula | What it tells you |
|---|---|---|
| CI for the mean | x̄ ± t*·(s ÷ √n) | Range of plausible values for the population mean. |
| Welch's t statistic | (x̄₁−x̄₂) ÷ √(s₁²/n₁+s₂²/n₂) | Two-sample test of equal means. |
| Pearson r | Σ(x−x̄)(y−ȳ) ÷ √(Σ(x−x̄)²Σ(y−ȳ)²) | Linear association. −1 to +1. |
| Spearman ρ | Pearson r on ranked data | Monotonic association. Robust to outliers. |
| Least-squares line | ŷ = a + b·x | Line minimising squared residuals. |
| R² | r² | Proportion of variance in y explained by x. |
Worked example — 4, 8, 15, 16, 23, 42
This is the classic six-value data set used in almost every statistics textbook. Here is what each statistic tells you.
Mean. 4 + 8 + 15 + 16 + 23 + 42 = 108. n = 6. Mean = 108 ÷ 6 = 18.
Median. Sorted: 4, 8, 15, 16, 23, 42. Even count → average middle pair: (15 + 16) ÷ 2 = 15.5.
Mode. Every value appears exactly once. There is no mode.
Range. 42 − 4 = 38.
Quartiles (Tukey). Split into {4, 8, 15} and {16, 23, 42}. Q1 = 8, Q3 = 23. IQR = 15. Fences: −14.5 and 45.5 → no outliers.
Standard deviation. Deviations from 18: −14, −10, −3, −2, 5, 24. Squared sum: 910. Population variance: 910/6 ≈ 151.67, σ ≈ 12.32. Sample variance: 910/5 = 182, s ≈ 13.49.
Geometric mean. (4×8×15×16×23×42)^(1/6) = (7,418,880)^(1/6) ≈ 13.98.
Skewness. Right tail is longer → right-skewed. Mean (18) above median (15.5). Classic right-skew signature.
Geometric and harmonic mean — when the arithmetic mean lies
The arithmetic mean is only "the" average when data are on an additive scale. For multiplicative processes — investment returns, price ratios, growth rates — it systematically overestimates the true average.
Geometric mean: for growth rates and ratios
If an investment returns +10%, −20%, then +15%, the arithmetic mean return is 1.67%. But trace the money: $1000 × 1.10 × 0.80 × 1.15 = $1012, which is +1.2% total, or about +0.4% per year. The geometric mean of the multipliers (1.10 × 0.80 × 1.15)^(1/3) ≈ 1.00399 correctly reports the compound growth.
Harmonic mean: for rates and per-unit ratios
If you drive 60 mph for half a trip and 40 mph for the other half, the intuitive average of 50 mph is wrong. You spend more time at the slower speed. The correct average is the harmonic mean: 2 ÷ (1/60 + 1/40) = 48 mph.
Use the harmonic mean for: average speed over equal distances, average price-to-earnings across equal-dollar positions, average fuel efficiency when the denominator varies, F1 score (harmonic mean of precision and recall).
The AM-GM-HM chain
For any positive numbers: harmonic mean ≤ geometric mean ≤ arithmetic mean, with equality only when all values are identical. The gap between AM and GM is itself a measure of variability.
Which average should you report?
- Roughly symmetric, no strong outliers. Report the mean.
- Right-skewed (mean > median). Report the median. Incomes, house prices, view counts.
- Left-skewed (mean < median). Report the median. Exam scores near a ceiling, retirement ages.
- Non-numeric data. Only the mode.
- Multiplicative data (growth, ratios). Geometric mean.
- Rates and per-unit ratios. Harmonic mean.
- Weighted data. Weighted mean.
- Bimodal data. Report both modes plus the split point. A single "average" of a bimodal distribution is misleading.
Outliers and the 1.5 × IQR rule
An outlier is a value far from the rest. The standard definition, popularised by John Tukey:
Any value outside the fences is a "potential outlier". Other texts use 3 × IQR (extreme outlier), z-score thresholds (|z| > 3), or the modified z-score with median and MAD.
Z-scores: how unusual is a value?
z = (x − x̄) ÷ s standardises a value. z = 0 is at the mean; |z| ≥ 2 is outside the middle ~95%; |z| ≥ 3 is outside the middle ~99.7%.
Percentiles and percentile ranks
A percentile is a value below which a given percentage of the data falls. The 25th percentile (Q1) has 25% of the data below it. The calculator reports P5, P10, P25, P50, P75, P90, P95, and all nine deciles.
Percentiles are essential for income distributions, growth charts, test scores, service levels (p95 latency), and risk management (Value at Risk).
Confidence intervals — how uncertain is the mean?
The sample mean is an estimate of the true population mean. A confidence interval quantifies the uncertainty:
A 95% CI means: if we repeated this sampling many times, 95% of the intervals we constructed would contain the true population mean. The true mean is fixed; the interval is random.
Why quartiles can differ from Excel
There is more than one legitimate quartile definition. For 1, 2, 3, 4, 5:
| Method | Q1 | Q3 | Used by |
|---|---|---|---|
| Tukey's hinges | 1.5 | 4.5 | Most textbooks (default here) |
| Linear interpolation, inclusive | 2 | 4 | Excel QUARTILE.INC, Google Sheets |
| Linear interpolation, exclusive | 1.5 | 4.5 | Excel QUARTILE.EXC, Minitab |
All are legitimate. The calculator's Options panel lets you match whichever convention your course uses.
Stem-and-leaf, ogive, violin, and Q-Q plots
Beyond the histogram and box plot, the calculator offers four more chart types:
- Stem-and-leaf plot — preserves every value while showing the distribution shape. The "stem" holds the higher-order digits, the "leaves" the rest.
- Ogive (cumulative frequency curve) — shows the cumulative percentage below each value. Read any percentile directly off the plot.
- Violin plot — a mirror-image density curve, showing the full shape of the distribution rather than just quartiles.
- Q-Q plot — plots observed quantiles against expected normal quantiles. Points close to the diagonal suggest the data are approximately normal; S-shaped deviations indicate skew; heavy tails show as endpoints off the diagonal.
Grouped data — when you only have class intervals
Often raw data are unavailable — you only have a frequency distribution with class intervals. The calculator's Grouped mode accepts class bounds and frequencies and computes all statistics using the class midpoints.
Regression and correlation
When your data are paired (x, y), the calculator can fit a least-squares line and compute correlations:
- Pearson's r — strength and direction of the linear relationship, −1 to +1.
- Spearman's ρ — Pearson's r on ranked data. Measures monotonic (not necessarily linear) association.
- R² — proportion of variance in y explained by x.
- Least-squares line — ŷ = a + b·x, minimising squared vertical residuals.
Common misconceptions
- "The median is halfway between max and min." It is the middle of the sorted values, not the range midpoint. For 1, 1, 1, 1, 100 the median is 1, not 50.
- "The mean and median should be the same." Only in perfectly symmetric distributions.
- "If there are two middle values, add them." You add and divide by two.
- "A data set must have a mode." Many do not.
- "Outliers can be safely removed." Only after investigation.
- "Standard deviation and variance are the same thing." Variance is the squared version; SD is in the original units.
- "The mean of returns is your actual return." No — the compound return is the geometric mean.
- "Correlation implies causation." It does not.
Study guide
- Start with hand calculation. Compute mean, median and mode for {4, 8, 15, 16, 23, 42} and for {1, 1, 2, 5, 6, 6, 9}. Verify against the calculator.
- Build shape intuition. Sketch a histogram of each data set. Notice the mean is pulled toward the tail.
- Learn formulas as definitions. Every formula has a plain-English reading.
- Practice quartiles with both methods. Compare Tukey and Excel conventions on the same data.
- Work through outliers. Compute fences. Verify flagged values.
- Understand sample vs population. Both SDs differ by √((n−1)/n).
- Do a regression by hand. Five pairs is enough. Compute Sxy, Sxx, slope, intercept, r.
- Interpret CIs carefully. "If we repeated the sampling, X% of intervals would contain the true mean."
- Test yourself. Use the example buttons as self-tests — cover results and compute by hand first.
Glossary
- Arithmetic mean
- The sum of all values divided by the count.
- Median
- The middle value of sorted data. For an even count, average the middle pair.
- Mode
- The most frequent value. A data set can have no mode, one mode, or multiple.
- Geometric mean
- nth root of the product of positive values. For growth rates and ratios.
- Harmonic mean
- n divided by sum of reciprocals. For rates with varying denominators.
- Weighted mean
- Each value multiplied by a weight, summed, divided by total weight.
- Variance
- Average of squared deviations from the mean.
- Standard deviation
- Square root of variance. Same units as data.
- Range
- Maximum minus minimum.
- IQR
- Q3 − Q1. Spread of the middle 50%.
- Quartiles
- Values splitting data into four equal parts: Q1, Q2, Q3.
- Percentile
- Value below which a given percentage of data falls.
- Decile
- Every 10th percentile.
- Z-score
- How many SDs from the mean: z = (x − x̄) ÷ s.
- Outlier
- Value far from the rest. Flagged by 1.5 × IQR rule.
- Skewness
- Asymmetry. Positive = right tail longer.
- Kurtosis
- Tail weight vs normal. Excess kurtosis is 0 for normal.
- Coefficient of variation
- SD ÷ mean, as %. Compares spread across scales.
- Standard error
- SD of the sample mean: s ÷ √n.
- Confidence interval
- Range of plausible values for the population mean.
- MAD (mean)
- Average absolute deviation from the mean.
- Median absolute deviation
- Median of |x − median|. Robust spread.
- Trimmed mean
- Mean after dropping top and bottom p%.
- Bimodal
- Two modes. Often sign of two subgroups.
- Multimodal
- Three or more modes.
- Amodal
- No mode — every value unique.
- Stem-and-leaf
- Display preserving every value with stems and leaves.
- Ogive
- Cumulative frequency curve.
- Violin plot
- Mirror-image density showing full distribution shape.
- Q-Q plot
- Observed vs expected normal quantiles. Tests normality.
- Pearson correlation
- Linear association, −1 to +1.
- Spearman correlation
- Monotonic association on ranked data.
- R²
- Proportion of y variance explained by x.
- Least-squares regression
- Line minimising squared residuals.
- Welch's t-test
- Two-sample test of equal means without equal variance assumption.
- Class midpoint
- Average of lower and upper class bounds.
- Bessel's correction
- Dividing by n−1 instead of n in sample variance.
Frequently asked questions
How do you calculate mean, median and mode?
Mean: sum ÷ count. For 4, 8, 15, 16, 23, 42 that's 108 ÷ 6 = 18. Median: sort, take the middle. For an even count, average the middle pair — 15 and 16 give 15.5. Mode: count frequencies. For 1, 1, 2, 5, 6, 6, 9 the modes are 1 and 6.
What is the difference between mean, median and mode?
The mean uses every value and is pulled by extremes. The median is the middle value and is robust to outliers. The mode is the most frequent value and the only average for categorical data.
How do you find the median with an even number of values?
Sort ascending, take the two middle values, average them. For 1, 1, 2, 6, 6, 9: (2 + 6) ÷ 2 = 4.
What if there is no mode?
If every value appears exactly once, there is no mode. That's a valid answer, not an error.
Can there be more than one mode?
Yes. Bimodal = two values tie for highest frequency. Multimodal = three or more tie.
What is the range?
Max − min. For 4, 8, 15, 16, 23, 42: 42 − 4 = 38.
What is the difference between sample and population standard deviation?
Population divides by n (you have all members). Sample divides by n−1 (Bessel's correction). Use sample when your numbers are a subset.
Why do my quartiles differ from Excel?
There is more than one legitimate definition. Tukey's hinges vs Excel's linear interpolation differ. The calculator lets you pick.
What is an outlier and how is it detected?
A value far from the rest. Detected by the 1.5 × IQR rule: values below Q1 − 1.5×IQR or above Q3 + 1.5×IQR are flagged.
When should I use the median instead of the mean?
When data are skewed or contain outliers — incomes, house prices, wait times. In 1, 2, 3, 4, 100 the mean is 22 but the median is 3.
When should I use the geometric mean instead of the arithmetic mean?
For growth rates, ratios, and multiplicative processes. The arithmetic mean systematically overestimates compound growth.
When should I use the harmonic mean?
For rates where the denominator varies — average speed over equal distances, average P/E ratio, average fuel efficiency when measured over equal fuel used.
What is a weighted mean?
Σ(value × weight) ÷ Σ(weight). Use for weighted grades, survey weights, expected value, portfolio returns, index numbers.
What is a z-score?
(x − x̄) ÷ s. How many standard deviations a value is from the mean. |z| ≥ 3 is often used as an outlier threshold.
What is a confidence interval?
x̄ ± t*·(s ÷ √n). A 95% CI means: if we repeated the sampling, 95% of intervals would contain the true mean.
How do I use the frequency table mode?
Enter each distinct value with its count. The calculator expands counts internally, so statistics are exact.
What is grouped data?
Data summarised as class intervals with frequencies. The calculator uses class midpoints.
Does the calculator handle negative numbers and decimals?
Yes. Negative values, decimals and scientific notation like 1.5e-3 are all accepted. Geometric and harmonic means require positive values.
Can I paste data from Excel?
Yes. Tabs and line breaks are treated as separators. You can also upload a CSV file.
What is a trimmed mean?
Remove p% from each end, then average. A 10% trimmed mean on 20 values drops the 2 lowest and 2 highest.
What is skewness?
Asymmetry. Positive means the right tail is longer (mean > median). Negative means the left tail is longer.
What is kurtosis?
Tail weight vs a normal distribution. Excess kurtosis = 0 for normal. Positive = heavier tails.
How does the two-sample comparison work?
Paste a second data set in the Compare tab. The calculator runs Welch's t-test, which tests whether two populations have equal means without assuming equal variances. Reports t, Welch degrees of freedom, and two-sided p-value.
How do I use the regression section?
Enter paired (x, y) values — one pair per line — in the Regression tab. Get the least-squares line, R², Pearson's r, Spearman's ρ, and a scatter plot.
What does R² mean?
The proportion of variance in y explained by x. R² = 0.64 means 64% of the variance in y is explained by the linear relationship with x.
Does correlation imply causation?
No. A strong correlation does not mean one variable causes the other. There could be a lurking variable, reverse causation, or coincidence.
What is the coefficient of variation?
SD ÷ |mean| × 100%. Compares spread across data sets with different units. Only meaningful for ratio data with a true zero.
How do I read a stem-and-leaf plot?
The stem holds higher-order digits (e.g. tens), the leaves hold lower-order digits (units). Stem 3 with leaves 1, 2, 5 represents 31, 32, 35.
What is an ogive?
A cumulative frequency curve. You can read any percentile directly by finding the x-value where the curve reaches that cumulative percentage.
What is a violin plot?
A mirror-image density curve showing the full distribution shape. Wider regions indicate higher density; the median and quartiles are usually overlaid.
What is a Q-Q plot?
Plots observed quantiles against expected normal quantiles. Points on the diagonal indicate normal data; S-shape indicates skew; heavy tails show as endpoints off the diagonal.
Is my data uploaded?
No. Everything runs in your browser using plain JavaScript. Nothing is sent to any server.
How many numbers can I enter?
Up to 50,000 individual values, or 100,000 total frequency in frequency mode. Charts render a capped preview for large data sets.
Related calculators
Sources & methodology
- NIST — Measures of Skewness and Kurtosis: adjusted Fisher–Pearson skewness and Fisher's excess kurtosis.
- NIST — Quartiles: Tukey hinge definition.
- NIST — Box Plot: the 1.5 × IQR outlier fence.
- OpenStax — Measures of the Center: standard treatment of mean, median, mode, weighted mean.
- OpenStax — Measures of the Spread: variance and standard deviation conventions.
- NIST — Detection of Outliers: IQR, z-score, and modified z-score.
- NIST — Confidence Intervals: t-interval derivation.
- Microsoft — QUARTILE.INC and QUARTILE.EXC: interpolation methods.
- Geometric mean and Harmonic mean: definitions and AM-GM-HM inequality.
- Welch's t-test: two-sample test without equal-variance assumption.
- Spearman's rank correlation.
- Stem-and-leaf display.
- Q-Q plot: normality assessment.