Example 1
- 1, 5, 3, 4, 2
3
What is the median of 1, 5, 3, 4, 2? 3.
Enter five numbers in separate fields. After sorting ascending, the result is the middle value — the third order statistic. 1, 5, 3, 4, 2 give 3. 10, 10, 10, 10, 10 give 10. 1, 2, 3, 4, 100 give 3, while the mean of that five is 22. The form always has five fields — it does not average two middles for even n.
Enter five numbers, for example 1, 5, 3, 4, and 2.
Exactly five fields a–e, not a list. After sorting the result is the third value. A mean comparison appears in the result panel.
The median of five numbers is the middle value after ascending order. For an odd sample size n = 5 the median is unique: it is the third order statistic x₍₃₎. The calculator collects five fields a–e, sorts them, and returns the element at index 2 (zero-based). For 1, 5, 3, 4, 2 the sorted list is 1, 2, 3, 4, 5, so the median is 3.
In descriptive statistics the median is a classic location measure that is robust to outliers. For the same five values 1, 2, 3, 4, 100 the arithmetic mean is 22 while the median stays 3: one hundred is the largest observation but does not move the middle of the ordered list. That contrast with the mean is standard in textbooks (including Tukey, Exploratory Data Analysis) and in NIST/SEMATECH e-Handbook notes on location.
The calculator uses the numbers you enter in five separate fields — not a list in one box. The neighboring list-median calculator accepts any length and, for even n, averages the two central values. Here n is always 5 and there is one middle. Field order does not change the result: 5, 1, 4, 2, 3 also give 3. Five equal 10s give 10. Decimals 2.5 and 2,5 are equivalent.
The result panel shows the median as the primary result plus the sorted list, the arithmetic mean of the same five, minimum, maximum, range, and sum — so you can compare median robustness with the mean on the same data. The number line marks the entered points and highlights the middle value.
Mathematical model: sample median for odd n as the middle order statistic. Sources: Wikipedia — Median; NIST e-Handbook — Measures of Location; MathWorld — Statistical Median; classic EDA texts (Tukey).
median = sort([a, b, c, d, e])[2] = x₍₃₎ for n = 5.
After ascending order x₍₁₎ ≤ x₍₂₎ ≤ x₍₃₎ ≤ x₍₄₎ ≤ x₍₅₎ the middle value is x₍₃₎. Index [2] uses zero-based numbering.
Comparison: mean = (a+b+c+d+e) / 5 — the panel shows it beside the median, but the primary result is the median.
Mathematical model: sample median for odd n as the middle order statistic (NIST Measures of Location; Tukey EDA; Wikipedia — Median).
For a finite sample of real numbers x₁, …, xₙ with odd n, the sample median is the middle value after ordering: if x₍₁₎ ≤ x₍₂₎ ≤ … ≤ x₍ₙ₎ are the order statistics, the median equals x₍₍ₙ₊₁₎/₂₎. For n = 5 that is x₍₃₎ — the third element of the ascending list. This calculator always uses exactly five fields a, b, c, d, e: it collects the values, sorts them ascending, and returns the element at index 2 (zero-based), matching the page script and the historical the page formula path.
The median is a measure of location (central tendency). Unlike the arithmetic mean it does not sum observations: it depends only on rank order. For the same five values 1, 2, 3, 4, 100 the median is 3 while the mean is 22. For odd n the definition is unique; for even n the usual convention averages the two central values — this form has no such path because n is always 5.
In the literature the median is the empirical 50th percentile (second quartile Q₂). NIST/SEMATECH e-Handbook lists the median beside the mean among location measures; MathWorld (Statistical Median) and Wikipedia (Median) give the same sort-based construction. Tukey’s Exploratory Data Analysis treats the median as the basic center description in exploratory work precisely because it resists outliers.
The idea of a middle value after ordering is older than the modern phrase “order statistics.” In the nineteenth century Francis Galton popularized percentiles and rank-based summaries; the median as the 50th percentile entered descriptive statistics alongside Quetelet’s mean. In the twentieth century the theory of order statistics (David & Nagaraja, Order Statistics) systematized the distributions of x₍ₖ₎, and the median became a standard location estimator with a high breakdown point.
John W. Tukey’s EDA (1977) made the median and the box-and-whisker plot everyday tools: the box center is the median, and the whiskers describe spread without assuming normality. In robust statistics the median is the canonical example of an estimator with a 50% breakdown point: more than half the observations must be corrupted before the result can be driven arbitrarily far — unlike the mean, which a single infinite value destroys.
Conceptually this calculator does not compute quartiles Q₁/Q₃, the interquartile range IQR, MAD (median absolute deviation), or variance. It also does not accept a variable-length list. An open list belongs on the neighboring median calculator; the mean belongs on the arithmetic-mean calculator. Here the goal is precise and didactic: five fields, one middle, an explicit mean comparison on the same numbers.
Input: five finite real numbers (a, b, c, d, e). Output: median m = x₍₃₎ after sorting. Always x₍₁₎ ≤ m ≤ x₍₅₎. If all values are equal, m equals that common value. Under a shift, m(xᵢ + c) = m(xᵢ) + c; under positive scaling λ > 0, m(λx) = λ m(x).
Robustness: changing one or two extreme observations (at n = 5) cannot move the median outside the interval fixed by the remaining three — the finite-sample breakdown fraction is floor((n−1)/2)/n = 2/5, and asymptotically the median reaches 50%. The arithmetic mean has breakdown 0. L¹ estimation: the median minimizes the sum of absolute deviations Σ|xᵢ − t| in t (for odd n the minimizer is x₍₃₎).
Field order does not affect the result because sorting is total. Zeros and negatives are allowed. Duplicates are allowed: for 2.5, 2.5, 7, 2.5, 9 the sorted list is 2.5, 2.5, 2.5, 7, 9, so the median is 2.5.
Step 1. Read five fields and parse them as real numbers (comma and period decimals are equivalent). An empty field blocks the result — the form requires a full set of five.
Step 2. Build L = [a, b, c, d, e] and sort ascending: L′ = sort(L) with numeric comparison (x − y), not lexicographic.
Step 3. Median m := L′[2] (zero-based) = x₍₃₎. That is the only primary result of this calculator.
Step 4 (expanded panel). Mean μ = (a+b+c+d+e)/5; min = L′[0]; max = L′[4]; range R = max − min; sum S = 5μ. These quantities do not replace the median — they support comparison and checking.
Correctness: a finite totally ordered chain of odd length always has a unique middle element. The browser sorts floating-point numbers; for typical school and engineering inputs the result matches hand calculation.
Worked path: 1, 5, 3, 4, 2 → L′ = [1, 2, 3, 4, 5] → m = 3. Robustness path: 1, 2, 3, 4, 100 → L′ = [1, 2, 3, 4, 100] → m = 3, μ = 22.
All equal (10, 10, 10, 10, 10): median 10, range 0, mean 10. One outlier (1, 2, 3, 4, 100): median 3, mean 22. Permuted order (5, 1, 4, 2, 3): still 3. Fractions (−2, 0, 4, 1.5, 8): sorted −2, 0, 1.5, 4, 8, median 1.5. Middle ties (2.5, 2.5, 7, 2.5, 9): median 2.5.
This calculator does not handle n ≠ 5. It does not average two central values. It does not drop outliers by a filter — the median resists extremes by rank construction. Invalid text in a field yields a parse error message.
Sorting five numbers is exact for finite floating-point arithmetic values in the range users typically enter. Avoid mixing thousands separators with a decimal comma in one token. Integer results format without trailing zeros; fractions keep needed precision.
The number-line diagram is an illustration, not a separate mathematical model. When all values are equal the axis expands visually so points remain readable, while the numeric median stays the common value.
Related: arithmetic mean (sensitive to extremes), variable-length list median (even n), min/max and range (extreme order statistics), quartiles and IQR, MAD. In robust estimation the median is the starting point for Huber M-estimators and trimmed means.
Sources NIST/SEMATECH e-Handbook of Statistical Methods — Measures of Location; Wikipedia — Median / Order statistic; MathWorld — Statistical Median; John W. Tukey, Exploratory Data Analysis (Addison-Wesley, 1977); H. A. David & H. N. Nagaraja, Order Statistics (Wiley). Educational tool only — not a substitute for full statistical analysis.
For 1, 5, 3, 4, 2 the median is 3. For 1, 2, 3, 4, 100 the median is also 3 while the mean is 22.
3
What is the median of 1, 5, 3, 4, 2? 3.
10
What is the median of five 10s? 10.
3
What is the median of 1, 2, 3, 4, 100? 3 (mean 22).
3
What is the median of 5, 1, 4, 2, 3? 3.
1.5
What is the median of −2, 0, 4, 1.5, 8? 1.5.
2.5
What is the median of 2.5, 2.5, 7, 2.5, 9? 2.5.
It sorts the five field values ascending and returns the third (middle) — the order statistic x₍₃₎. For 1, 5, 3, 4, and 2 the sorted list is 1, 2, 3, 4, 5, so the median is 3.
No. There are exactly five separate fields a–e. A variable-length list and averaging two middles for even n live on the list-median calculator.
The mean sums all values and divides by 5, so an outlier moves it. The median depends on the middle after sorting. For 1, 2, 3, 4, 100 the mean is 22 and the median is 3.
No. The calculator sorts anyway. 5, 1, 4, 2, 3 give the same median 3 as 1, 5, 3, 4, 2.
The median equals that shared value. Five 10s give 10. The range is then 0.
Yes, when the middle value after sorting is not an integer. Example: −2, 0, 4, 1.5, 8 give median 1.5.
This form always has five entries, so there is one middle. Averaging two central values is on the list-median page.
Yes. 2.5 and 2,5 are the same number. A comma and a period in the fields are equivalent.
All five. An empty field blocks the result — the calculator does not complete a partial set.
On the arithmetic mean calculator. Here the result panel still shows the mean beside the median for an easy comparison.
Sort the five values ascending and take the third. For 1, 5, 3, 4, 2 the sorted list is 1, 2, 3, 4, 5, so the median is 3.
3. The outlier 100 does not move the middle after sorting; the mean of that five is 22. That is Example 3 on this page.
9. After sorting, the third value is 9 — a classic five-element school example.
No. Here there are exactly five separate fields. Variable-length lists and averaging two middles for even n belong on the list-median calculator.
No. All five fields must be filled. An empty field blocks the result — the calculator does not substitute zero.
Median and order-statistic definitions below come from established sources.
Page Updated November 2, 2026.