How to use the mean, median and mode calculator
- List: type or paste the numbers, separated by commas, spaces or new lines. Blank entries are ignored, and anything that is not a number is named under the box and left out.
- Frequency table: type each value and how many times it occurs, one pair per line, such as
3 5for five 3s. - Grouped data: type each class and its frequency, such as
10-20 5. The calculator gives the estimated mean, the estimated median and the modal class.
The results show the mean, median, mode and range, the smallest and largest values, the count, the sum and the quartiles. Under the tool, Working lists the numbers in order with the middle ones in bold, explains each answer with your numbers, and shows a table with the cumulative frequency. If you are working with class test scores, the grade curve calculator also shows the average and median before and after a curve.
Mean, median, mode and range with steps
The NIST/SEMATECH e-Handbook of Statistical Methods defines the three averages like this: "the mean is the sum of the data points divided by the number of data points"; the median is the value with half the data smaller than it and half larger; and "the mode is the value of the random sample that occurs with the greatest frequency". The range is the largest value minus the smallest.
Ten students score 7, 9, 4, 7, 10, 6, 8, 7, 5 and 9 on a quiz out of 10. In order: 4, 5, 6, 7, 7, 7, 8, 9, 9, 10.
| Measure | Working | Answer |
|---|---|---|
| Mean | 72 ÷ 10 | 7.2 |
| Median | 5th and 6th values: (7 + 7) ÷ 2 | 7 |
| Mode | 7 occurs 3 times, more than any other | 7 |
| Range | 10 − 4 | 6 |
Which average to report depends on the data. The mean uses every value, so one very high or very low score pulls it along. The median hardly moves for one extreme value, so it is a better "typical value" when a few numbers are far from the rest. The mode is the only one that works for categories, such as the most common shoe size.
How to find the median
- Put the numbers in order from smallest to largest.
- If the count n is odd, the median is the middle value, the one at position (n + 1) ÷ 2.
- If n is even, there are two middle values, at positions n ÷ 2 and n ÷ 2 + 1. The median is halfway between them: add them and divide by 2.
For 3, 8, 5, 12, 5, the order is 3, 5, 5, 8, 12. There are 5 values, so the median is the 3rd: 5. Add a sixth value, 10, and the order becomes 3, 5, 5, 8, 10, 12, so the median is (5 + 8) ÷ 2 = 6.5. The median does not have to be one of the numbers in the list.
No mode, or more than one
NIST notes that the mode "is not necessarily unique". If two values tie for the most, both are modes: 1, 1, 2, 3, 3 has the modes 1 and 3 (bimodal). If every value occurs only once, as in 4, 8, 15, 16, there is no mode; Excel's MODE.SNGL and MODE.MULT return the #N/A error in that case. When every value occurs the same number of times, such as 1, 1, 2, 2, this calculator lists all of them and says so, because textbooks differ on whether to call that no mode.
Mean, median and mode from a frequency table
Twenty students say how many siblings they have:
| Siblings x | Students f | Cumulative | f × x |
|---|---|---|---|
| 0 | 4 | 4 | 0 |
| 1 | 7 | 11 | 7 |
| 2 | 5 | 16 | 10 |
| 3 | 3 | 19 | 9 |
| 4 | 1 | 20 | 4 |
| Total | 20 | 30 |
- Mean: Σfx ÷ Σf = 30 ÷ 20 = 1.5 siblings.
- Median: with 20 values it is halfway between the 10th and 11th. The cumulative column shows that values 5 to 11 are all 1, so the median is 1.
- Mode: 1, the value with the highest frequency (7).
- Range: 4 − 0 = 4.
Grouped data: estimated mean, median and modal class
When data comes in classes, such as marks of 0 to 10 or 10 to 20, the exact values are lost, so the answers are estimates. Twenty test marks:
| Marks | Frequency f | Midpoint | f × midpoint | Cumulative |
|---|---|---|---|---|
| 0 to 10 | 2 | 5 | 10 | 2 |
| 10 to 20 | 5 | 15 | 75 | 7 |
| 20 to 30 | 8 | 25 | 200 | 15 |
| 30 to 40 | 4 | 35 | 140 | 19 |
| 40 to 50 | 1 | 45 | 45 | 20 |
- Estimated mean: treat every value as its class midpoint: 470 ÷ 20 = 23.5.
- Estimated median: n ÷ 2 = 10, and the cumulative frequency first reaches 10 in the 20 to 30 class. Then L + ((n ÷ 2 − CF) ÷ f) × w = 20 + ((10 − 7) ÷ 8) × 10 = 23.75, where L is the lower boundary of that class, CF the cumulative frequency before it, f its frequency and w its width.
- Modal class: 20 to 30, the class with the highest frequency.
If the classes are written with gaps, such as 10-19 and 20-29, the calculator uses the class boundaries halfway across each gap (9.5 to 19.5, 19.5 to 29.5) for the median. Some textbooks use (n + 1) ÷ 2 in place of n ÷ 2; with large totals the difference is small.
Quartiles: which method?
The lower quartile Q1 has a quarter of the data below it and the upper quartile Q3 has three quarters below it. There are several ways to calculate them. NIST's handbook describes the different interpolation rules and names one, which puts Q1 at position 1 + 0.25(n − 1) in the sorted list, as "the method used by Excel". That is the rule behind Excel's QUARTILE.INC and this calculator's default. The other choice, median of each half, is common in school textbooks: split the sorted list in two, leaving out the middle value when n is odd, and take the median of each half. For the ten quiz scores:
| Method | Q1 | Q3 | Interquartile range |
|---|---|---|---|
| QUARTILE.INC (position 3.25 and 7.75) | 6.25 | 8.75 | 2.5 |
| Median of each half (4, 5, 6, 7, 7 and 7, 8, 9, 9, 10) | 6 | 9 | 3 |
Neither is wrong. Use the one your course or software uses, and say which when you report the result.
Mean, median and mode in Excel or Google Sheets
With the numbers in A2:A11:
| To get | Excel | Google Sheets |
|---|---|---|
| Mean | =AVERAGE(A2:A11) | =AVERAGE(A2:A11) |
| Median | =MEDIAN(A2:A11) | =MEDIAN(A2:A11) |
| Mode (one value) | =MODE.SNGL(A2:A11) | =MODE(A2:A11) |
| All modes | =MODE.MULT(A2:A11) | =MODE.MULT(A2:A11) |
| Range | =MAX(A2:A11)-MIN(A2:A11) | =MAX(A2:A11)-MIN(A2:A11) |
| Q1 and Q3 | =QUARTILE.INC(A2:A11,1) and ,3) | See below |
Microsoft says AVERAGE "Returns the average (arithmetic mean) of the arguments", and for MEDIAN, "If there is an even number of numbers in the set, then MEDIAN calculates the average of the two numbers in the middle." MODE.SNGL returns "the most frequently occurring, or repetitive, value"; MODE.MULT returns "a vertical array" of the modes and, Microsoft notes, "must be entered as an array formula". QUARTILE.INC with 1 gives the "First quartile (25th percentile)"; Microsoft's example, 1, 2, 4, 7, 8, 9, 10, 12, gives 3.5, as this calculator does.
In Google Sheets, MEDIAN will "interpolate between the two center values" for an even count, MODE "Returns the most commonly occurring value in a dataset", and MODE.MULT "returns an error if all values occur only once". Sheets also has QUARTILE and QUARTILE.INC, but Google's help describes QUARTILE as returning "a value nearest to a specified quartile", so check its answers against the method your course uses.
Questions and answers
How do I find the mean, median, mode and range?
Mean: add the numbers and divide by how many there are. Median: put them in order and take the middle one, or the average of the two middle ones. Mode: the value that occurs most often. Range: largest minus smallest.
How do I find the median of an even number of values?
Put the values in order and take the two in the middle, at positions n / 2 and n / 2 + 1. Add them and divide by 2. For 3, 5, 5, 8, 10, 12 that is (5 + 8) / 2 = 6.5.
Can a set of numbers have no mode or two modes?
Yes. If every value occurs once there is no mode. If two values tie for the most, both are modes, and the data is called bimodal.
Why is the mean different from the median?
The mean uses the size of every value, so a few very high or very low values pull it toward them. The median only depends on the middle of the ordered list, so it stays put. A big gap between the two tells you the data is lopsided.
Why are the grouped data answers called estimates?
Grouped data only tells you how many values fall in each class, not what they are. The mean assumes each value sits at its class midpoint, and the median assumes the values are spread evenly across the median class.
Why do my quartiles differ from my textbook or calculator?
There are several methods for quartiles. This calculator uses Excel QUARTILE.INC by default and also offers the median of each half, which many textbooks use. Pick the one your course uses.
Sources
Checked on 9 October 2026. If a rule has changed, please tell us.
- NIST/SEMATECH e-Handbook of Statistical Methods: 1.3.5.1 Measures of Location
- NIST/SEMATECH e-Handbook of Statistical Methods: 7.2.6.2 Percentiles
- Microsoft Support: AVERAGE function
- Microsoft Support: MEDIAN function
- Microsoft Support: MODE.SNGL function
- Microsoft Support: MODE.MULT function
- Microsoft Support: QUARTILE.INC function
- Google Docs Editors Help: AVERAGE
- Google Docs Editors Help: MEDIAN
- Google Docs Editors Help: MODE
- Google Docs Editors Help: MODE.MULT
- Google Docs Editors Help: QUARTILE