Mean, Median, Mode and Range Calculator

Your values

Separate numbers with spaces, commas, semicolons or line breaks, or paste a spreadsheet column. Use a decimal comma only when values are separated by spaces, semicolons or line breaks. Up to 10,000 numbers.

Only need the numbers? The average calculator gives a compact summary.

Result

Mean

Median

Mode

Range
Midrange
Count (n)
Sum
Minimum
Maximum

Sorted data (n = 9)

2, 4, 4, 4, 5, 7, 7, 9, 12

Dot plot of the dataSolid line: mean 6. Dashed line: median 5.

Step by step

  1. Mean: add the values and divide by how many there are.
    ∑xi=2+4+4+4+5+7+7+9+12=54\sum x_i=2+4+4+4+5+7+7+9+12=54
    xˉ=∑xin=549=6\bar{x}=\frac{\sum x_i}{n}=\frac{54}{9}=6
  2. Median: the count is odd, so the median is the single middle value of the sorted list.
    n+12=9+12=5\frac{n+1}{2}=\frac{9+1}{2}=5
    x~=x5=5\tilde{x}=x_{5}=5
  3. Mode: count how often each value occurs.

    Frequency table

    ValueFrequency
    21
    4mode3
    51
    72
    91
    121

    The mode is 4: it occurs most often, with a frequency of 3.

  4. Range: subtract the smallest value from the largest.
    R=xmax⁡−xmin⁡=12−2=10R=x_{\max}-x_{\min}=12-2=10
  5. Midrange: take the mean of the largest and smallest values.
    xmax⁡+xmin⁡2=12+22=7\frac{x_{\max}+x_{\min}}{2}=\frac{12+2}{2}=7

About this tool

Mean, median and mode are the three common measures of the centre of a data set, and the range shows how spread out it is. The mean is the arithmetic average, the median is the middle value of the sorted list and the mode is the value that occurs most often. Each answers a slightly different question, which is why homework and exam questions usually ask for all of them.

This calculator shows the working for every measure, including the median positions and a frequency table for the mode, so you can check your own solution step by step. If you only need the numbers, the average calculator gives a compact summary.

How it works

Type or paste your numbers into the box. They can be separated by spaces, commas, semicolons or line breaks, so a column copied from a spreadsheet works as it is. The calculator sorts the values and shows the mean, median and mode together with the range and the midrange.

Below the results you can follow each step as you would write it out by hand: the sum divided by the count for the mean, the position of the middle value or values for the median, and a frequency table that shows which values occur most often. The dot plot marks the mean and the median, so you can see at a glance whether a few large or small values pull the mean away from the middle.

xˉ=1n∑i=1nxi,R=xmax⁡−xmin⁡\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i,\qquad R=x_{\max}-x_{\min}

Example

Take the data set 2, 7, 4, 9, 4, 12, 5, 4, 7. Sorted, it reads 2, 4, 4, 4, 5, 7, 7, 9, 12. The sum is 54 and there are 9 values, so the mean is xˉ=54/9=6\bar{x} = 54/9 = 6.

With 9 values the median is at position (9+1)/2=5(9 + 1)/2 = 5, which is 5. The value 4 appears three times, more than any other value, so the mode is 4. The range is 12−2=1012 - 2 = 10 and the midrange is (12+2)/2=7(12 + 2)/2 = 7. Here the mean (6) is larger than the median (5) because the single large value 12 pulls it up.

Assumptions and limits

Every value has the same weight; for weighted averages or grouped data in classes, use a different method. Decimal commas are recognised only when values are separated by spaces, semicolons or line breaks, because otherwise commas separate values. Results are shown to 10 significant digits and use standard double-precision arithmetic.

Textbooks differ on one detail: when every value occurs equally often (for example 1, 1, 2, 2), some say there is no mode and others call every value a mode. This calculator reports no mode in that case and explains why in the working.

Frequently asked questions

How do I find the median of an even number of values?

Sort the values and take the mean of the two middle ones, at positions n/2n/2 and n/2+1n/2 + 1. For 1, 3, 5, 7 the middle values are 3 and 5, so the median is (3+5)/2=4(3 + 5)/2 = 4.

Can a data set have more than one mode?

Yes. If two values tie for the highest frequency the data set is bimodal, and with three or more it is multimodal. For 1, 1, 2, 3, 3 the modes are 1 and 3. If no value repeats, there is no mode.

Which is better, the mean or the median?

The mean uses every value, so it suits roughly symmetric data and situations where totals matter. The median ignores how extreme the largest and smallest values are, so it describes skewed data such as incomes or house prices better. The mode is the only one of the three that also works for categories, such as the most common shoe size.

What are the range and the midrange?

The range is the largest value minus the smallest and is the simplest measure of spread. The midrange is the mean of the largest and smallest values. Both depend only on the two extremes, so a single outlier changes them a lot; the interquartile range from the quartile calculator is more robust.

How is this different from the average calculator?

Both find the mean, median and mode. This page is built for learning and checking homework: it shows the sorted list, the sum, the median positions, a frequency table and a dot plot. The average calculator gives the same numbers in a compact summary without the working.

Link with your values

Add these parameters to this page’s address to open it with the values filled in, for example to share a calculation or to link to it from an AI assistant. The result is calculated in the browser: the page HTML shows an example for the default values, and the tool sets the data-url-params attribute once the link’s values are applied.

ParameterValueIf omitted
valuesData setvalues separated by commas: 2,4,4,6required

Examples

  • ?values=3,8,8,10,15,21
  • ?values=4.5,2,9.25,2,7

Write decimals with a point. Encode a space as %20, + as %2B, # as %23 and & as %26.

Result elements: [data-result-block="mean_median_mode_calculator"]