Skip to main content
CalcMax

Harmonic Mean Calculator

Result

86.3118

Harmonic mean

Average
86.6000
Count
5
Step by step
5 / (1/85 + 1/90 + 1/78 + 1/92 + 1/88) = 86.3118

The harmonic mean of a list is how many values there are, divided by the sum of their reciprocals — the average you want when what is fixed is the total, and what varies is how much each unit of it costs you. It is the only one of the three means that is smaller than the geometric mean, and it is the right answer to a question that comes up constantly in ordinary life: a trip out at 30 and back at 60 has an average speed of 40, not 45, because the slow half of the journey occupies more of the time. The arithmetic mean would be right if half the time were spent at each speed; the harmonic mean is right because half the distance was. This calculator prints that division in full, term by term, since with reciprocals involved the expression is the only way to see what was actually done, and it prints the arithmetic mean beside the answer so the gap between them is visible.

Formula

Harmonic mean = n ÷ (1/x₁ + 1/x₂ + … + 1/xₙ) = n ÷ Σ(1/xᵢ)

xᵢ
One value in the list, and every one of them has to be greater than zero. A zero makes 1/x infinite, so the sum of reciprocals is infinite and the answer comes out as a plain zero that looks like a result; a negative value can make the denominator zero or push the answer outside the range of the data
1/xᵢ
The reciprocal of a value — its rate turned into a time, or a time turned into a rate. This is the step that makes the harmonic mean behave so differently from the other two: a small value has a large reciprocal and pulls hardest on the answer, which is exactly what should happen when the small value is a slow speed that swallows the hours
Σ(1/xᵢ)
The sum of those reciprocals, and the denominator of the fraction. It is what the panel writes out term by term when the list is short, because this sum is the whole calculation: everything else is one division at the end
n
How many values there are, printed on the results panel. It multiplies back up what the reciprocals divided down — without it the answer would be the reciprocal of an average rather than an average

Use the harmonic mean when the numerator is fixed and the denominator varies: a fixed distance covered at different speeds, a fixed quantity of work done at different rates, a fixed voltage across resistors of different values. The classic case is a journey in two halves — 30 out and 60 back averages to 40, because the return leg takes half as long as the outward one, so the slow speed has twice the time to weigh on the answer. Averaging the two speeds arithmetically gives 45, which would be the right answer if half the *time* had been spent at each speed, and it is worth being clear about which of the two the question is asking. The same structure covers fuel economy over two legs of a trip, the average price paid when a fixed budget is spent at two different prices, and parallel resistance, where the total is the reciprocal of the sum of reciprocals — for equal resistors that reduces to the resistance divided by their count, which is the harmonic mean of a list of identical values. Do not use it on quantities that add up: for marks, heights or amounts, the harmonic mean is a smaller number with no reading behind it, and the further the values spread the further below the arithmetic mean it falls.

Worked examples

  1. Five test scores

    1. Take the reciprocal of each value: 1/85 = 0.011765, 1/90 = 0.011111, 1/78 = 0.012821, 1/92 = 0.010870, 1/88 = 0.011364
    2. Add them: 0.011765 + 0.011111 + 0.012821 + 0.010870 + 0.011364 = 0.057931
    3. Divide the count by the sum of reciprocals — the rounded 0.057931 above does not divide back: 5 ÷ (1/85 + 1/90 + 1/78 + 1/92 + 1/88) = 86.3118

    The panel deliberately does not print that middle sum of 0.057931: it is a rounded figure, and 5 ÷ 0.0579 = 86.3558, so a reader who checked the arithmetic with it would get a different answer from the one on the panel. The expression is printed instead, which says what was done without inviting a division that does not come out. This example also completes the chain on this site: for these five numbers the harmonic mean is 86.3118, the geometric mean 86.458 and the arithmetic mean 86.6, so all three sit in the order the inequality promises, and the spread between them is a reading of how uneven the list is.

  2. Out at 30, back at 60 — the average speed is 40

    1. Take the reciprocals: 1/30 = 0.033333 and 1/60 = 0.016667
    2. Add them: 0.033333 + 0.016667 = 0.05
    3. Divide the count by the sum: 2 ÷ 0.05 = 40

    This is the example the whole page exists for. Drive 60 miles out at 30 mph and 60 miles back at 60 mph: the outward leg takes two hours and the return leg one, so three hours for 120 miles, which is 40 mph. The arithmetic mean of 30 and 60 is 45, and 45 would be correct if one hour had been driven at each speed — that is a question about time, and this one is about distance. Going the other way, 30 out and 30 back is 30 either way, because there is nothing for the two methods to disagree about when the values are equal.

  3. Three values: 1, 2 and 4

    1. Take the reciprocals: 1/1 = 1, 1/2 = 0.5, 1/4 = 0.25
    2. Add them: 1 + 0.5 + 0.25 = 1.75
    3. Divide the count by the sum: 3 ÷ 1.75 = 1.7143

    The reciprocals run the other way from the values, and that is the whole character of this average: 1 is the largest value and contributes the largest term, 1, while 4 is the largest by value and contributes the smallest, 0.25. So the answer sits well below the arithmetic mean of 2.3333, and closer to the small end of the list. The values here are geometric — each is double the last — and a list like that is where the three means separate most sharply: 1.7143, then 2 as the geometric mean, then 2.3333.

  4. Crossing 1: the reciprocals reverse the order

    1. Take the reciprocals: 1/0.5 = 2 and 1/2 = 0.5
    2. Add them: 2 + 0.5 = 2.5
    3. Divide the count by the sum: 2 ÷ 2.5 = 0.8

    Values below 1 have reciprocals above 1, so the smaller value of this pair produces the larger term and dominates the denominator: 0.5 contributes 2 while 2 contributes only 0.5. The harmonic mean therefore lands at 0.8, close to the small value, while the arithmetic mean of 1.25 sits between the two. Getting this backwards — dividing the sum by the count instead of the count by the sum — produces 1.25, which is the arithmetic mean and looks entirely plausible on the panel, so the order matters and this pair is where a mistake in it shows up most clearly.

  5. Eight values, written with a Σ

    1. Take the reciprocal of each value: 1, 0.5, 0.333333, 0.25, 0.2, 0.166667, 0.142857, 0.125
    2. Add them: 2.717857
    3. Divide the count by that sum: 8 ÷ 2.717857 = 2.9435

    Above six values the step-by-step line switches to the shorthand, 8 / Σ(1/xᵢ) = 2.9435, because each reciprocal is four characters at least and a two-hundred value list would otherwise produce a line of well over a thousand. The abbreviation keeps the only thing that cannot be guessed, which is which way up the fraction goes. The gap here is the widest on the page: 2.9435 against an arithmetic mean of 4.5, because these eight values spread evenly across a factor of eight, and the harmonic mean is the mean most affected by the small end of a list.

Limitations

Every value must be greater than zero, and the page refuses a list containing a zero or a negative. A zero is the dangerous one, because the reciprocal of zero is infinite and the answer that comes out of the formula is a plain zero — a number that looks like a result rather than like a failure. A negative value can make the sum of reciprocals zero, which would be a division by zero, or push the answer outside the range of the values themselves. This mean is only meaningful where a fixed total is being shared out, as with a fixed distance covered at varying speeds or a fixed budget spent at varying prices; applied to marks, heights or amounts it produces a smaller number with no interpretation, and the more the values vary the further below the arithmetic mean it lands. The middle sum of reciprocals is shown rounded in the working only if you add it up yourself — the panel prints the expression instead, precisely because a rounded intermediate value would not divide back to the printed answer. The list is capped at 200 values, and a token like 1,500 is refused rather than guessed at, because a comma between digits is a decimal comma in much of the world; write 1500 or 1.5.

Frequently asked questions

How do I calculate the harmonic mean?
Take the reciprocal of every value, add those up, then divide how many values there are by that sum. For 30 and 60 the reciprocals are 0.033333 and 0.016667, which add to 0.05, and 2 ÷ 0.05 = 40. The order matters: it is the count divided by the sum, not the sum divided by the count, and getting it the wrong way round gives the arithmetic mean instead.
Why is the harmonic mean smaller than the other two?
Because taking a reciprocal reverses the order of the values, and then every value contributes in proportion to how small it was. A small value has a large reciprocal and pulls the denominator up, which pulls the answer down, and the effect grows with how far apart the values are. For equal values all three means agree; the more the list spreads, the further the harmonic mean falls below the geometric mean, which in turn falls below the arithmetic mean.
Why is the average speed 40 and not 45?
Because the two legs took different amounts of time. Over the same distance at 30 and at 60, the slower leg takes twice as long, so it gets twice as much say in the answer: two hours at 30 plus one hour at 60 is 120 miles in three hours, which is 40 mph. The figure of 45 is the arithmetic mean, and it answers a different question — the average speed when equal amounts of *time* are spent at each speed rather than equal distances.
When should I use it instead of a plain average?
When what is fixed is the total and what varies is the rate — a fixed distance covered at varying speeds, a fixed amount of work done by machines of different rates, a fixed budget spent at different prices, a fixed voltage across resistors of different values. If instead the entries are amounts that add up, or a set of values each of which should count equally, the arithmetic mean is the right one and the harmonic mean would be a smaller number with nothing behind it.
How does it relate to parallel resistance?
Directly: the total resistance of resistors in parallel is the reciprocal of the sum of their reciprocals, which is this formula without the final multiplication by the count. Two 10-ohm resistors in parallel give 5 ohms, and this page's harmonic mean of 10 and 10 is 10 — the mean reciprocal cancels out, because the harmonic mean of a list of identical values is that value, and so is the arithmetic mean and the geometric mean. The interesting cases are the unequal ones: the parallel total always sits below the smallest resistor, exactly as the harmonic mean always sits below the smallest value in a list.
Can the values be less than 1?
Yes, as long as they are all greater than zero. Values below 1 have reciprocals above 1, so they contribute the largest terms and the answer lands close to them: for 0.5 and 2 the harmonic mean is 0.8, well below the arithmetic mean of 1.25. That is the same rule as everywhere else on this page, read in the other direction — the small value does the pulling, whichever side of 1 it sits on.

References

Related calculators