Average Calculator

Mean and median answer different questions, and on skewed data they are not close. Nine people earning 30,000 and one earning a million have a mean of 127,000 and a median of 30,000, and only one of those numbers describes anybody in the room. This shows both, along with everything else you would otherwise compute one at a time.

Separate with commas, spaces or line breaks. In weighted mode put one "value, weight" pair per line, for example 90, 3
Average Calculator — Mean, Median, Mode and Weighted Average from a List of NumbersBuildFigure

Three things are called the average

The mean is the total divided by the count. The median is the value in the middle once the list is sorted, or the midpoint of the two middle values when the count is even. The mode is whichever value shows up most often, and a list can have several modes or none at all. When somebody says "average" with no qualifier they almost always mean the mean, which is unfortunate, because the median is often the number they actually wanted.

Worked on the default list, 85, 92, 78, 92, 88, 95, 70: the sum is 600 across seven values, so the mean is 85.71. Sorted it reads 70, 78, 85, 88, 92, 92, 95, so the median is 88 and the mode is 92, appearing twice. The range is 25.

When the mean and the median part company

The mean is pulled by every value in proportion to how far out it sits. The median only cares about position. That is why one large value moves the mean a long way and the median barely at all. The gap between the two is the cheapest skew test there is: if the mean is well above the median, the long tail is on the high side, and the median is the better description of a typical case.

Kind of dataUsually reported asWhy
Household income, house pricesMedianA long right tail drags the mean above almost everyone
Response times, page load timesMedian and a high percentileThe mean hides the slow tail that users actually notice
Repeated measurements of one thingMeanErrors sit on both sides and cancel, so the mean is the best estimate
Shoe sizes, part counts, votesModeThe value that occurs most is the one you stock or order

Weighted averages

Use the weighted mode when the values do not all count equally. The formula is the sum of value times weight, divided by the sum of the weights. A midterm worth 40 percent scored at 80, and a final worth 60 percent scored at 90, gives (80 x 40 + 90 x 60) / 100 = 86, not the 85 you would get by averaging 80 and 90. The same arithmetic covers a grade point average where credit hours are the weights, a blended cost where quantities are the weights, and an average price paid across several purchases of different sizes.

The check that catches most mistakes is this: a weighted average must land between the smallest and largest value you fed it. If it does not, a weight is negative or a line was parsed as a value when it was meant as a weight.

The geometric mean, and when the arithmetic one lies

For anything that multiplies rather than adds — growth rates, returns, dilution factors — the arithmetic mean gives the wrong answer. Gain 50 percent one year and lose 50 percent the next and the arithmetic mean of the two rates is zero, while you are actually left with 75 percent of what you started with. The geometric mean, the nth root of the product, gets this right. This page computes it whenever every value is positive, which is the only case where it is defined.

How the list is read, and what it will not read

Commas, semicolons, spaces, tabs and line breaks all count as separators, and anything that is not part of a number is stripped off each item, so 85 points reads as 85. The one thing that will trip you is a thousands separator: 1,000 is split into 1 and 000 because the comma is a separator here, not a grouping mark. Strip grouping commas before pasting. The list is capped at 5,000 numbers, and the weighted mode at 300 lines; past that only the first entries are used and the result says so.

Questions people ask

Which average should I report?

Ask what the number is for. If you need something that adds up correctly — total cost, total load, a budget line — you need the mean, because the mean times the count returns the total and the median does not. If you need something that describes a typical case to a reader, and the data has a long tail on one side, the median is more honest. If you are stocking or ordering discrete items, the mode is the one that matters. Reporting the mean and median together costs one extra line and immediately tells the reader how skewed the data is, which is why this page always shows both.

Can a list have more than one mode?

Yes. If two or more values tie for the highest count, all of them are modes and all of them are listed here. If every value appears exactly once there is no mode at all, and this page says so rather than picking one arbitrarily. Some tools quietly return the first value in that situation, which is meaningless. A genuinely bimodal list — two clear peaks with a dip between them — is usually a sign that two different populations got mixed into one dataset, and the fix is to split them rather than to average them.

Why does a sum sometimes end in a long string of digits elsewhere but not here?

Because binary floating point cannot represent most decimal fractions exactly. Adding 0.1 and 0.2 in any language that uses IEEE 754 doubles, JavaScript included, produces 0.30000000000000004. Every result on this page is rounded to twelve significant digits before it is displayed, which removes that artefact while leaving any genuine digit intact, and is then formatted to the number of decimal places you asked for. The arithmetic itself is done in full double precision, so only the display is affected.

Do I need a percentage calculator for percentage data?

Not for averaging it — percentages average like any other number, as long as they all share the same base. If the bases differ you need a weighted average with the bases as the weights, which is what the weighted mode is for. For percent change, percentage points, markup and margin, the percent toolkit covers those separately and keeps the denominator visible, which is where most percentage errors come from.

Related