Statistics Basics: Mean, Median, Mode and Standard Deviation
Statistics is the science of learning from data — and its core ideas are simpler than they look. This guide explains mean, median, mode and standard deviation using one dataset of 12 commute times, worked from start to finish: the mean is 44.92 minutes, the median 43.50, the mode 35, and the sample standard deviation 10.18. Along the way it covers quartiles, percentiles, z-scores and what a 95% confidence interval really means.
Free calculator
Try the free Statistics Calculator →
Compute mean, median, mode, standard deviation, quartiles and percentiles for any dataset — with every step shown.
Calculate my statistics freeWhat Is Statistics, in Plain English?
Statistics is the science of learning from data. Every time you look at a set of numbers — test scores, commute times, monthly sales — and ask "what is typical here, and how much do the numbers vary?", you are doing statistics. The field splits into two halves. Descriptive statistics summarises the data you have: the average, the spread, the highest and lowest values. Inferential statistics goes further and uses a sample to say something about a larger group you did not measure, with a stated margin of uncertainty.
This guide works through both halves using one dataset from start to finish, so every number ties together: the commute times, in minutes, of 12 coworkers. Here they are, sorted from shortest to longest:
| Dataset | Values (minutes) |
|---|---|
| Commute times (n = 12) | 32, 35, 35, 38, 41, 42, 45, 47, 49, 52, 55, 68 |
Twelve numbers, one repeated value (35), and one long commute (68) that stands out from the rest. That is enough to demonstrate every idea in this guide — the three averages, the spread, quartiles and percentiles, z-scores, and a confidence interval — with real numbers you can check yourself. If you want to run your own numbers as you read, the Statistics Calculator computes all of these at once.
The Three Averages: Mean, Median and Mode
"Average" is not one number — it is three different ideas, and they answer three different questions. The mean is what most people mean by average: add everything up and divide by how many values there are. The median is the middle value when the data is sorted. The mode is the value that appears most often.
For the commute data, the mean is the total, 539 minutes, divided by 12, which gives 44.92 minutes. The median is the middle of the sorted list: with 12 values there is no single middle one, so you average the 6th and 7th values, 42 and 45, giving 43.50 minutes. The mode is 35 minutes, the only value that appears twice.
| Average | What it measures | Commute data |
|---|---|---|
| Mean | The balance point of all the values | 44.92 |
| Median | The middle value — half above, half below | 43.50 |
| Mode | The most common value | 35 |
Which one should you use? It depends on the shape of the data. The mean uses every value, so it is the most informative summary when the data is roughly symmetric — but it is pulled toward extreme values. The median ignores the extremes and reports the middle, so it is the better "typical value" when the data is skewed, which is why house prices and incomes are usually reported as medians. The mode is the only average that works for categories (the most common shoe size, the most popular commute method) and is useful when you want to know what is most frequent rather than what is central.
The commute data shows the difference in miniature. The mean (44.92) is higher than the median (43.50) because the single 68-minute commute drags the mean upward. Remove that one value and the mean falls to 42.82 while the median falls only to 42 — the mean moved by 2.10 minutes, the median by 1.50. Neither number is wrong; they describe different things. When the mean and median disagree by a lot, the data is skewed, and the median is usually the safer headline number. The Mean, Median, Mode Calculator shows all three side by side for any dataset you enter.
Spread: Range, Variance and Standard Deviation
An average alone hides how spread out the numbers are. Two teams can both average a 45-minute commute while one team's times cluster between 40 and 50 minutes and the other's range from 20 to 70. Spread is the second half of the story, and it comes in three levels of usefulness.
The range is the simplest: highest minus lowest. Here it is 68 − 32 = 36 minutes. It is quick, but it depends on just two values, so a single extreme number can make it misleading. The variance fixes that by using every value: it is the average of the squared distances from the mean. Squaring is necessary because plain distances cancel out — the values below the mean exactly balance the values above it, so their average distance is always zero. Squaring makes every distance positive before averaging.
For the commute data, the sample variance is 103.72. But variance is measured in squared minutes, which nobody can picture, so the final step is to take the square root. That gives the standard deviation, the most useful single measure of spread: the sample standard deviation is 10.18 minutes. Roughly speaking, a typical commute in this group sits about 10 minutes away from the mean of 44.92. The Variance Calculator and the Standard Deviation Calculator both show the full working, value by value, if you want to follow the arithmetic.
Standard deviation also tells you how the values are distributed. For roughly bell-shaped data, about 68% of values fall within one standard deviation of the mean, about 95% within two, and about 99.7% within three — the 68-95-99.7 rule. Check it against the commute data: one standard deviation either side of the mean is 34.73 to 55.10 minutes, and 10 of the 12 values (83.3%) fall inside that band. That is higher than 68%, which is normal for a small dataset — the rule describes the pattern for large, bell-shaped samples, not a promise about any 12 numbers.
Sample vs Population: Which Standard Deviation?
You will have noticed two versions of the variance and standard deviation above: the sample figures (103.72 and 10.18) and the population figures (95.08 and 9.75). The difference is the divisor. The population variance divides by n, the number of values. The sample variance divides by n − 1. The reason is subtle but important: when you only have a sample, the sample mean is itself estimated from the data, and the values cluster a little too tightly around it. Dividing by n − 1 corrects that bias — this adjustment is called Bessel's correction — and it makes the sample variance an unbiased estimate of the population's true variance.
The practical rule is simple. Use the population version when your data is the entire group you care about. If these 12 coworkers are the whole team and you only want to describe them, the population standard deviation of 9.75 is the right number. Use the sample version when your data is a sample from a larger group — for example, these 12 are a sample of the company's 200 employees, and you want to estimate the spread across the whole company. Then the sample standard deviation of 10.18 is the right number, and it is the one the Statistics Calculator reports first.
In practice, the sample version is the default in most software and in most real work, because most data is a sample of something larger. The two figures are close here — 10.18 versus 9.75 — and the gap shrinks as the dataset grows. With 100 values the difference between dividing by 100 and by 99 is tiny. But with small samples it matters, so always know which one you are looking at, and label it.
Quartiles, Percentiles and the IQR
Quartiles and percentiles answer a different question from the mean and standard deviation: where does a value sit in the pecking order? Quartiles split the sorted data into four equal parts. The first quartile (Q1) is the value a quarter of the way up; the third quartile (Q3) is three quarters of the way up; the second quartile is the median.
This guide uses the Tukey hinges convention: Q1 is the median of the lower half of the data, Q3 the median of the upper half. The lower half is 32, 35, 35, 38, 41, 42, whose median is (35 + 38) / 2 = 36.50. The upper half is 45, 47, 49, 52, 55, 68, whose median is (49 + 52) / 2 = 50.50. The gap between them, Q3 − Q1 = 14.00 minutes, is the interquartile range (IQR) — the spread of the middle half of the data, and a robust measure because the extremes cannot move it.
Percentiles generalise the same idea to hundredths. The 90th percentile is the value below which 90% of the data falls. This guide uses linear interpolation: rank = p/100 × (n − 1), then interpolate between the two nearest values. For the commute data that gives P10 = 35.00, P25 = 37.25, P50 = 43.50 (the median, as it must be), P75 = 49.75, P90 = 54.70 and P95 = 60.85. The Percentile Calculator and the Quartile Calculator both state the convention they use, which matters — as the next paragraph shows.
| Measure | Convention | Value |
|---|---|---|
| Q1 (first quartile) | Tukey hinges | 36.50 |
| P25 (25th percentile) | Linear interpolation | 37.25 |
| Median / P50 | Both agree | 43.50 |
| Q3 (third quartile) | Tukey hinges | 50.50 |
| P75 (75th percentile) | Linear interpolation | 49.75 |
| P90 (90th percentile) | Linear interpolation | 54.70 |
Notice that P25 (37.25) is not the same as Q1 (36.50), even though both describe "a quarter of the way up". That is not an error — it is two different conventions for slicing the same data. Different software and textbooks use different quartile methods, and they can disagree by a value or two on small datasets. The lesson is to always state the convention, as this guide does, and to check which one a tool uses before comparing its output with another source.
The IQR also gives a standard rule for spotting outliers: a value is flagged if it lies more than 1.5 × IQR beyond the quartiles. Here the fences are 36.50 − 21 = 15.50 and 50.50 + 21 = 71.50. The longest commute, 68 minutes, sits inside the upper fence, so by this rule it is not an outlier at all — it is just the longest value in a fairly spread-out dataset. That is a useful corrective: a value can look extreme and still be perfectly ordinary for the data it belongs to. The five-number summary — minimum 32, Q1 36.50, median 43.50, Q3 50.50, maximum 68 — is the compact way to report all of this, and it is exactly what a box plot draws.
Z-Scores: How Unusual Is One Value?
A z-score answers the question "how unusual is this one value, in standard deviations?" The formula is z = (value − mean) / standard deviation, using the sample standard deviation of 10.18. A z-score of 0 means the value equals the mean; +1 means one standard deviation above it; −2 means two below it.
For the commute data, the 68-minute commute has a z-score of (68 − 44.92) / 10.18 = 2.27 — more than two standard deviations above the mean, genuinely unusual. The shortest commute, 32 minutes, scores −1.27. A 55-minute commute scores 0.99, almost exactly one standard deviation above the mean. And 42 minutes scores −0.29, barely below average. The Z-Score Calculator computes this for any value, mean and standard deviation.
Z-scores are powerful because they put different datasets on the same scale.
Worked Example: The Same Score, Two Z-Scores
Suppose you score 85 on two different tests. On the first, the class mean is 70 with a standard deviation of 10, so your z-score is (85 − 70) / 10 = 1.50. On the second, the mean is 80 with a standard deviation of 5, so your z-score is (85 − 80) / 5 = 1.00. Same raw score, but the first result is the stronger one — you beat your classmates by more. Without z-scores, comparing scores from different tests is guesswork; with them, it is arithmetic. Z-scores are also the bridge to probability: the chance of a value falling beyond a given z-score comes from the normal distribution, which is why z-scores and the probability ideas in our probability guide belong together. To work out a probability directly — a single event, a union, or an at-least-one chance — use a probability calculator.
Confidence Intervals: What 95% Really Means
Everything so far describes the 12 commutes themselves. But suppose these 12 coworkers are a sample, and you want to estimate the average commute of all 200 employees. The sample mean of 44.92 is your best single guess — but how far off might it be? A confidence interval answers that by giving a range with a stated level of confidence.
The calculation has three steps. First, the standard error: the sample standard deviation divided by the square root of n, which is 10.18 / √12 = 2.94 minutes. The standard error measures how much the sample mean would wobble if you took a different sample of 12. Second, multiply by the z-value for the confidence level: 1.96 for 95%. Third, add and subtract from the mean: 44.92 ± 1.96 × 2.94, which gives a 95% confidence interval of 39.15 to 50.68 minutes. The Confidence Interval Calculator runs the same calculation for any mean, standard deviation and sample size.
Now the part most people get wrong. A 95% confidence interval does not mean "there is a 95% chance the true mean is between 39.15 and 50.68". The true mean is a fixed number — it is either in the interval or it is not, and no probability attaches to it. What 95% describes is the procedure: if you repeated this sampling process many times, about 95% of the intervals you built would contain the true mean. It is a statement about the reliability of the method, not about this particular interval. That distinction is the single most misunderstood idea in introductory statistics, and it is worth getting right.
Two things change the width of the interval. A bigger sample narrows it — the standard error shrinks as √n grows, which is why large surveys are more precise. A higher confidence level widens it — a 99% interval uses a z-value of 2.58 instead of 1.96, so it must stretch further to be more sure. One caution: this calculation uses the normal approximation (z = 1.96), which is fine for larger samples but slightly optimistic for n = 12; a strict small-sample calculation uses the t-distribution instead and gives a slightly wider interval. The interval above is the standard textbook version, and it is the one most calculators report.
The Full Picture: Every Statistic at a Glance
Here is everything this guide computed from the same 12 numbers, in one place. If you can read this table and explain each row, you understand the core of descriptive statistics.
| Statistic | Value |
|---|---|
| Count (n) | 12 |
| Sum | 539 |
| Mean | 44.92 |
| Median | 43.50 |
| Mode | 35 |
| Range | 36 |
| Sample variance (n − 1) | 103.72 |
| Sample standard deviation | 10.18 |
| Population standard deviation | 9.75 |
| Q1 (Tukey) / Q3 (Tukey) | 36.50 / 50.50 |
| IQR | 14.00 |
| P90 | 54.70 |
| z-score of the longest commute (68) | 2.27 |
| 95% confidence interval for the mean | 39.15 to 50.68 |
Common Mistakes in Basic Statistics
Reporting the mean for skewed data. If a few extreme values pull the mean away from the bulk of the data, the median describes the typical case better. Always look at both, and report the median when they disagree by much.
Confusing standard deviation with standard error. The standard deviation (10.18 here) describes the spread of the individual values. The standard error (2.94) describes the precision of the mean as an estimate. They answer different questions, and swapping them is one of the most common errors in published charts.
Reading a confidence interval as a probability about the true value. As the section above explains, 95% describes the procedure, not this interval. Say "we are 95% confident the interval captures the true mean" — the careful wording exists for a reason.
Mixing sample and population formulas. The sample and population standard deviations differ (10.18 vs 9.75), and the difference matters most for small datasets. Know which one your tool reports and which one your question needs.
Treating a single statistic as the whole story. A mean without a spread, a percentage without a sample size, a difference without a confidence interval — each one hides as much as it reveals. The habit that separates careful readers of data from careless ones is simple: always ask for the spread, the sample size, and the uncertainty alongside the headline number.
Sources: all figures in this guide were recomputed in Python from the dataset stated in the text (n = 12; sum 539). Conventions: percentile by linear interpolation, rank = p/100 × (n − 1); quartiles by Tukey hinges; variance and standard deviation labelled sample (n − 1) vs population (n); z = 1.96 for the 95% confidence interval. Last reviewed: 15 November 2026.
Frequently Asked Questions
What is the difference between mean, median and mode?
The mean is the total divided by the count, the median is the middle value when the data is sorted, and the mode is the most common value. For the commute data in this guide they are 44.92, 43.50 and 35 minutes. They agree when data is symmetric and diverge when it is skewed.
When should I use the median instead of the mean?
Use the median when the data is skewed or has extreme values, because the mean gets pulled toward the extremes. In this guide, one 68-minute commute lifts the mean to 44.92 while the median stays at 43.50. Incomes and house prices are usually reported as medians for exactly this reason.
What does standard deviation actually tell you?
It tells you the typical distance of a value from the mean, in the original units. For the commute data the sample standard deviation is 10.18 minutes, so a typical commute sits about 10 minutes away from the mean of 44.92. A small standard deviation means the values cluster tightly; a large one means they are spread out.
Should I use sample or population standard deviation?
Use the population version (divide by n) when your data is the entire group you care about, and the sample version (divide by n minus 1) when it is a sample from a larger group. For the commute data the two are 9.75 and 10.18. Most real work uses the sample version, because most data is a sample.
What is the difference between a quartile and a percentile?
Quartiles split the data into four equal parts and percentiles into a hundred, but the numbers can differ because different conventions are used. In this guide Q1 is 36.50 by Tukey hinges while P25 is 37.25 by linear interpolation. Always state the convention, and check which one a tool uses before comparing results.
What does a 95% confidence interval really mean?
It means the procedure is reliable 95% of the time: if you repeated the sampling many times, about 95% of the intervals you built would contain the true mean. It does not mean there is a 95% chance the true mean is inside this particular interval. For the commute data the 95% interval for the mean is 39.15 to 50.68 minutes.
Last updated: