Mean, Median and Mode Calculator
Mean, median, mode, range, quartiles and outliers for a list of numbers, with every step and the quartile method shown.
Results
Mean
31.6
Sum 474 ÷ 15 values
- Median
- 30sorted value 8 of 15
- Mode
- 31appears 3 times
- Range
- 26from 26 to 52
- First quartile (Q1)
- 28.5lower fence 23.25
- Third quartile (Q3)
- 32upper fence 37.25
- Interquartile range (IQR)
- 3.5Q3 − Q1: the middle half
Note: Quartile method
Q1 and Q3 use linear interpolation, like Excel's QUARTILE.INC and R's default quantile(). A TI-84 (median of halves) gives Q1 = 28 and Q3 = 33. All four methods are compared in the table below.
Note: Outliers and the center
1 possible outlier: 52 above the upper fence (37.25). The median would stay the same if it were even more extreme; the mean would not. The mean (31.6) is 1.6 above the median (30).
Box: Q1 to Q3, with a line at the median. Diamond: mean. Whiskers: lowest and highest values inside the fences. Circles: possible outliers. Dashed lines: fences.
Chart data: Box plot
| Statistic | Value |
|---|---|
| Minimum | 26 |
| Lower whisker end | 26 |
| Q1 | 28.5 |
| Median | 30 |
| Mean | 31.6 |
| Q3 | 32 |
| Upper whisker end | 35 |
| Maximum | 52 |
| Lower fence | 23.25 |
| Upper fence | 37.25 |
| Possible outliers | 52 |
| Method | Q1 | Q3 | IQR | How Q1 and Q3 are found |
|---|---|---|---|---|
| QUARTILE.INC | 28.5 | 32 | 3.5 | Position (n − 1) × p + 1, interpolated (selected) |
| TI-84 halves | 28 | 33 | 5 | Medians of the halves, median left out |
| Tukey hinges | 28.5 | 32 | 3.5 | Medians of the halves, median included |
| QUARTILE.EXC | 28 | 33 | 5 | Position (n + 1) × p, interpolated |
How this was calculated
- Sorted (15 values): 26, 27, 28, 28, 29, 29, 30, 30, 31, 31, 31, 33, 34, 35, 52
- Mean = sum ÷ n = 474 ÷ 15 = 31.6
- Median: n = 15 is odd, so the median is sorted value (15 + 1) ÷ 2 = 8: 30
- Mode: 31 appears 3 times; no other value appears more than 2 times.
- Range = max − min = 52 − 26 = 26
- Q1 position = (n − 1) × 0.25 + 1 = (15 − 1) × 0.25 + 1 = 4.5, between sorted values 4 and 5: Q1 = 28 + 0.5 × (29 − 28) = 28.5
- Q3 position = (n − 1) × 0.75 + 1 = (15 − 1) × 0.75 + 1 = 11.5, between sorted values 11 and 12: Q3 = 31 + 0.5 × (33 − 31) = 32
- Interquartile range: The third quartile minus the first quartile: the spread of the middle half of the data. Values more than 1.5 × IQR below the first quartile or above the third are flagged as possible outliers. Source: OpenStax, Introductory Statistics 2e = Q3 − Q1 = 32 − 28.5 = 3.5
- Fences: Q1 − 1.5 × IQR = 28.5 − 1.5 × 3.5 = 23.25, and Q3 + 1.5 × IQR = 32 + 1.5 × 3.5 = 37.25
- Possible outliers: 52 (above 37.25)
- In Excel with the data in A1:A15: =AVERAGE(A1:A15), =MEDIAN(A1:A15), =MODE.MULT(A1:A15), =QUARTILE.INC(A1:A15,1) and =QUARTILE.INC(A1:A15,3).
| Value | Count | Percent | Cumulative count | Cumulative percent |
|---|---|---|---|---|
| 26 | 1 | 6.67% | 1 | 6.67% |
| 27 | 1 | 6.67% | 2 | 13.33% |
| 28 | 2 | 13.33% | 4 | 26.67% |
| 29 | 2 | 13.33% | 6 | 40% |
| 30 | 2 | 13.33% | 8 | 53.33% |
| 31 (mode) | 3 | 20% | 11 | 73.33% |
| 33 | 1 | 6.67% | 12 | 80% |
| 34 | 1 | 6.67% | 13 | 86.67% |
| 35 | 1 | 6.67% | 14 | 93.33% |
| 52 | 1 | 6.67% | 15 | 100% |
| Position | Value | Note |
|---|---|---|
| 1 | 26 | Minimum |
| 2 | 27 | |
| 3 | 28 | |
| 4 | 28 | |
| 5 | 29 | |
| 6 | 29 | |
| 7 | 30 | |
| 8 | 30 | Median |
| 9 | 31 | |
| 10 | 31 | |
| 11 | 31 | |
| 12 | 33 |
Assumptions
- Quartiles by linear interpolation, like Excel's QUARTILE.INC and R's default quantile(). The fences, whiskers and outliers follow from these Q1 and Q3, so they can change with the method.
- Possible outliers are values more than 1.5 × IQR below Q1 or above Q3. The rule marks values worth checking; it doesn't say they are mistakes.
- The mode is the most frequent value. When every value appears equally often, including when every value appears once, there is no mode.
- Each item counts once, exactly as typed. A frequency table can be entered as a value and its count on each line; grouped class intervals, such as 10–19, aren't supported.
- Sample or population makes no difference to these statistics. It matters only for the variance and standard deviation.
- Results are shown to at most 4 decimal places; the calculation keeps full precision.
Calculated in your browser. This site doesn't send the numbers you enter anywhere. “Continue in” links pass them to the next calculator within this browser tab only.
What this calculator answers
For a list of numbers, it finds the center (mean, median and mode), the spread (range, quartiles and interquartile range) and any values that sit unusually far from the rest. Paste test scores, prices, times or measurements and each answer comes with the steps, a box plot and tables you can download. Calculators disagree about quartiles, so this one names the method it used and shows what the other common methods give for the same data.
How to use it
- Data: type or paste your numbers. Commas, spaces, tabs and new lines all separate values, so a column copied from a spreadsheet works as it is. A number with a thousands comma, such as
1,200, counts as one number when every comma in the data sits between groups of three digits and there is more than one entry (a column of1,200,950and2,300, or1,200 950on one line). If any entry uses commas between values (as in85,90,100), every comma separates values, so1,200beside it is read as 1 and 200, and so is1,200typed on its own.0,100,0is 0, 100 and 0. The line under the box says how many numbers were read, and when it read commas as thousands separators. Up to 10,000 values. - Frequency tables: type a value and its count on each line (
7 6means 7 appears 6 times) or paste the two columns. A Read each line as a value and its count box appears under the data; tick it. The line under the box then gives the total count and how the first line was read, so you can see that the columns weren’t swapped. - Items that aren’t numbers: a heading,
N/Aor a typo is named by its position, for example “Item 3 in data, “x9”, isn’t a number.” Correct it, or tick Skip items that aren’t numbers to leave it out; skipped items are listed above the results. - Quartile method: pick the rule your course, calculator or software uses (see below). The mean, median and mode don’t depend on it.
The Try buttons load the cases worked through below: an even number of values, two modes, no mode, a frequency table and the TI-84 quartile rule. To compare two data sets, press Save for comparison, enter the second set and save again. A share link carries the data only while it is short (about 4,000 characters); for a longer list, copy the data itself.
How to find the mean, median and mode
- is the mean: the sum of the values, , divided by how many there are, .
- is the th value after sorting from smallest to largest. The median, , is the middle value, or the mean of the two middle values when is even.
- The mode is the value that appears most often. There can be more than one.
- The range is the largest value minus the smallest.
This page counts every value once. If some values should count more than others, such as grades weighted by credit hours, use a weighted average calculator instead.
Worked example: 15 days of commute times
These are one-way commute times in minutes for 15 workdays, in the order they happened: 28, 31, 26, 35, 29, 31, 27, 52, 30, 31, 29, 33, 28, 30, 34.
- Sort them: 26, 27, 28, 28, 29, 29, 30, 30, 31, 31, 31, 33, 34, 35, 52.
- Mean: the sum is 474, so the mean is 474 ÷ 15 = 31.6 minutes.
- Median: n = 15 is odd, so the median is sorted value (15 + 1) ÷ 2 = 8: 30 minutes.
- Mode: 31 appears 3 times, more than any other value: 31 minutes.
- Range: 52 − 26 = 26 minutes.
- Quartiles by linear interpolation: Q1 is at position (15 − 1) × 0.25 + 1 = 4.5, halfway between the 4th and 5th sorted values, so Q1 = 28 + 0.5 × (29 − 28) = 28.5. Q3 is at position 11.5, so Q3 = 31 + 0.5 × (33 − 31) = 32. The interquartile range is 32 − 28.5 = 3.5 minutes.
- Fences: 28.5 − 1.5 × 3.5 = 23.25 and 32 + 1.5 × 3.5 = 37.25. Only 52 lies outside them, so it is the one possible outlier.
The slow 52-minute day pulls the mean 1.6 minutes above the median. Leave it out and the mean of the other 14 days drops to 30.1429 minutes, while the median stays at 30.
How to find the median with an even number of values
With an even count there is no single middle value, so the median is the mean of the two middle ones. Take 14, 21, 16, 11, 18, 16, 12, 15 (the Even count button). Sorted, they are 11, 12, 14, 15, 16, 16, 18, 21. The middle pair is the 4th and 5th values, 15 and 16, so the median is (15 + 16) ÷ 2 = 15.5, a number that isn’t in the list. The mean is 123 ÷ 8 = 15.375.
What if there’s no mode or more than one mode?
- More than one mode: in 9, 7, 8, 9, 10, 8, 11, 9, 8, 12 (the Two modes button), 8 and 9 each appear 3 times and nothing appears more often, so both are modes. Data with two modes are called bimodal.
- No mode: in 4.2, 3.8, 5.1, 4.7, 3.9, 4.4 (the No mode button), every value appears once, so no value is more common than another. The same applies when every value appears equally often, as in 1, 1, 2, 2. Some calculators list every value as a mode in these cases; this calculator says “No mode” and shows each count in the frequency table, so you can follow either convention.
- All values equal: 5, 5, 5, 5 has one mode, 5.
How to find the mean, median and mode from a frequency table
A frequency table lists each value once with how many times it occurs. The Frequency table button loads this one: quiz scores out of 10 for a class of 25 students.
| Score | Students | Cumulative count |
|---|---|---|
| 5 | 2 | 2 |
| 6 | 3 | 5 |
| 7 | 6 | 11 |
| 8 | 7 | 18 |
| 9 | 5 | 23 |
| 10 | 2 | 25 |
- Count: n is the sum of the counts, 2 + 3 + 6 + 7 + 5 + 2 = 25 students.
- Mean: multiply each score by its count and add, 5 × 2 + 6 × 3 + 7 × 6 + 8 × 7 + 9 × 5 + 10 × 2 = 191, then divide by n: 191 ÷ 25 = 7.64.
- Median: with 25 values it is the 13th. The cumulative counts reach 11 at a score of 7 and 18 at 8, so values 12 to 18 are all 8 and the median is 8.
- Mode: 8, the score with the highest count (7 students).
- Quartiles: every method gives Q1 = 7 and Q3 = 9 here, so the IQR is 2 and the fences at 4 and 12 flag no score.
The results for a table are the same as for the list with each score typed out as many times as it occurs; the steps just start from the counts.
Quartiles, IQR and the five-number summary
Quartiles split the sorted data into four parts with about a quarter of the values in each. Q1 is the first quartile, the median is the second and Q3 is the third. The interquartile range, IQR = Q3 − Q1, is the spread of the middle half of the data, so a single extreme value moves it far less than it moves the range. In the commute times, leaving out the 52 shrinks the range from 26 to 9 minutes but the IQR only from 3.5 to 2.75.
The five-number summary is the minimum, Q1, median, Q3 and maximum: 26, 28.5, 30, 32 and 52 for the commute times. A box plot draws it. The box runs from Q1 to Q3 with a line at the median. Some textbooks run the whiskers all the way to the minimum and maximum; the box plot here is an outlier box plot, as in the NIST handbook, so its whiskers stop at the lowest and highest values inside the fences (26 and 35) and 52 appears as a separate circle.
Why calculators give different quartiles (Excel, TI-84 and textbooks)
There is no single agreed formula for the quartiles of a small data set: R’s documentation lists nine sample-quantile definitions, following Hyndman and Fan (1996). The calculator offers the four you are most likely to meet.
| Method | How Q1 is found | Same answers as |
|---|---|---|
| Linear interpolation (the default) | position (n − 1) × 0.25 + 1, interpolating between neighbors | Excel QUARTILE.INC, R quantile() |
| Median of halves, median left out | median of the lower half; for odd n the median is in neither | TI-83/84 1-Var Stats |
| Tukey’s hinges, median included | median of the lower half; for odd n the median is in both | R fivenum() |
| Exclusive interpolation | position (n + 1) × 0.25, interpolating between neighbors | Excel QUARTILE.EXC, Minitab, SPSS |
For the 8 values above (11, 12, 14, 15, 16, 16, 18, 21), the four methods give three different answers:
| Method | Q1 | Q3 | IQR |
|---|---|---|---|
| Linear interpolation (Excel QUARTILE.INC) | 13.5 | 16.5 | 3 |
| Median of halves (TI-84) | 13 | 17 | 4 |
| Tukey’s hinges | 13 | 17 | 4 |
| Exclusive (Excel QUARTILE.EXC) | 12.5 | 17.5 | 5 |
With an odd count the four methods pair up, so they give at most two answers: the TI-84 rule always matches QUARTILE.EXC, and Tukey’s hinges always match QUARTILE.INC. For the commute times that is Q1 = 28 and Q3 = 33 against Q1 = 28.5 and Q3 = 32. With an even count the two halves methods always agree with each other, and the two interpolation methods usually give other values, as in the table. The median is the same under every method.
If your answer doesn’t match a textbook, a TI-84 or a spreadsheet, change the quartile method. The Quartiles by method table in the results shows all four side by side.
How outliers are flagged (the 1.5 × IQR rule)
A value is flagged as a possible outlier when it lies more than 1.5 × IQR below Q1 or above Q3. These limits are the fences:
A value exactly on a fence isn’t flagged. The NIST handbook calls values more than 3 × IQR below Q1 or above Q3 extreme outliers; this calculator flags everything beyond the 1.5 × IQR fences. A flag means “check this value”, not “this is an error”: the 52-minute commute is a genuine time, just an unusual one.
Because the fences come from Q1 and Q3, the method can decide a borderline case. If the slow day had taken 38 minutes, it would be outside the upper fence of 37.25 with linear interpolation but inside the TI-84 method’s fence of 40.5.
Reading the result
- Mean is the headline, with the sum and count it comes from.
- Median, Mode and Range say which sorted values the median comes from, how often the mode appears, and the smallest and largest values.
- Q1, Q3 and IQR use the method you chose, with the lower and upper fences under Q1 and Q3.
- Quartile method names the rule and gives the TI-84 or Excel answer next to it. The Quartiles by method table lists Q1, Q3 and the IQR by all four methods, with the tool each one matches and how it finds the quartiles, and downloads as a CSV file.
- Outliers and the center lists possible outliers and how far the mean is from the median. A mean above the median often goes with a longer tail of high values, and a mean below it with a longer tail of low values, though not in every data set.
- Box plot draws the quartiles, whiskers, fences (dashed lines), possible outliers (circles) and mean (diamond). Chart data under it lists the same numbers.
- How this was calculated shows every step with your numbers, then the matching Excel formulas. For a frequency table it starts from the counts and finds the median in the cumulative counts.
- Frequency table and Sorted values list every value with its count, percentage and position; each downloads as a CSV file.
Assumptions and limitations
- Every item is one observation, or, with the frequency-table box ticked, each line is a value and a whole-number count. Data given only as class intervals, such as 60–69, can’t be entered: the values inside a class aren’t known, so their mean could only be estimated from the class midpoints.
- Quartiles, fences and outliers depend on the method chosen. The mean, median, mode and range don’t.
- Values must be between −1,000,000,000,000,000 and 1,000,000,000,000,000, and a list can hold up to 10,000 of them (for a frequency table, the counts can add up to 10,000).
- Results show up to 4 decimal places, or up to 2 more than the most decimals in your data when that is more (at most 12); the calculation keeps full precision.
- Each value is stored to about 16 significant digits. The line under the box names any value typed with more digits and gives the value used. Outliers are decided exactly on the stored values, so a value exactly on a fence is never flagged.
- This page measures spread with the range and the IQR. For the variance and standard deviation, where sample and population give different answers, Continue in the Standard Deviation Calculator under the results carries the same values there.
Common mistakes
- Finding the median without sorting. In the commute times as typed, the 8th value is 52; the median is 30.
- Taking a position as the value. For 8 values the median sits at position 4.5, which means the mean of the 4th and 5th sorted values, not the number 4.5.
- Mixing quartile methods. A TI-84 and Excel’s QUARTILE.INC can both be right and still disagree. Set the method to match the tool you are checking against.
- Dividing a frequency table by its rows. For the quiz scores, 191 ÷ 6 rows and the middle of the six scores, 7.5, are both wrong: there are 25 students, so the mean is 191 ÷ 25 = 7.64 and the median is the 13th score, 8.
- Reading “no mode” as a mode of 0. No mode means no value appears more often than the others.
- Thousands commas inside a comma-separated list. In
85,90,1,200every comma separates values, so 1,200 is read as 1 and 200 (the line under the box counts 4 numbers). Put a space after each comma between values (85, 90, 1,200) or drop the thousands comma. A thousands comma that can’t be split cleanly, as in85,90,1,000, is named instead of being read as 1 and 0. - Deleting an outlier without a reason. The 1.5 × IQR rule marks values to check. Removing a real value changes the answer: here the mean falls from 31.6 to 30.1429 minutes.
Questions
Is the average the same as the mean?
In everyday use, yes. The average of a list is the arithmetic mean, the sum divided by the count. A weighted average is different, because each value counts in proportion to its weight; for grades with credit hours or shares bought at different prices, use a weighted average calculator.
Should I use the mean or the median?
The median is generally the better center when a few values sit far from the rest, because it depends only on the middle of the sorted list. The mean uses the size of every value, so one extreme value can move it a long way, but it is the one that converts back to a total (mean × count = total). In the commute times, one slow day puts the mean 1.6 minutes above the median; when the two are far apart, giving both shows how much the extremes matter.
Does sample or population matter for the mean and median?
No. The mean, median, mode, range and quartiles are worked out the same way for a sample and for a whole population. The difference appears in the variance and standard deviation, which divide by n − 1 for a sample and by N for a population.
Sources
- 1.3.5.1 Measures of Location NIST/SEMATECH e-Handbook of Statistical Methods Definitions of the mean, the median for odd and even counts, and the mode (which need not be unique).
- 2.5 Measures of the Center of the Data OpenStax, Introductory Statistics 2e The mode as the most frequent value, more than one mode when values tie for the highest frequency, and bimodal data; the median as the better center when there are outliers; the mean of a frequency table as the sum of frequency × value over the sum of the frequencies, and only an estimate from class midpoints when the data are grouped in intervals.
- 2.3 Measures of the Location of the Data OpenStax, Introductory Statistics 2e Quartiles as the middle values of the lower and upper halves, IQR = Q3 − Q1, and the 1.5 × IQR rule for potential outliers.
- 2.4 Box Plots OpenStax, Introductory Statistics 2e The five values a box plot is built from (minimum, Q1, median, Q3, maximum).
- 2.6 Skewness and the Mean, Median, and Mode OpenStax, Introductory Statistics 2e In right-skewed data the mean is often above the median, in left-skewed data often below, though not in every data set.
- 2.7 Measures of the Spread of the Data OpenStax, Introductory Statistics 2e Sample variance and standard deviation divide by n − 1, population ones by N.
- 7.1.6 What are outliers in the data? NIST/SEMATECH e-Handbook of Statistical Methods Inner fences at Q1 − 1.5 × IQR and Q3 + 1.5 × IQR, outer fences at 3 × IQR, mild and extreme outliers, and the outlier box plot.
- quantile: Sample Quantiles The R Project, R documentation (stats package) The nine sample-quantile algorithms from Hyndman and Fan (1996), type 7 as R’s default, and type 6 as the one Minitab and SPSS use.
- fivenum: Tukey Five-Number Summaries The R Project, R documentation (stats package) Tukey’s five-number summary with lower and upper hinges.
- QUARTILE.INC function Microsoft Support Quartiles from percentiles 0 to 1 inclusive; its example (1, 2, 4, 7, 8, 9, 10, 12 gives Q1 = 3.5) is one of this calculator’s tests.
- QUARTILE.EXC function Microsoft Support Quartiles from percentiles 0 to 1 exclusive; its example (Q1 = 15, Q3 = 43 for 11 values) is one of this calculator’s tests.
- MODE.MULT function Microsoft Support Returns every mode when several values tie.
- Quartile (computing methods) Wikipedia The median-excluded halves rule used by TI-83 1-Var Stats and the median-included rule known as Tukey’s hinges.
Smart Financial Calc: https://smartfinancialcalc.com/math/descriptive-statistics-calculator/